Circuit Generation by Layer Combos - AutoCAD Electrical

  • Controlling the Machine is no longer being updated. Don't worry, though, you can still follow Nate Holt at his new blog, AutoCAD Electrical Etcetera. You'll find it at http://nateholt.wordpress.com. Or you can subscribe to his feed to get latest words of wisdom automatically: http://nateholt.wordpress.com/feed/. You also can continue to view the Controlling Machine archives for Nate's AutoCAD Electrical tips and tricks.

    About Nate

Latest Post

  • Circuit Generation by Layer Combos - AutoCAD Electrical
    May 21, 2008, 11:53 PM Nate Holt

    Creating custom circuit designs by exposing/hiding combinations of layered sub-circuit options!

    You have a standard design but with many options. You draw each option on its own layer and save the whole thing as a template drawing. Then, you create a desired design by copying the template and turning on (or off) a specific set of option layers.

    There are a couple problems with this approach and AutoCAD Electrical, but they can be overcome (!).

    First of all, AutoCAD Electrical will include all components marked with catalog information in its BOM reporting, even components on a layer that has been frozen or turned off.  So, for options that you do not want in your final design, the components and wiring on those layers need to actually be deleted from the drawing (not just frozen or layer turned off).

    Second, AutoCAD Electrical interprets line entities to be wires only when those line entities are found on one of the user-defined layers specifically set aside for wiring. The layer name itself gives the wire's color and gauge value and perhaps insulation type. So, pushing a couple components and interconnected wiring out to an "option" layer will defeat the ability of the line wire to retain its wire layer name assignment.

    This second issue, pushing wiring out to a specific option layer but providing a means to restore the original wire layer names if the option is "selected", is tricky. But a solution is to save the original layer name as an invisible "Xdata" value right on each wire segment as it is pushed to its option layer.

    The attached autolisp file contains a set of "tools" to make this all possible. Here is a listing of the five small functions contained in this file:

    files/21401_21500/21481/file_21481.lsp  (download this file and rename PushPullLay.lsp)

    (APPLOAD the PushPullLay.lsp file. Then each function below can be typed in at the command line prompt.)

    PushToLay [Enter] - prompts you for a new "option" layer name. Then prompts you to pick wires and components that are to be associated with that option. The utility moves the picked items to the target option layer. The original layer names are saved on each moved component as an Xdata value to be used by PullFromLay or (pull_lay <layerlist>) functions below. You would use this tool to help create the original circuit "template" drawing with all of its various option layers.

    PullFromLay [Enter] - prompts you for an existing "option" layer name. Then it pulls all components and wiring found on that layer (layer can be frozen or OFF, no problem) and restores the wires and components to their original layer assignments (saved when originally set up by PushToLay above).

    EraseLay [Enter] - prompts you to enter an unused "option" layer that you want to remove from the active drawing (i.e. so that it will not show up in the BOM report).

    These next two functions might be useful encoded into an overall VB, VBA, or AutoLISP application to auto-generate your circuit designs:

    (pull_lay <layerlist) - same as PullFromLay above but the layer name or names are passed as a list. For example, let's say you want to restore layers "OPTION3" and "OPTION55" with one call and no user prompts. You would set up your VBA or AutoLISP application to make this call:   (pull_lay (list "OPTION3" "OPTION55"))

    (erase_lay <layerlist) - same as EraseLay above but the layer name or names are passed as a list. For example, erase everything on OPTION4:  (erase_lay (list "OPTION4"))

    How it works

    Here is the "PushToLay" function. It prompts you for the targer "option" layer name. Then you select the components and wiring that is to make up this option. The utility process each entity in the selection set. It saves the existing layer name on the entity as a "PUSH2LAY" Xdata value. Then it pushes the entity to the target layer.

    The PullFromLay utility pretty much works in reverse. It prompts you for the option layer name. The utility then creates a selection set of everything it finds on that layer. Then it processes each of these entities, reads the save layer name from the PUSH2LAY Xdata value. It restores the entity to that layer. Presto... the option suddenly appears, neatly wired up and everything displayed on the appropriate layers!

     

     

     

     

     

     

    3 Comments | Add Comment Controlling the Machine >

Comments

  • May 29, 2008 06:06 AM Arlene Mccoy

    Hi Nate I wanted to tell you how I create my layered template drawings. My circuit is first drawn with all of the options. Then I create each new layer name. Next I copy all of the option with a base point. I then delete that option that is on my clipboard, and paste it as a BLOCK back in at the same base point. That block is then put on its layer. When I turn off and freeze that layer ACADE does not see it at all since it is blocked. When the layers needed are turned on and thawed they need exploded to be active again. 2008 is great as it highlights blocks, and that makes it easy to find parts of the dwg that need exploded. The unused blocked layers can remain (off and frozen) in the drawing until some one wants to change the options. So if that happens the exploded layers not needed should be deleted or put back on their blocked layer. This has been working just fine for us, although we don't use the bom feature or the panel builder so I don’t know if those would be affected or not. Thanks Arlene

  • May 29, 2008 11:07 PM Nate Holt

    Hi Arlene, That's a great idea, seems like it would be simplier your way than the one I outlined in the posting! And the BOM should be fine... I do not believe that AcadE would "see" the components nested inside of the unexploded blocks.

  • August 3, 2009 10:10 AM Martin Karow

    Both of these methods seam a bit complicated for a routine task. Currently I am supporting a company that has a standard produce with 167 possible electrical option. I am looking fo a good way to create the "custom" drawings by providing a selectible options screen. I am very suprised AutoCad Electrical has not already delt with this situation in a user friendly way. Anyone know of any other way to address this problem? My last company wrote its own VB script within ACAD but I would never call it a real "Solution"



You must be logged in to post a comment.

Subscribe to Blog

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

RSS

Tags

You must be logged in to add a tag.

Send to a Peer

You must login to share pages.

Feedback

Tell us what you think of the site.

Send Feedback