.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom CommandMethod

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Amremad
863 Views, 8 Replies

Custom CommandMethod

hi

how can i let user that use my dll , change the command that he what

 

    <CommandMethod("CC")>
    Public Sub CopyMyContent()
        CopyContents.CopyContent()
    End Sub

ex :  how can i change cc to cmc

8 REPLIES 8
Message 2 of 9
hgasty1001
in reply to: Amremad

Hi,

 

"how can i change cc to cmc": Use Alias editor in express tools.

 

Gaston Nunez

 

 

Message 3 of 9
Amremad
in reply to: Amremad

no no , there 's registry way to change by code

Message 4 of 9
DiningPhilosopher
in reply to: Amremad

There's no way to change it in the registry unless it is some sort of alias.

 

The command will be defined using the string given in the CommandMethod attribute.

 

You can define an alias for the command in the .PGP file, or with LISP.

Message 5 of 9
Amremad
in reply to: DiningPhilosopher

that's i mean , but i don't know how

 

Untitled.jpg

Message 6 of 9
dgorsman
in reply to: Amremad

Best bet, use a verbose command name like "SOMESORTOFCOMMANDNAME" rather than "SS".  Far less likely to result in conflict with other commands and user managed aliases.  If a user wants to use "SS", "SSC", or whatever they can use the PGP to create the alias as they want.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 7 of 9
arcticad
in reply to: dgorsman

I don't see that registry key in my version. is that something you added and want autocad to pick it up?

How was it assigned?

---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 8 of 9
_gile
in reply to: Amremad

Hi,

 

I agree with dgorsman.

By my side, I use my registered developper symbol as prefix for command names and let the user free to define aliases or to rename the command with LISP.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 9 of 9
DiningPhilosopher
in reply to: Amremad

The entry in the registry is how AutoCAD loads your app before the first time the command is used. As soon as it is loaded, the command is defined and AutoCAD invokes that command. It does not 'define' the name of the command as you may be presuming.

 

If you change that value in the registry you have to change the name of the command as well. 

 

Adding an alias for a command is something that you should allow the user to do, which is quite easy. The reason why you shouldn't define aliases is because you don't know if the user may have already used the same alias you've chosen.

 

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost