AutoCAD Electrical custom wire button

AutoCAD Electrical custom wire button

swansbh
Advocate Advocate
1,516 Views
10 Replies
Message 1 of 11

AutoCAD Electrical custom wire button

swansbh
Advocate
Advocate

I am looking to create a custom icon that would automatically select a certain wire layer for the user and allow the user to lay a wire down that uses that specific wire layer.  So I am looking to merge the "Wire" command and the "Change/convert wire layer" buttons into one but for specific wire layers to be selected.

 

Any ideas on how to go about doing this?

 

Thanks,

 

Brian

AutoCAD Electrical 2017
0 Likes
Accepted solutions (1)
1,517 Views
10 Replies
Replies (10)
Message 2 of 11

swansbh
Advocate
Advocate

I really meant to say "Create/edit wire type" and change the default wire layer to a specific layer then the wire command runs.

AutoCAD Electrical 2017
0 Likes
Message 3 of 11

rhesusminus
Mentor
Mentor

Try this macro:

 

^C^CCLAYER;WIRE_LAYER_NAME;AEWIRE

BUT!!.. Stay away from having a caret "^" in the layer name. This character have a special meaning in button macros.

 

2017-09-30_00-25-17.gif

 


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

jseefdrumr
Mentor
Mentor
4,000 points to Trond for the correct spelling of 'caret'.

I wish I worked with people whose command of the English language were as good as yours. And I'm from here!!!!

Jim


Jim Seefeldt
Electrical Engineering Technician


0 Likes
Message 5 of 11

swansbh
Advocate
Advocate

Trond, this works exactly based upon what I had asked for.  Next level question, is there a way to accomplish this without changing the current layer?

 

Thanks,

 

Brian

AutoCAD Electrical 2017
0 Likes
Message 6 of 11

rhesusminus
Mentor
Mentor
I didn't find a workaround for that.
According to the API help file, this line should do that:
(ace_set_default_wiretype "LAYER NAME")

But.. I couldn't get that to work. Maybe @Anonymous can have a look at that API-call?

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

PatMurnen_Adsk
Alumni
Alumni

That API seems specific to when you insert circuits. The API name is misleading I think.

 

But, I did find that (ace_set_current_wiretype "lay_name") sets the current wiretype for the AEWIRE command. So I would use that in place of the LAYER command and it won't change the current layer but just change the current wire layer. I am not sure why this API  isn't in the API Help. I will log this.

 

Regards,

Pat



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

Autodesk, Inc.

0 Likes
Message 8 of 11

swansbh
Advocate
Advocate

Pat, maybe I am doing something wrong but in ACADE 2017 the command you listed is coming up as unknown.  Here is my current command string.

 

^C^Cace_set_current_wiretype;DRS_BUS_BAR;AEWIRE

 

Thanks,

 

Brian

AutoCAD Electrical 2017
0 Likes
Message 9 of 11

PatMurnen_Adsk
Alumni
Alumni
Accepted solution

This API is a little different call. I can't try this as I am on a computer in a meeting without AutoCAD Electrical. But try with the parentheses -

 

(ace_set_current_wiretype "DRS_BUS_BAR");AEWIRE

 

Regards,

Pat



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

Autodesk, Inc.

Message 10 of 11

swansbh
Advocate
Advocate

Thanks pat this seems to have worked.

 

B

AutoCAD Electrical 2017
0 Likes
Message 11 of 11

PatMurnen_Adsk
Alumni
Alumni

Glad that worked. I logged the issue that this API is missing from the API documentation.

 

-Pat 



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

Autodesk, Inc.