Disable UI Elements temporarily via API

Disable UI Elements temporarily via API

hoeckesfeld
Enthusiast Enthusiast
500 Views
2 Replies
Message 1 of 3

Disable UI Elements temporarily via API

hoeckesfeld
Enthusiast
Enthusiast

Hi,

 

it's possible to disable a group of UI Elements (CommandTypes) with the following line:

ThisApplication.ActiveDocument.DisabledCommandTypes = CommandTypesEnum.kShapeEditCmdType;

 

How do I disable multiple CommandTypes? e.g.:
DisabledCommandTypesList = new List<CommandTypesEnum> {CommandTypesEnum.kShapeEditCmdType, CommandTypesEnum.kQueryOnlyCmdType }

 

For my API I want to wait for a User Input where the user has to select multiple faces but shouldn't be allowed to click on a UI element. Is there a possibility to implement this?

 

Thanks!

 

 

 

0 Likes
Accepted solutions (1)
501 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor
Accepted solution

Hello, 

CommandTypesEnum is used as Enum with Flags attribute (implemented in background but not explicitly). In this case you can use it as combination of individual values. For more information see this article

https://docs.microsoft.com/en-us/dotnet/api/system.flagsattribute?view=net-5.0 

 

Here is sample use. This code works, but compiler provides a warning, because the [Flags] attribute is missing in Interop implementation. 

var disabledCommands = CommandTypesEnum.kFileOperationsCmdType | CommandTypesEnum.kFilePropertyEditCmdType;

 

Message 3 of 3

hoeckesfeld
Enthusiast
Enthusiast

Hi! Thanks alot. 

0 Likes