Controlling the Machine

  • Coinciding with the acquisition of VIA Development, Nate joined Autodesk in March of 2003 after a decade stint as an entrepreneur following a two-decade stint as a controls engineer and software applications developer at Owens-Corning. Nate is now the lead product architect for AutoCAD Electrical. He loves this stuff.

    About Nate

Latest Post

  • Edit Wire Number - Tip
    August 28, 2006 02:07 AMby Nate Holt

    The small dialog for the "Edit Wire Number" command is set up to display off to the side of your screen. But if you're running a very high resolution, this could put it far from where you're actually working.

    blog_editwnum.jpg

    To have this dialog pop up closer to where you're working, just drag it over to a more convenient position before dismissing it with an "OK". Then, each time you run the command, it should remember the new position and pop up at that spot.

    This new position will be maintained during your current AutoCAD Electrical session only. Once you exit AutoCAD Electrical, it resets to its original pop-up position in the corner of your screen.

    0 Comment | Add CommentIn Controlling the Machine > All

Previous Post

  • Oh Sheet
    August 23, 2006 05:13 AMby Nate Holt

    The customer changed the spec at the last minute. He wants the AutoCAD Electrical "SHEET" assignment to be equal to the 3rd and 2nd from last characters of the drawing's file name. Hundreds of drawings need to be updated now!

    Remain cool. Let's write a little utility to make the update for one drawing. Then we'll make a little script file and, using AutoCAD Electrical's Project-Wide Utilities tool, apply it across our full project drawing set.

    Okay, a few key pieces of information: the SHEET assignment is carried on attribute "SHEET" of the AutoCAD Electrical invisible settings block, "WD_M". So our utility needs to scan the drawing for the WD_M block insert and pop in a new value for attribute SHEET carried on this block. The little utility is shown here:


    dwgnam_to_sheet.jpg


    It's pretty basic. It is just an ascii text file, file name dwgnam_to_sheet.lsp, that creates a selection set of everything named "WD_M". Hopefully there's only one of these on the drawing. Then it extracts the appropriate 2-characters from the drawing's file name and inserts this in to the WD_M block's "SHEET" attribute. Assuming that this all happens, it then issues a QSAVE to save the drawing change.

    Now, let's write a little script file which we'll have the AutoCAD Electrical's project-wide utilities function run against every drawing listed in our customer's project. We just need two lines: one to APPLOAD our utility and one to execute it. So, our little script file (file name update_sheet.scr) might be just these two lines where the first is a "load" and gives the full path name of the AutoLisp file (use forward slashes or double back slashes here!) and the second line is the command name defined in the AutoLisp file (the name after the "defun c:" part near the top of the file):

    (load "c:/my cool utilities/acade is awesome/dwgnam_to_sheet.lsp")
    dwgnam_to_sheet

    Select AutoCAD Electrical's project-wide utilties function, enter the full path/filename to our script file "update_sheet.scr", and off it goes. In a minute or so our drawing set is good to go!



    0 Comment | Add CommentIn Controlling the Machine > All

  • Ice-cube Tray Phenom
    August 19, 2006 01:17 PMby Nate Holt

    http://www.its.caltech.edu/~atomic/snowcrystals/icespikes/icespikes.htmI've noticed some strange things growing in my ice-cube tray. It doesn't happen all the time, maybe one out of every 40-50 cubes. Here's a two-fer:

    ice_spikes_002.jpg

    The valve controlling the refrigerator's ice maker broke and I was too cheap to fix it... went back to the old-fashioned manufacturing method of low-tech ice cube trays. But I did install an under-sink reverse osmosis water filter and started creating extra-clean cubes. Taken together, this weird phenomenon began to appear. Ice spikes shooting straight out of the tops of random cubes at odd angles. Defying gravity.

    ice_spikes_001.jpg

    Had to figure this out. What's the explanation?

    Water expands as it freezes, about 10% (remember grade school and the iceberg talk?... they look big but another 90% is hidden below the surface...). This had to be a clue.

    Let's say I put the ice cube tray into the freezer. The top of the water surface is exposed to the cold air blowing over it in the freezer compartment and starts to freeze quickly. The liquid water below drops more slowly toward the freezing point and starts to expand as it closes in on the freezing point of water at 32F / 0C. But the top surface of the cube is already pretty much frozen, so pressure builds and something has to give. In most cases the whole top surface of the semi-frozen cube pushes up a bit. Look at the close-up above. The cubes on the left-hand side are especially pushed up.

    But, in rare cases... maybe there is a tiny weak spot in the top of the cube that the slightly warmer water, under pressure due to expansion below, oozes up through. As this water oozes out, the outer surface of the "ooze" keeps freezing while the inner water oozes up even higher. Maybe this process builds these weird looking ice needles.

    UPDATE: I am not (totally) nuts.


    0 Comment | Add CommentIn Controlling the Machine > All

  • Automatic Display of Internal Part Numbers on Electrical Components
    August 18, 2006 04:43 AMby Nate Holt

    This came up earlier today from a user. He had set up the USER1 field in the catalog lookup database to carry his company's internal part codes for standard industrial components. He then added an "internal part number" attribute called "USER1" to his library symbols and hoped to be able to have AutoCAD Electrical automatically populate them with values pulled from the "USER1" field in the catalog lookup database.

    Didn't work. AutoCAD Electrical pulls this data into various reports but is not set up to push it out to the symbols themselves. The symbols carry the "key field" attributes like MFG and CAT but that's it.

    So, how can we query the database based upon MFG/CAT assignments on symbols and then push other related values back out to other visible attributes on the symbols (i.e. an attribute for the internal part code value pulled from the catalog database)?

    Here's How

    It was so nice to just point him to the key piece of information he needed, already in the AutoCAD Electrical help system. It was in the form of a sample AutoLisp utility in the "API" section of the help (upper right-hand of the main AutoCAD Electrical Help dialog > Section F > ace_get_cat_data Function) and is reproduced below.

    user_cat_2_symbol.bmp


    It is currently set up to map USER1 through USER3 field values from the catalog lookup out to attributes with the same name.

    Do It Yourself

    If you want to try this, just edit this file and adjust the names as required. Make sure your target symbols have the necessary attribute(s). APPLOAD the file and then type user_cat_2_symbol [Enter] at the AutoCAD command prompt.

    If you want to pull in other fields from the catalog database, the list of the available fields that are returned by the call to (c:ace_get_cat_data...) are shown in the Help. For example, let's say you want to write the QUERY2 field value from the symbol's catalog lookup record out to an attribute on your symbol called "AMPS". The Help shows the QUERY2 field returned as the 9th element of the return list (index starting at 0). So, add this set of lines to the above sample program:

    (if (/= (nth 9 cat_rec) "")
    (progn
    (c:wd_modattrval ben "AMPS" (nth 9 cat_rec) nil)
    ) )

    It's just that easy, and fun to boot!







    2 Comments | Add CommentIn Controlling the Machine > All

  • Hollywood
    August 17, 2006 02:09 PMby Nate Holt

    One of the hardest things I ever tried to do... sit in a sound booth with a microphone stuck in my face and try not to sound like a blubbering fool. But Shellie was a total pro. You can view our "AutoCAD Electrical Screencast" results at this URL: http://www.autodesk.com/ace-screencast

    0 Comment | Add CommentIn Controlling the Machine > All

  • Nate's Simple AutoLisp - Lesson 003
    August 13, 2006 01:21 AMby Nate Holt

    Warning/Disclaimer: I'm neither a teacher nor am I versed in the theory behind AutoLisp programming. But I invite you to come along for a ride. This stuff is not only fun, but it can be useful ! Each lesson should take 5-10 minutes.

    So, here we go...

    Lesson 003 - Reusable Programs - Saving as an Executable File

    In the first two lessons we were just typing and executing AutoLisp expressions from the command prompt. Now we'll go the next step and create our first program saved as an "executable" file.

    Here's where we ended the last lesson: a single line AutoLisp expression that would display the block name of a picked block insert.

    nate_lesson002c.jpg

    Today let's take this one line expression, expand it a bit to make it more readable, and save it to an executable file. Then we can load and run this utility any time we want.

    Let's use the built-in Visual Lisp editor.
    1. Type VLIDE [Enter] at your AutoCAD command line.
    2. Select "File" > "New File" > "File" > "Save As" and give it a file name of BN.LSP
    3. Now type in the code shown below starting with the line "(defun c:bn .... )"

    lesson_003a.jpg


    OK. This "program" is pretty much the same as our original one-line expression we typed in at the command line. It's just a bit cleaner and prettier looking, PLUS, we've saved it to a file so we can call it up and run it at any time.

    Let's test it and then we'll talk a little bit about it...

    4. Select "Tools" > "Load Text in Editor". This loads your program.
    5. Now let's give it a test. Mouse back to the AutoCAD command window. Type BN [Enter] at the command prompt. This should execute your program. If all is well, you'll see a "Select block insert:" prompt. Pick on a block insert and, hopefully, your program will execute to the end and display the insert's block name.

    Here's the minimum information you should be aware of at this point:
    a) The first line, "(defun c:bn...)" is where we're defining our own custom command (function) called "bn". The c: part has nothing to do with a drive on your computer, it means that this is an external command being defined.
    b) Whenever you see a "setq" key word, this means that some variable is getting assigned some value. The variable name follows the setq key word and the value follows the variable name.
    c) The "princ" keyword instructs the program to output to the command line whatever follows this keyword, whether it be a fixed text string, numeric value, or contents of some variable.
    d) The number of open parenthesis " ( " and closed ones " ) " need to be balanced. If not, your program will not load or will choke when it runs.

    There's more but our 10 minutes are about gone... we have to hurry.

    Our program runs one time and then quits. Let's make a simple modification to make it "loop" around so we can keep picking. When we're done, we can just pick in "empty space" or hit [ESC] key to quit.

    So, here's our modified program. We've added a "while" key word and added another set of parenthesis to keep everything balanced:

    lesson_003b.jpg


    Now when we load and run it, it is a bit more useful.

    Finally, let's exit the Visual Lisp environment and try APPLOADing and running our new program. In other words, we do not need to invoke the Visual Lisp editor to run our program. We can just do a normal APPLOAD and off we go.

    1. Exit Visual Lisp. Now you should be back at the AutoCAD command prompt.
    2. Type APPLOAD and browse to your saved copy of bn.lsp. Load it.
    3. Type BN at the command line. It should run, just like before...!

    Okay, time's up. Next lesson we'll push a bit further into this fun stuff.

    0 Comment | Add CommentIn Controlling the Machine > All

  • Angles to Dots
    August 11, 2006 01:00 AMby Nate Holt

    This issue popped up recently. A user had a lot of drawings set up using the IEC-style angled tee marker symbols at wire "tee" intersections.
    001.jpg

    But for another customer he needed these flipped to the generic "dot" symbols instead, like this:

    002.jpg

    He could flip the drawing default to "dots" and then re-insert the dot symbol at each angled tee marker location. AutoCAD Electrical would swap out this one instance and replace with the dot symbol and reconnect the wiring. But this was too tedious. Is there a quicker way?

    Yes.

    Here's a very small AutoLisp utliity that might work (tested on ACE2007, seems to work fine). Just APPLOAD this and type ANGLES_TO_DOTS at the command line.

    003.bmp







    0 Comment | Add CommentIn Controlling the Machine > All

  • Introducing Andrew de Leon
    August 4, 2006 11:36 PMby Eric Strassheim

    Welcome to the newest addition to the Autodesk manufacturing-focused Blogs. The "Drawing the machine" Blog will focus on 2D mechanical drafting and design. It will also provide tips and tricks on how to optimize the powerful features in AutoCAD Mechanical.

    Introducing Andrew de Leon

    With over 15 years of experience using mechanical CAD products, Andrew is a de facto expert on the topic. He has spent time as a drafter, designer, CAD administrator, and project manager as a customer of Autodesk but also as an application engineer with Envision Solutions (Australian reseller). He was the creator of several publications on AutoCAD Mechanical and Inventor which helped him win the "best technical representative" award from Autodesk. In his most recent role, the master of CAD for so long is now defining new features and functionality as a product designer for AutoCAD Mechanical.

    Andrew got his start with AutoCAD release 9, and the rest is history. He is known for his savvy knowledge of just about every little known command in AutoCAD, and often solves problems very creatively. In addition to knowing all the ins and outs of AutoCAD Mechanical, Andrew is a big fan of Inventor and Productstream. With knowledge of the full suite of products and his great experience, we are pleased to have his presence on the manufacturing community portal.

    I encourage you to send your questions, concerns, and thoughts about mechanical CAD to Andrew because I know he wants to help others learn the many benefits of the Autodesk solution. I'll warn you that he is a true Aussie at heart so you might hear a "good day mate" every now and then or someone might use his nickname "Tops" for his always positive approach to finding solutions. We hope you enjoy the site and get a lot out of it!

    Eric Strassheim
    AutoCAD Mechanical Product Manager

    0 Comment | Add CommentIn Controlling the Machine >

Subscribe to Blog

Want to keep up with the latest? Subscribe to the RSS feed today.

RSS

Categories

All

Blog Roll

AUTODESK MANUFACTURING COMMUNITY

Ellipsis
The official Autodesk Manufacturing Tech Evangelist blog
Under The Hood
Brian Schanen on Vault, Productstream, and more
In the Machine
Garin Gardiner hosts the official blog of the Inventor Product Team
Controlling the Machine
Archive of Nate Holt's AutoCAD Electrical posts

RECOMMENDED

Being Inventive
The official support blog for the Autodesk Inventor product line
Between the Lines
Shaan Hurley's AutoCAD Blog
It's Alive in the Lab
Scott Shepherd's Lab's Blog
Beyond the Paper
Volker Joseph's DWF Blog
Lynn Allen's Blog
Staying current with AutoCAD and Autodesk

PEER

AutoCAD Electrical Etcetera
Nate Holt shares AutoCAD Electrical tips and tricks.
Autodesk Manufacturing Northern European
The official blog for the Autodesk Northern Europe Manufacturing Technical Team.
Sean Dotson's Site
Sean Dotson's mCAD Tutorials, Forums, Admins & more
The Autodesk Informer
Helpful sites, tutorials, and industry news
CAD Professor
Inventor, Inventor LT, and AutoCAD news and updates.

Send to a Peer

You must login to share pages.

Feedback

Tell us what you think of the site.

Send Feedback