-
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.
-
European-style Terminal/Cable connection charts - AutoCAD Electrical
July 17, 2007 12:49 AMby Nate HoltWhat to do when you have all the data but really need it output to a special chart format? The problem is this: AutoCAD Electrical's "Terminal Strip Editor" accumulates and displays terminal strip data in a report format, including cable connections. But a number of Europeans users are accustomed to seeing the terminal strip and cable connections in a fixed row/column format something like this:

The terminals shown, for terminal strip "-X3", are displayed in a horizontal row down the middle of the chart. The component connections for each terminal are shown in rows above and below the terminal number row. Connected cables are entered in horizontal rows along the upper and lower sections of the chart, one row per cable. Wire core or conductor assignments align horizontally with the cable number and vertically with the terminal to which each attaches.
The Terminal Strip editor tool has almost all of the needed information, lacking only the cable part number and description assignment.
We can pull it all together with a custom AutoLISP utility and write it out to a custom terminal/cable chart. The first step is to create a blank drawing chart form with strategically placed attributes.
Setting up a "smart" chart
This chart has attribute definitions inserted at key points in the X-Y chart. The custom utility (described below) will read these attributes and extrapolate them out to allow every cell in the chart to be accessible to the utility WITHOUT having to define an attribute for each cell.
For example, attribute TERM_1 identifies the position, rotation, and text size of the charts first terminal number. Attribute TERM_2 identifies the position of the second one.

Attribute MAX_COLUMNS defines the total number of terminal positions in the chart. Taken together, the utility will be able to calculate the correct insertion point for terminal number text for any terminal position on the chart.
Custom AutoLISP Utility
This utility makes a number of calls into the AutoCAD Electrical API including a call to retrieve the same data that is used by AutoCAD Electricals Terminal Strip Editor. The utility also references the attribute names set up in the smart chart block insert above.
Try it for yourself
If this looks interesting, follow these steps to get set up:
1. Download the sample chart "term_cable_test.dwg" here.
2. Download the AutoLISP utility "term_cable.lsp" revised file here and copy it to some path in your ACAD file search path.
3. Download the AutoLISP dialog "DCL" file "term_cable.dcl" here and copy it to some path in your ACAD file search path.
To RUN:
1. Activate an AutoCAD Electrical project. Open the sample chart drawing, active on your screen (it does not have to be added to your active project).
2. APPLOAD the "term_cable.lsp" utility.
3. Type TERM_CABLE [Enter] at your AutoCAD command prompt. In a few moments you should see a dialog like this pop up:

4. Select the terminal strip you want to format to the chart. Hit OK.
How can I get this sample chart block on my own border?
Not a problem. Download the base chart block/attribute drawing "cable_form.dwg" here.
Insert it as a block on a copy of your border drawing.
How can I use my existing chart with this utility?
If your existing chart has attributes set up in a manner similar to the example chart above, you can edit the term_chart.lsp AutoLISP utility to look for your chart's attribute names instead of the ones in the sample. If your chart does not have attributes set up to work this way, go ahead and add them. Use the base sample chart block insert drawing "cable_form.dwg" as a guide.
UPDATE: user found some issues with the term_cable.lsp file. It was erroring out under certain conditions. Please download the revised version here.
-
Matching cable tag-IDs to connected components - AutoCAD Electrical
July 3, 2007 07:15 PMby Nate HoltThis request came in about an hour ago. The user wants to quickly assign cable tag-IDs to match a connected component device tag-ID. For example, a multi-conductor cable that ties to a 3-phase motor symbol... wants the cable tag-ID to match the motor's.
Not a problem typing in the data, but if you have a lot of these, would be nice to have an easier-to-use tool.
Here's one way. It's not rocket science by any stretch. But it works. You launch this little AutoLISP utility. Then you just pick on the target component and then window the cable marker symbols.

Whatever tag-ID value is found on the picked component gets copied to all of the cable marker symbols.

The motor's tag gets copied to all four markers, but is visible only on the top "parent" symbol as the attributes on the three "child" marker symbols below it are flagged "invisible".
How it works
This utility makes two calls into the AutoCAD Electrical "API" to retrieve an attribute value (from the picked component) and to modify attribute values (to write the component's tag-ID back out to the cable marker block inserts).

The utility is just one big "while" loop. It prompt for the master motor or switch device and then saves the picked entity name in variable "mtr_en". Then it prompts to window (or select) all of the cable markers to copy this value to. These are stored in a selection set "ss". Then another "while" loop takes over and cycles through each of the windowed cable marker block inserts. For each one it writes the master tag-ID value out to the tag-ID attribute on the cable marker symbol.
Download this utility here. To use, APPLOAD the file and then type COPY2CABLE [Enter] at the command line.
Don't hesitate to modify this short utility to do other cool things!