.NET

Reply
Mentor
217 Posts
1 Kudo
Registered: ‎08-24-2010
Post 1 of 9
Accepted Solution

Custom CommandMethod

451 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
582 Posts
91 Kudos
Registered: ‎04-11-2010
Post 2 of 9

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
217 Posts
1 Kudo
Registered: ‎08-24-2010
Post 3 of 9

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
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 4 of 9

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
217 Posts
1 Kudo
Registered: ‎08-24-2010
Post 5 of 9

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*
5,763 Posts
504 Kudos
Registered: ‎10-12-2006
Post 6 of 9

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*
1,286 Posts
37 Kudos
Registered: ‎06-21-2004
Post 7 of 9

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*
2,142 Posts
255 Kudos
Registered: ‎04-29-2006
Post 8 of 9

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
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 9 of 9

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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!