Disable a command?

Disable a command?

howardlee306
Advocate Advocate
2,099 Views
21 Replies
Message 1 of 22

Disable a command?

howardlee306
Advocate
Advocate

Is there anyway to disable a command completely so that no one can use it? For example if I didn't want someone to use the hole command I can do something in the registry or use an iLogic script or anything to completely disable that command from everyone's seat of Inventor?

 

Main reason is we have a command that gets hit every once in a while by accident and it really messes some things up with our workflow. I would just like our IT department to be able to remove it for now until we get a new process in place to avoid it.

 

Thanks,

0 Likes
Accepted solutions (3)
2,100 Views
21 Replies
Replies (21)
Message 21 of 22

Electrik
Advocate
Advocate

He restarted, and everything was fine after that. We're calling it a fluke.

Inventor Professional 2021
Vault Professional 2021
Message 22 of 22

Anonymous
Not applicable
Accepted solution

Hi @howardlee306 ,

 

You can disable sets of ribbon commands using a VBA macro 

 

Public Sub Disable()

Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument

' Disable Commands
 oDoc.DisabledCommandTypes = 1

' Enable all Commands
' oDoc.DisabledCommandTypes = 0

End Sub

 

Here is a list of command groups that you could disable from the API Help File

 

kEditMaskCmdType 57

Commands that cause the document to become 'dirty'. Includes ShapeEdit, FilePropertyEdit, NonShapeEdit and UpdateWithReferences commands.

 

kFileOperationsCmdType 4
Commands that manage file operations - e.g. File Save.

 

kFilePropertyEditCmdType 8

Commands that edit File Properties (a.k.a Document Properties).

 

kNonShapeEditCmdType 32
Commands that edit data (other than File Properties) that is not directly related to the geometry of the model (e.g. color, style).

 

kQueryOnlyCmdType 2

Commands that purely query data. These do not 'dirty' the document.

 

kReferencesChangeCmdType 64
Commands that cause this document to change which files it references.

 

kSchemaChangeCmdType 128
Commands that change the format of the data, but do not change it otherwise (e.g. from the format of one Inventor release to another).

 

kShapeEditCmdType 1
Commands that can affect the geometry of the model.

 

kUpdateWithReferencesCmdType 16
Commands that cause this document to recalculate its contents with respect to changes that may have occurred in files it is referencing.