Search This Blog

Loading...

Wednesday, February 19, 2014

AutoCAD ® Electrical Symbols on Tool Palettes

Hey there!

Wow... this one has been a while coming.  I posted a teaser a few weeks ago thinking I had the question answered, and all I had to do was write the post.  Then a few more hours of testing turned up some show stopping problems and I pulled the teaser... dejected and frustrated.

Some of you may not know what I'm talking about, so here is some background.  AutoCAD ® Electrical has a massive symbol library of schematic symbols for electrical, hydraulic/pneumatic and for P&ID's.  It also contains a huge library out of the box of electrical panel footprint symbols, for creating physical panel layouts.  All of these libraries are fully customizable.  you can add to them, subtract from them and even modify the existing symbols through the Symbol Builder tool in the program.  These symbols are all accessible through an Icon Menu that has multiple screens and nested menus.  This is also manageable through the Icon Menu Wizard tool.

Autocad Electrical Icon Menu

Lots of flexibility there, but not the most user friendly interface, in my humble opinion.  Of course, it may just be that this is not the way I am used to doing things, coming from so many years of using plain AutoCAD ® for all of our schematics.  It may even go all the way back to having all of my symbols right in front of me on one of those massive tablets we used to use back in the day.

AutoCAD Menu Tablet R14

Anyone remember these?  They could be configured to include custom commands or symbols pretty much anywhere on the tablet, but primarily in the empty top section.  You could edit the menu file, and there was a drawing of this tablet screen where you could add or delete or move things around.  Plot it off, tape it down and off you went.



These days my preferred method for inserting blocks is the tool palette.  if you have not looked into all that tool palettes can do for you, I highly recommend you do.  Take a look on the Autodesk ® University website, there are several online classes from past AU's that are available for download.  In Autocad we have several palettes that contain our symbol libraries for both electrical and flow diagram schematics.

A little over a year a go, we made the decision to switch our electrical schematics to AutoCAD ® Electrical.  This was mainly due to the fact that it was added to our Product Design Suite.  We had it.... let's use it.  So, I set about learning the basics.  I am by no means an electrical designer.  It's a language I simply do no speak.  We've gotten pretty proficient at using the AcadE to create our ladder diagrams and panel layout drawings, but I know I have a long way to go toward leveraging the real power behind the software.  Meanwhile, I learned that AcadE can also be used to create P&ID's.... a large part of our business.  By using the same software for both schematics, they can be linked in a single project and tag numbers on the P&ID can be associated to tags on the electrical diagrams.

Well, project work gets first priority here, as you can imagine.  Have to pay the bills after all.  Special projects get more of a back seat.  So, it's been quite a while since I first looked into this conversion.  Now that I am jumping into it with a little bit of time to work with, I decided to try to figure out a way to put the P&ID (and eventually electrical) symbols onto our tool palettes to simplify things.  After several failed attempts using a variety of methods, I was ready to throw in the towel and embrace the icon menu path.

So, once I started down that road, I posted a question of the Autodesk ® Discussion Forums for AutoCAD ® Electrical, asking if it were possible to dock the icon menu somewhere so I wouldn't have to keep opening it up every time I wanted to place a symbol.  A very talented individual, who has helped me in the past but whose real name I do not know, suggested that I take a look a the API help for AutoCAD ® Electrical.  Now, I've heard about the API... but I never thought I would ever touch that area.  But, on his advice, I looked under the Help menu and saw "Additional Resources".... under which I saw API Help, and found my way into a place that can only be described as a treasure trove of customization tools.  I don't know why I never thought to look here before.

It wasn't long before I found a tool that might do what I was looking for, and it was so simple that I laughed at all of my pathetic efforts to date.  I had no idea what I was looking for.  I figured it might be in the section under Schematic Components, so I opened that section of the help up and found a list of commands and a description of what each one did, and examples on how to use them.  Working my way down the list I found this:

AutoCAD ® Electrical AutoLISP Reference
The description shows that this is a way to call the Insert Component command from the command line, and skip the Icon Menu.  You provide the block name, and specify a value for the parameters following it.  So simple.  I tried it out and it worked from the command line immediately.  If it can work there, it can work on a tool palette.  I added a command to my test palette, and put this as the command string:

(c:wd_insym2 "HDV1_VLV_BLK" nil nil 1)

The block name is in parentheses, and if no path is given, the system will use your preset search paths.  The two "nil" parameters allow for user input for the insertion point, and next set the scale to 1 for the block.  The option 1 at the end tells it to open the component editor as soon as the block is placed.  This does exactly what the icon menu does.... right from the convenience of my tool palettes.  I was a very happy man when I saw this.  Now I just have the tedious task of turning all of my old symbols into smart AutoCAD ® Electrical symbols, and creating the commands on my palettes.... I should be done by..... summer?  Maybe?  Meanwhile, I'll have to dig back into that API and see what other trouble I can get myself into.  More later?

Enjoy!

“Autodesk ® screen shots reprinted with the permission of Autodesk, Inc.  Autodesk ® , AutoCAD ® , DWG, the DWG logo, Vault ®, Autocad Electrical ® and Inventor ® are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and other countries.”  Programs and programmers' information used with permission.  Thanks guys!

2 comments:

  1. Great write up! I never thought of using the tool palette but what a great idea to at least store your most frequently used symbols

    ReplyDelete
  2. Thanks for the info! I have also found a great P&ID Symbols Legend through Lucidchart and it is very helpful and straightforward! Give it a try!

    ReplyDelete