What does each "CommandTypeEnum" do?

What does each "CommandTypeEnum" do?

DRoam
Mentor Mentor
915 Views
2 Replies
Message 1 of 3

What does each "CommandTypeEnum" do?

DRoam
Mentor
Mentor

When creating a control definition, we have to specify its Classification as a CommandTypesEnum (or a combination of them). However, I can't seem to find any documentation or resource on what exactly is different about each of those command types.

 

I can see from the descriptions that some of them cause the document to become dirty, while others do not; but aside from this, I see no reason why I would use any particular one over the other. I see no reason why there's not just two command types -- one that dirties the document, and one that doesn't.

 

For example, I also see the "kUpdateWithReferencesCmdType" type is for "Commands that cause this document to recalculate its contents with respect to changes that may have occurred in files it is referencing." But I'm not sure when or why I would use this command type. I assume "when" would be if my command calls the "Document.Update" method? But why? What effect does flagging my command with this command type have?

 

I assume there are other distinctions between these command types, besides dirty vs. not dirty, but what are they? What unique behaviors or effects does each type have? Does anyone know?

 

Autodesk, can we get some official documentation on these? Along with some examples of real and/or hypothetical commands that fall under each type? ( @MjDeck@chandra.shekar.g )

 

Thanks for any help or clarifications!

0 Likes
916 Views
2 Replies
Replies (2)
Message 2 of 3

MjDeck
Autodesk
Autodesk

@DRoam , here's a rule that will list all available commands with their classification. That should help answer your question about real commands that fall under a given type. I'll try to get more info.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 3

ruthsteed
Autodesk
Autodesk

@DRoam The primary purpose of the CommandTypesEnum is to provide a shortcut for command disabling in environments or document types. The assignment of the command type is up to the command developer, but it enables disabling whole classifications of commands for a given document or environment. For example, you might want to disable any command that can change the shape recipe (kShapeEditCmdType) for a part or alter the references to an assembly (kReferencesChangeCmdType), or you might want to only allow commands that are query only in nature (kQueryOnlyCmdType). Unfortunately, the assignment of the command type is not always thoughtfully chosen, but it is an easier shortcut to limit actions when you want to protect a document. The alternative is to add specific commands to the disabled command list, but the disabled command types persists and doesn't require you to delineate each command you want to disable (it's a bigger hammer).

 

Hope that helps



Ruth Steed
Inventor Development Team
Autodesk, Inc.