-
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.
-
Vectoring Existing Projects to Reference AutoCAD Electrical 2008 Libraries
May 30, 2007 02:17 AMby Nate HoltA 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.

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.
-
Flipping to In-line wire number tags - AutoCAD Electrical
May 8, 2007 08:16 PMby Nate HoltThis 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

A F T E R

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).

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.
-
Switching Between Standards - AB Journal article
May 2, 2007 03:44 PMby Nate HoltHere 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:
