AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Another Circuit Builder Question

15 REPLIES 15
Reply
Message 1 of 16
testsubject
600 Views, 15 Replies

Another Circuit Builder Question

Me again! 😉

 

When inserting Terminals via the Circuit Builder, has anyone been able to associate the Multilevel terminals? I have 3 terminals in the circuit that are Top, Middle, and Bottom and it would be great if I could automatically associate them.

 

Thanks in advance!



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
15 REPLIES 15
Message 2 of 16

Bob,

 

I don't know of a documented way to do this. Are the terminals part of a tempplate that gets inserted and already has the other terminal properties preassigned? The LINKTERM value must be unique for each terminal group. That would be the tricky part. Do your terminals carry the LINKTERM as an attribute? AcadE supports either attribute or xdata of rthis value.

 

Let me think about this and if I come up with something I will post it here.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 3 of 16

Pat,

 

Does the LINKTERM value get auto-generatred each time a terminal group is associated? If so, I am unsure of how to automate this. I may have to do the association after the circuit is installed.

 

Thanks for the info.



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 4 of 16

Bob,

 

as long as the terminals come in with the multi-level values already defined I did figure out a way to get the LINKTERM values assigned appropriately by Circuit Builder.

 

I combined a couple of methods documented in the Help under the Advanced Productivity - Customize Circuit Builder - How to section.

 

  • Assign different attribute values on a multi-pole insert
  • Assign attribute values using AutoLISP

This requires editing the spreadsheet. You need to have a basic understanding of how the spreadsheet works so you can find the correct line to edit. In my test I edited the 3ph_H worksheet which corresponds to the 3ph Motor Horizontal non-reversing. The X001 code is for the motor terminals. If you look in the UI_PROMPT_LIST column you can see the options for motor terminals. For me it was Square, Round, None. I used the Square option for my test and changed the values in its COMMAND_LIST field.

 

It started out as -

(c:ace_cb_multipole  #xyz nil "HT0001" 3 #scl 4 nil)

 

I changed it to -

(c:ace_cb_multipole  #xyz nil "HT0001" 3 #scl 4 "_L=|LINKTERM=(setq #linkterm (ace_generate_new_assoc_id))|LINKTERM=(eval #linkterm)|LINKTERM=(eval #linkterm)"

 

So the text I show in red is what I changed.

 

I used a lisp call to get a unique ID for the LINKTERM. (This is an internal call and not a published API call but it should work ok.) I assign it to a variable, then I use that variable on all 3 terminals.

 

Of course this should only be done if the terminals are actually predefined as multi-level. You never want to have terminals with the same LINKTERM values unless they have the other necessary xdata values for multi-level. But it sounded like from your original post that your terminals are defined as 3-level already you just needed a way to associate them.

 

Hope this helps. Circuit Builder can be a little intimidating but it is pretty powerful once you understand the templates and spreadsheet.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 5 of 16

Pat,

 

Thanks for the info.

 

You are right in that Circuit Builder can be pretty scary!  😉

 

I have a question about using the mulitpole API. My terminal are located at different locations in the schematic, not next to each other like in the circuit you used for your example. WIll this still work if I have each terminal at what essentially is the points of a triangle relative to each other?

 

I named my terminal marker blocks XT001, XT002, and XT003 so that I could give each one a different terminal number on insert.

 

This is the COMMAND_LIST code I am using.

 

(C:ace_cb_insym #xyz nil "VT0002" #scl 8 nil)(C:ace_cb_attr "TERM01" "1" nil nil)

 

Now it sounds like I should insert the terminal itself instead of a marker block. Is that what you are suggesting? Also, do I need to add LINKTERM to the terminal symbol (i.e., VT002.dwg)?

 

Another thing, is there somewher that tells of the different arguments that are available, i.e., _TAGFMT? I tried searching for this and could not find it.

 

Thanks for all the help.

 



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 6 of 16

Bob,

 

The same general idea can work if not inserting using the multipole. So for the XT001 in the COMMAND_LIST you might have something like (I didn't actually try this method so if it doesn't work let me know and I will set up a test at my end) -

 

(C:ace_cb_insym #xyz nil "VT0002" #scl 8 "TERM01=1;LINKTERM=(setq #linkterm (ace_generate_new_assoc_id))")

 

For the XT002 terminal -

(C:ace_cb_insym #xyz nil "VT0002" #scl 8 "TERM01=2;LINKTERM=(eval #linkterm)")

 

For the XT003 terminal -

(C:ace_cb_insym #xyz nil "VT0002" #scl 8 "TERM01=3;LINKTERM=(eval #linkterm)")

 

I think if you want to assign these different values during the building of the circuit then I would put a marker block at each location that will get a terminal. Even if they are always inserted they can be done this way. You can have them in the spreadsheet even if you don't want them to show up on the dialog with options to select. Just don't put anything in the UI_* columns for that code. Then when the circuit is built that terminal will always be inserted.

 

Yes, the LINKTERM attribute must be present on the terminal block library symbol for this to work. 

 

Look at the topic - "Circuit Builder drawing templates" to see a list of the various predefined values that can be used to assign attributes. The topic shows the values that can be used on the marker blocks in the MISC1 attribute. But, I believe these can also be used in the spreadsheet. There are many examples in the Advanced Productivity - Customize Circuit Builder - How to topics that show this being done in both the marker block and spreadsheet. So it should give you an idea on how any of these can be used in the spreadsheet.

 

Regards,

Pat

 



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 7 of 16

Pat,

 

Thanks a lot! Now I have a whole bunch more pages to read!  <grins>

 

I tested out the script you gave me and it is very close. I am currently inserting 2 of the 3 levels to test things out (Top and Bottom). Both terminals did associate but both came in as TOP.  It seems I need to change the XDATA value of VIA_WD_LNUMBER to 01 for the top terminal and 03  for the bottom terminal. How do I do that? Is this an attribute I can add to the dwg? I have not had much luck with working with the XDATA values in the past...

 

Thanks,



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 8 of 16

Multi-level terminals carry a bunch of xdata to tell AcadE how many levels it is, which terminal represents which level, etc. They must be present especially if you plan on using Terminal Strip Editor.

 

LTOTAL = total number of levels.

LNUMBER = 2 character number that shows what level this terminal represents

L##LABEL = where ## is the 2-character number for each level. This should be present on each terminal for each level. So if 2 levels then you would have L01 LABEL and L02Label on that terminal. It carries the Level Description.

L##PINR - right pin

L##PINL = left pin

L##WIREPERC = wires per connection

 

These are usually added as xdata rather than attributes since the same terminal symbol can be used for terminals of different number of levels. So say a terminal is set as 2 levels you would not want any L03* attributes on it. Although I am not sure it would cause any problems in AcadE if they were there. All xdata names get a VIA_WD_ prefix onto it so LTOTAL would be VIA_WD_LTOTAL.

 

So that is the explanation of the names and xdata. The trick is how to assign these as Circuit Builder inserts them. I need to think on that one and see if I can think of a good way. I don't think any of the Circuit Builder APIs deal with xdata. I will post when I think of something.

 

If you are in a hurry you can build it and then use AEXDATA to edit the terminals after Circuit Builder is done and assign the appropriate LNUMBER values.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 9 of 16

Thanks again Pat!

 

I did try this for my XT003 (Botttom terminal) but it did not work.

 

(C:ace_cb_insym #xyz nil "VT0002" #scl 8 "TERM01=3; LINKTERM=(eval #linkterm);(c:ace_cb_eval '(c:wd_mod_1000_xdata (entlast) 'via_wd_lnumber' 03)')")

 

The first terminal was inserted with a via_wd_lnumber value of 01. Makes sense...

 

I thought maybe using ace_cb_eval would allow me to access the wd_mod_100_xdata API. Maybe I am missing something...

 

Edit: I did think about your workaround already so two great minds   😉

 



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 10 of 16

That might work but the LNUMBER is actually a string value. So maybe try -

 

(C:ace_cb_insym #xyz nil "VT0002" #scl 8 "TERM01=3; LINKTERM=(eval #linkterm);(c:ace_cb_eval '(c:wd_mod_1000_xdata (entlast) 'via_wd_lnumber' '03')')")

 

The trick is playing with all the single and double-quotes I think. At least that is what I was going to try.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 11 of 16

That did not work. Nice try though. I will keep trying.



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 12 of 16

After looking at the Help on c:ace_cb_eval I wonder if it should be

 

(c:ace_cb_eval "(c:wd_mod_1000_xdata (entlast) 'via_wd_lnumber' '03')")



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 13 of 16

Pat,

 

Doesn't this need to be encapsulated in a set of quotes because it is the last argument of the Command_List? If so, we have 3 sets of quotes to account for and I thought I read that the outermost set has to be doubles and all internal sets have to be single. Maybe you can check that for me and make sure I interpreted it correctly.

 

Thanks,



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 14 of 16

Bob,

 

I've been looking at this all morning and think I have something that works. I think the problem was that entlast was not returning the terminal. When the terminal is inserted it breaks the wire creating a new wire and I think entlast was returning the wire. So for this to work we need a way to find that last terminal that was inserted. That is where it got messy.

 

The only way I could think to do this was -

First, set a variable using entlast right before the terminal is inserted. Here is what I have for the second terminal being inserted in the COMMAND_LIST field of the spreadsheet.
(c:ace_cb_eval "(setq GBL_wd_t2 (entlast))") (C:ace_cb_insym #xyz nil "HT0002" #scl 8 "TERM01=2;LINKTERM=(eval #linkterm)")

 

Second, write a lisp function that can be called to return the first terminal after that last entity. I have attached it. This must be loaded automatically at startup which can be defined using  the APPLOAD command.

 

Third, add a call in the ANNOTATE_LIST field of the second terminal (probably could be in COMMAND_LIST field but it was hard to work with there) that looks like this -

(c:ace_cb_eval "(c:wd_mod_1000_xdata (c:find_term) 'via_wd_lnumber' '02')")

 

This extra call should be made for all terminals after the level 1 terminal. It must use the same variable, GBL_WD_t2, since the lisp function is looking for that. The level 1 terminal should still set the #linkterm with the call to generate the unique id as before. I don't think you need to set the lnumber on it though since Circuit Builder does this by default.

 

Maybe there was an easier way to accomplish this but I couldn't find one. Hope this works for you.

 



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 15 of 16
testsubject
in reply to: testsubject

Pat,

 

That did it!!!

 

Thanks so much for your help.

 

I did have to go back and remove the LINKTERM attribute from VT0002/HT0002. It seems that this attr was being added during the terminal insertion and I was ending up with 2 LINKTERM attributes in the block. The code was not working until I did that.

 

Now to start fleshing out the rest of the circuit.



Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 16 of 16

Bob,

 

glad that worked. I would be surprised if it is adding the LINKTERM attribute during Circuit Builder. If you are using the terminal symbols supplied with AcadE they would already have the LINKTERM attribute on them. It is very small so maybe you missed it?

 

Anyway, sounds like you are in business with that.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost