Using Node Parameters to enable / disable nodes. Can only get Boolean to work
Originally posted by: dglavastorm
Hi, I've managed to program 2 nodes that enable or disable based on a parameter, but only when the parameter type is set to "boolean", or "string" and the input is either "true" or "false".
I need this to be set to "Choice" instead of "boolean", and the selection to be numbers, in this case 50, 200, 300.
The parameter name is "No. of Splits".
For Boolean the code I'm using to enable the first node and disable the second when the parameter is set to "True" is :
enable {{^No. of Splits=true^}}
disable not({{^No. of Splits=true^}})
This works perfectly.
Any other string apart from "true and "false" or any numbers and nothing happens
What is the correct code for using "Choice" using either numbers or strings ?
Thanks,
Dave
Hi, I've managed to program 2 nodes that enable or disable based on a parameter, but only when the parameter type is set to "boolean", or "string" and the input is either "true" or "false".
I need this to be set to "Choice" instead of "boolean", and the selection to be numbers, in this case 50, 200, 300.
The parameter name is "No. of Splits".
For Boolean the code I'm using to enable the first node and disable the second when the parameter is set to "True" is :
enable {{^No. of Splits=true^}}
disable not({{^No. of Splits=true^}})
This works perfectly.
Any other string apart from "true and "false" or any numbers and nothing happens
What is the correct code for using "Choice" using either numbers or strings ?
Thanks,
Dave
-
Originally posted by: dglavastorm
Thanks, that worked. How do I set a default though as its the first option that appears in the dropdown ?
I can set the parameters in the "edit Choices" box, but there's no option I can find to set which is the default.
Also does the "Mandatory" field effect anything ? I've never touched it so it's always on Default, but sometimes the text box says True and others say False and I can't work out what exactly it does or what dictates it's setting. -
Originally posted by: stonysmith
1) You can't set a default value for a dropdown. It will always begin with "(default)". You could place the node into a library, and pick a value from the list, which will then become the default when you use the node from the library, but to my knowledge you can't pick a default value for the dropdown. If you want to enforce that some selection is always picked, you can set the Validator to "Not Blank"
2) Mandatory comes into play when building a BRX or LXA. Any node tagged as Manditory MUST be executable (can be satisified)(must have data coming into it) or the compiler will throw an error and not build the BRX/LXA -
Originally posted by: gmullin
I'm not sure if it's clear but also the = sign inside the parameter is giving it a value in the event that the parameter has not been set. The value below would be saying that if nobody set a value on EnableParam, then take it that the value is 1. You could do something like this so the node is enabled by default and somebody has to change the value of the parameter to disable it (or vice versa).
"{{^EnableParam=1^}}" == "1"
Also to point out since Stony mentioned about BRXs and LXAs - you can't enable and disable a parameter within a BRX by a run parameter. The node is either enabled or disabled when you compile the BRX/LXA.
Please sign in to leave a comment.
Comments
5 comments