Create command alias by code

Create command alias by code

chunyuran
Enthusiast Enthusiast
1,401 Views
4 Replies
Message 1 of 5

Create command alias by code

chunyuran
Enthusiast
Enthusiast

Users want to change my command name to shortcut string as their like. How to rename command by code? Thanks.

0 Likes
Accepted solutions (1)
1,402 Views
4 Replies
Replies (4)
Message 2 of 5

Ed__Jobe
Mentor
Mentor

Is there a reason that they can't use the ALIASEDIT command and change it themselves?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 5

chunyuran
Enthusiast
Enthusiast
Accepted solution

It will be more user friendly.

Just found the method in this forum.

The undocumented AddCommand() method of the Autodesk.AutoCAD.Internal.Utils class will do it.

Thanks, caddzone.

0 Likes
Message 4 of 5

stefanome
Collaborator
Collaborator

@chunyuran, can you please share some details about how to use the AddCommand() method?

 

Is it an alternative to using the CommandMethodAttribute?

Or is it supposed to be used in addition to that?

0 Likes
Message 5 of 5

_gile
Consultant
Consultant

Hi,

 

Using the Autodesk.AutoCAD.Internal namespace may be a bad idea. This namespace is reserved for Autodesk and is subject to change.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub