Perspective Checkbox with UDT Parameter

Hello,

I’m trying to use a checkbox with UDT parameters. As the UDT parameters are all strings, this presents a difficulty since it expects a boolean. I have tried using an expression with Tag and casting it to boolean with bidirectional checked, but this doesn’t seem to work. Also, the transform seems to go one direction, transforming from tag → checkbox but not the other way around.

Any ideas or help are greatly appreciated. Thank you.

Hi,

You are using the expression syntax where a straight tag path is expected.

You can change it to {view.params.udtValue}+"/Parameters.AlmEnabled.HiHi"

or move your expression to an expression type binding. The toBoolean shouldn’t be required.

Cheers,
Deon

Good news and bad news.

Bad news:
You can’t do what you’re trying to do, because UDT parameters are read-only through the binding dialog. This is because UDT parameters are used to construct the UDT, and changing the parameters causes the entire UDT to be rebuilt; something you really don’t want for large UDTs and/or large volumes of UDTs.

Good news:
If this is absolutely important to you, you could use a change script on the checkbox to set the value of the parameter, but you should absolutely NOT use a binding against the parameter in conjunction with said change script as it will create an infinite loop and trash your Designer session.

# this should also keep your parameter as a string.
system.tag.writeBlocking([self.view.params.udtValue + "/Parameters.almEnabledHiHi"],[str(currentValue.value)])

As for your mention of transforms being one way:
Transforms only work one way and will only ever be one way. Suppose you had a script transform; how would we run a script in reverse?

I got it working, thanks for the help. I also understand why transforms are one way.

1 Like