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

CommandFlags.Undefined

3 REPLIES 3
Reply
Message 1 of 4
jbooth
520 Views, 3 Replies

CommandFlags.Undefined

I tried applying this flag to one of my commands for Autocad 2006. The documentation states that it forces users to enter the full namespace of the command in order to invoke it.

The problem is that even after defining the local, global, and group names I can't get the command to load. I've tried every possible namespace I could think of when entering the command into Autocad. The command works if I do not apply the flag, and typing GroupName.GlobalName into the command line also works - unless I add the Undefined flag.

[CommandMethod("group1", "cmd1", CommandFlags.Undefined)] _
Public Sub Test()
...
End Sub

Has anyone here figured this out?

Thanks,
JB

ps: I replaced the angle-brackets with regular brackets so it would display properly.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: jbooth

I don't think that flag has any effect when it is
used in the CommandMethod attribute.

It's purpose is to store the state that is set by
by the UNDEFINE and REDEFINE commands.

Be careful with the ARX documentation. Why do you
think most people have to pay for the spoon-fed
clarifications (a.k.a. Autodesk Developer Network) ?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5357205@discussion.autodesk.com...
I tried applying this flag to one of my commands for Autocad 2006. The documentation states that it forces users to enter the full namespace of the command in order to invoke it.

The problem is that even after defining the local, global, and group names I can't get the command to load. I've tried every possible namespace I could think of when entering the command into Autocad. The command works if I do not apply the flag, and typing GroupName.GlobalName into the command line also works - unless I add the Undefined flag.

[CommandMethod("group1", "cmd1", CommandFlags.Undefined)] _
Public Sub Test()
...
End Sub

Has anyone here figured this out?

Thanks,
JB

ps: I replaced the angle-brackets with regular brackets so it would display properly.
Message 3 of 4
jbooth
in reply to: jbooth

Thanks Tony.

I was hoping that the CommandMethodAttribute was telling the Autocad application to call addCommand() when the dll was dynamically loaded, and therefore I could limit any commands I defined to a specific "namespace" for use in Autocad.

No problem, it's not something I really needed. I'll just prefix all my commands to avoid naming conflicts.
Message 4 of 4
Artvegas
in reply to: jbooth

About 6 years too late but...

 

Try enter a single period before the command name, i.e. ".CMD1".

 

Preceding a command name with a period (.) ensures that the built-in AutoCAD command is accessed, and not an application-defined command of the same name that has been defined to override the built-in command using UNDEFINE.

 

For example if you use the UNDEFINE command on the CIRCLE command, you can still access the command by preceding the command name with a period, i.e. ".CIRCLE".

So it looks like the CommandFlags.Undefined enum automatically undefines the command.

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