LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is There Any Way to Disable an Item of an Enum Constant with Scripting?

Solved!
Go to solution

The Disabled Items[] property of an Enum strict typedef doesn't propagate to a constant when the constant is created.

And I can't find a way to programmatically disable items in an Enum constant.

paul_cardinale_0-1647967514293.png

Is it possible?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 5
(936 Views)

@paul_cardinale wrote:

The Disabled Items[] property of an Enum strict typedef doesn't propagate to a constant when the constant is created.

And I can't find a way to programmatically disable items in an Enum constant.

paul_cardinale_0-1647967514293.png

Is it possible?


I'm curious what the application would be, because I can't think of a reason why you would need to disable something on a BD constant.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 5
(924 Views)

@billko wrote:

@paul_cardinale wrote:

The Disabled Items[] property of an Enum strict typedef doesn't propagate to a constant when the constant is created.

And I can't find a way to programmatically disable items in an Enum constant.

paul_cardinale_0-1647967514293.png

Is it possible?


I'm curious what the application would be, because I can't think of a reason why you would need to disable something on a BD constant.


There's a hint in the picture.  The typedef has "<Select>" as its 1st value; and that's never a legit value, not even on the BD.  Note also that you can manually disable items in an enum constant.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 5
(892 Views)

@paul_cardinale wrote:


  Note also that you can manually disable items in an enum constant.


Well, I learned something new today. (I fear I might learn this in the future again 😋 )

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 4 of 5
(884 Views)
Solution
Accepted by topic author paul_cardinale

Occasionally you can trick LabVIEW into applying front panel properties to their corresponding block diagram objects with the Type Cast function. This is one such occasion.

 

typecast_enum.png

Message 5 of 5
(881 Views)