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

  • Vectoring Existing Projects to Reference AutoCAD Electrical 2008 Libraries
    May 30, 2007 02:17 AMby Nate Holt

    A nice thing about AutoCAD Electrical projects is also something that can be a hassle when it's time to upgrade to the next release. AutoCAD Electrical stores the default symbol library path right in the project file. On the plus side, this means that you can flip between different projects and each on can auto-vector to the assigned symbol library for that project or customer. The down-side is that, at upgrade time, the new default symbol library probably installs into a folder with a slightly different name (i.e. ...\...2008\... instead of ...\...2007\...).

    So, is there an easier way to flip legacy AutoCAD Electrical project files to point at a new or different symbol library path?

    This question came up on the AutoCAD Electrical Discussion Group recently. Autodesk's Mike Spitzer put together a little utility that may do the job. It has several functions but a key one addressing the above is this: It allows you to point at a folder full of your legacy project ".wdp" files and do a search / replace on the default library path.

    spitzer01.jpg

    Mike's posting is reproduced here:

    While riding in the minivan going to visit relatives over the Memorial Day
    weekend, I found some free time to look into this. Attached is a lisp file
    that should do what you want. After you appload the lisp file, the lisp
    routine that you run is called change_projects and has four parameters The
    first two parameters are used if you want a wholesale change of the
    schematic and panel paths. The third and fourth parameters are used if you
    want to just find and replace sections of a path for example change "2006"
    to "2007". When you run this function you will be presented with a Browse
    for Folder dialog. You select the folder and it will look for all .wdp
    files in that folder and all subfolders and apply the same change to all.
    Here are some examples and what it should/might do in each:

    Current schematic path entry - "c:/program files/autodesk/acade
    2007/Libs/jic125/;c:/program files/autodesk/acade
    2007/Libs/pneu_iso125/;c:/program
    files/autodesk/acade
    2007/Libs/hyd_iso125/;c:/program files/autodesk/acade 2007/Libs/pid/"
    Current panel path entry - "c:/program files/autodesk/acade
    2007/Libs/panel/"

    (change_projects "c:/symbols/schematic/" "c:/symbols/panel/" nil nil)
    New schematic path entry - "c:/symbols/schematic/"
    New panel path entry - "c:/symbols/panel/"

    (change_projects nil nil "2007" "2008")
    New schematic path entry - "c:/program files/autodesk/acade
    2008/Libs/jic125/;c:/program files/autodesk/acade 2008/Libs/pneu_iso125/;c:/program files/autodesk/acade
    2008/Libs/hyd_iso125/;c:/program files/autodesk/acade 2008/Libs/pid/"
    New panel path entry - "c:/program files/autodesk/acade 2008/Libs/panel/"

    If you decide to try this out, please BACKUP before attempting to use it to
    make sure it does what you expect it to. It has not had much testing. If
    it does work then the thanks go to my wife for driving and my kids for
    sleeping and letting me work on this on the drive:).

    Regards,

    Mike



    Download Mike's utility here. So, there it is. Give it a try. Remember to back up your project ".wdp" files first before attempting to run this find/replace tool.

    0 Comment | Add CommentIn Controlling the Machine > All

Previous Post

  • Flipping to In-line wire number tags - AutoCAD Electrical
    May 8, 2007 08:16 PMby Nate Holt

    This question came up in the last couple days... the design is done but the customer decides that he wants all wire number tags to be shown as embedded "in-line" with the wiring. Gee, wish he'd said something about this earlier. AutoCAD Electrical can be set up to position wire number tags above, below, or embedded in-line. But once they're there, the only tool available to flip them is a selective toggle-to-inline, one pick at a time. Tolerable, but not a real happy prospect.

    B E F O R E
    garrett01.png

    A F T E R
    garrett02.png

    AutoCAD Electrical's API steps in to meet the need

    So, what to do? No problem. There's an exposed call in AutoCAD Electrical's API (documentation here: Select "Help" --> "Electrical Help Topics" --> "API Help"). The function is (c:ace_toggle_inline...) and it is set up to toggle a passed wire number entity name to be positioned "in-line".

    Let's write a short program and put a drawing-wide selection set "wrapper" around this function. Then we can turn this "single pick / toggle" API call into a drawing-wide "do 'em all now" function.

    Here's the program. You can see the above mentioned API call embedded in the middle of it. Around it is a call to "ssget" to create a drawing wide (the "_X" part) selection set. This selection set is of all block INSERT instances that have a block name matching the names used by AutoCAD Electrical (the "WD_WNH..." part).

    garrett04.png

    After the selection set "ss" is created, the program enters a "while" loop and processes each wire number block insert, one at a time. It passes each wire number's block insert entity name to the API call. This call then toggles the above or below wire number to be "in-line". That's it! Pretty simple.

    You can type this program in to the Visual Lisp editor or using any text editor and name the file wnum_2_inline.lsp. Then APPLOAD it and type wnum_2_inline [Enter] at the command line.

    Or, you can download the file here.


    2 Comments | Add CommentIn Controlling the Machine > All

  • Switching Between Standards - AB Journal article
    May 2, 2007 03:44 PMby Nate Holt

    Here is an AutoCAD Electrical article that appears in this month's issue of the Allen-Bradley "The Journal". It is entitled "Schematic Standards Get a Flip - ...aid in internation documentation."

    http://literature.rockwellautomation.com/idc/groups/literature/documents/br/5058-br101_-en-p.pdf#page=43

    The article had a screen-shot showing the source code for a little Lisp utility. Didn't plan on it being printed so small. Here's the original version:

    angles_to_dots.png


    0 Comment | Add CommentIn Controlling the Machine > All

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