.NET

Reply
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 1 of 4 (203 Views)

CommandFlags.Undefined

203 Views, 3 Replies
10-10-2006 04:21 PM
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.
*Tony Tanzillo
Message 2 of 4 (203 Views)

Re: CommandFlags.Undefined

10-11-2006 09:48 AM 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.
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 3 of 4 (203 Views)

Re: CommandFlags.Undefined

10-11-2006 10:34 AM 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.
Distinguished Contributor
Artvegas
Posts: 104
Registered: ‎04-21-2011
Message 4 of 4 (99 Views)

Re: CommandFlags.Undefined

08-10-2012 12:12 PM 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community