Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Disable UI Elements temporarily via API

hoeckesfeld
Enthusiast

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
Reply
Accepted solutions (1)
443 Views
2 Replies
Replies (2)

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;

 

hoeckesfeld
Enthusiast
Enthusiast

Hi! Thanks alot. 

0 Likes