.NET

Reply
Mentor
Amremad
Posts: 217
Registered: ‎08-24-2010
Message 1 of 9 (443 Views)
Accepted Solution

Custom CommandMethod

443 Views, 8 Replies
04-17-2013 02:17 AM

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

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.

 

 

Distinguished Mentor
gasty1001
Posts: 582
Registered: ‎04-11-2010
Message 2 of 9 (422 Views)

Re: Custom CommandMethod

04-17-2013 06:46 AM in reply to: Amremad

Hi,

 

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

 

Gaston Nunez

 

 

Mentor
Amremad
Posts: 217
Registered: ‎08-24-2010
Message 3 of 9 (420 Views)

Re: Custom CommandMethod

04-17-2013 07:01 AM in reply to: Amremad

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

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 4 of 9 (417 Views)

Re: Custom CommandMethod

04-17-2013 07:10 AM 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.

Mentor
Amremad
Posts: 217
Registered: ‎08-24-2010
Message 5 of 9 (416 Views)

Re: Custom CommandMethod

04-17-2013 07:15 AM in reply to: DiningPhilosopher

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

 

Untitled.jpg

*Expert Elite*
dgorsman
Posts: 5,698
Registered: ‎10-12-2006
Message 6 of 9 (401 Views)

Re: Custom CommandMethod

04-17-2013 09:13 AM 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.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


*Expert Elite*
arcticad
Posts: 1,286
Registered: ‎06-21-2004
Message 7 of 9 (396 Views)

Re: Custom CommandMethod

04-17-2013 09:34 AM 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))
*Expert Elite*
_gile
Posts: 2,133
Registered: ‎04-29-2006
Message 8 of 9 (387 Views)

Re: Custom CommandMethod

04-17-2013 10:39 AM 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
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 9 of 9 (381 Views)

Re: Custom CommandMethod

04-17-2013 11:07 AM 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.

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.