05-09-2024 04:49 AM
I have a reqirement as this, during creatin an object, I defined an enumeration Enum1 and it has some items, the maximum value is Enum1.MAX, I wan to use it as a condition in this object, I tried like this:
<Condition refLink="AE409B41-F2C2-43C3-9765-0F4C31FA8B49.MAX_POS" comparator="GreaterThan" value="1"/>
here, the RefId AE409B41-F2C2-43C3-9765-0F4C31FA8B49.MAX_POS is for Enum1, but it doesn't work, it's possible to implement this funtion? or how should I do?
05-13-2024 08:25 AM
Conditions in OOD files can only refer to object parameters. The refLink has to be the ID of an object parameter. It is impossible to hide parameters based on any other content.
05-14-2024 10:38 AM
If so, I have to define another parameter which should have the same value of the maximum value of enumeration, but it need user to set it in OES/CPS parameter, it's not pretty for the object.
05-14-2024 03:00 PM
Yes, that's right. If you really need to hide the parameters, you have to do it by an additional object parameter. I wonder if it's worth doing that, though. To me it doesn't seem like that adds much benefit for the user.
Apart from that, one hint about the MAX_POS enumeration member: Since CpStudio 5.3, you can automatically create a MAX constant for an enumeration. Since 5.4, it is possible to specify this in the OOD file. (This doesn't help you with your requirement though.)