Din Rail API command issues

Din Rail API command issues

Anonymous
Not applicable
1,829 Views
9 Replies
Message 1 of 10

Din Rail API command issues

Anonymous
Not applicable

Hello everyone,

 

I am trying to implement some automation into placing din rails into our drawings. I am trying to use the API command "ace_ins_dinrail" (API help reference listed below). The problem I am encountering is the command doesn't seem to insert the correct din rail. It will always insert the most recent placed din rail, or if no din rail has been place yet, the din rail at the top of the list will be inserted. This remains unchanged no matter what manufacturer/part number are given as parameters. I am using AE2013, so if this is a problem related to AE2013 and fixed in AE2019, we are switching soon so you can disregard my issue. An example of the problem is given below.

 

ace_ins_dinrail API documentation:

Capture1.PNG

 

Locations/length/orientation of din rail always work, it is simply the incorrect MFG/part. Example of the issue:

 

(Open new drawing)

 

(c:ace_ins_dinrail "PANDUIT" "G2X3WH6" "" (list (list 0 0 0) 10 "H" 1.0 3)) --> inserts din rail AB 199-DR1

 

(Manually place din rail PANDUIT G2X3WH6 using GUI commands)

 

(c:ace_ins_dinrail "PANDUIT" "G2X3WH6" "" (list (list 0 0 0) 10 "H" 1.0 3)) --> inserts wire way PANUIT G2X3WH6 correctly

 

(c:ace_ins_dinrail "AB" "199-DR1" "" (list (list 0 0 0) 10 "H" 1.0 1)) --> inserts wire way PANUIT G2X3WH6 as well

 

(Manually place din rail AB 199-DR1 using GUI commands) 

 

(c:ace_ins_dinrail "PANDUIT" "G2X3WH6" "" (list (list 0 0 0) 10 "H" 1.0 3)) --> inserts din rail AB 199-DR1

 

(c:ace_ins_dinrail "AB" "199-DR1" "" (list (list 0 0 0) 10 "H" 1.0 1)) --> inserts din rail AB 199-DR1 as well

 

0 Likes
Accepted solutions (1)
1,830 Views
9 Replies
Replies (9)
Message 2 of 10

TRLitsey
Advisor
Advisor

Hi there,

 

I don't remember 2013 to well so this maybe a dumb question but why are you not using the din rail insert tool?  With the Panel tab active, select Icon Menu, select Din Rail icon, use the drop down to select rail type.  Now you can ether fill in dimensions or pick from/to.  To use the from/to click on the Pick Rail Information button, the window disappears while you put your pointer to the start point of the rail and click once, then move to the end point you want for the rail and click there, ACE will draw the rail for you.  The info for the rail is in a file which is called wddin.xls.  Read up on this file and you can edit it with Excel and add more rail types, more mfg., add wire way, add wire duct and probably a few other things I have not thought of.  Be sure to make a back-up copy of the file before editing just in case there is a little oops.

 

Good luck

 

Screenshot - 7_11_2018 , 8_01_45 AM.png

 

Screenshot - 7_11_2018 , 8_02_42 AM.png

 

Screenshot - 7_11_2018 , 8_04_38 AM.png

 

Screenshot - 7_11_2018 , 8_05_18 AM.png

Please mark as a solution if this works for you, kudos are always welcome
0 Likes
Message 3 of 10

Anonymous
Not applicable
I guess I should've been more clear. I am trying to automate these actions. It needs to have zero use of the GUI and use just the command line.
0 Likes
Message 4 of 10

TRLitsey
Advisor
Advisor

Zero use of the GUI?  Really?  I am not even going to ask why.  Hope someone out there has a silver bullet for your fix.

 

Good luck

 

 

Please mark as a solution if this works for you, kudos are always welcome
0 Likes
Message 5 of 10

rhesusminus
Mentor
Mentor
It seems that you've done good research here, so I'll just tag @Anonymous to see if she can confirm this.

Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Autodesk Expert Elite Alumni
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
0 Likes
Message 6 of 10

PatMurnen_Adsk
Alumni
Alumni
Accepted solution

Hi,

I checked this out in 2019 because I don't have any other versions installed right now. I usually have older versions like 2013 but got a new computer recently and haven't reinstalled. But, I think what I suggest below should work in 2013.

 

I think the issue you are having is because you aren't passing the Assembly code (3rd column in spreadsheet ASSYCODE). The program is trying to match all 3 values, manufacturer, catalog, assembly code and when it doesn't find a match to all 3 it uses the first line in the spreadsheet.

Try this line -

(c:ace_ins_dinrail "PANDUIT" "G2X3WH6" "C2WH6" (list (list 0 0 0) 10 "H" 1.0 3))

where I have added the assembly code value from the spreadsheet "C2WH6" instead of the blank value in your original call.

Regards,

Pat Murnen

 



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

Autodesk, Inc.

Message 7 of 10

Anonymous
Not applicable

Pat,

 

Thanks for the solution. This also works in 2013.

 

Lucas Rigsby

0 Likes
Message 8 of 10

PatMurnen_Adsk
Alumni
Alumni

Lucas, Oh good, I'm glad that worked. -Pat



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

Autodesk, Inc.

0 Likes
Message 9 of 10

capplegate7CEK3
Advocate
Advocate

For those who come across this thread in the future. I was again struggling with this after upgrading to 2026 from 2023. The upgrade had nothing to do with the issue. I found that the issue was my custom "WDDINRL.XLS" with my parameter names was not in my Options search path. The insert dinrail from icon worked but my LISP would not. The API and the built in menu must find the Excell file differently. Once I added [myDrive:/"path"/catalogs] and moved the search path above the default  [C:/"path"/catalogs]

 

If the api doesn't find a match, it must use the last working profile Not the first in the list like others have ovserved.

0 Likes
Message 10 of 10

rhesusminus
Mentor
Mentor

When using the AIp it's generally a good idea to use the findfile call to see what the API returns:

(c:ace_find_file "WDDINRL.XLS" 3)

 

Also, when using custom files, it's generally a good idea to remove the access to the original files. So, renaming the AeData folder in my documents is a must.


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Autodesk Expert Elite Alumni
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉