override parameter switch

   4859   3   2
User Avatar
Member
3 posts
Joined: 9月 2008
オフライン
Hi,
I have parameter on an otl that i want to have the option of :

a)displaying the value of another nodes parameter (i know i can use the ch(expression for that)

or

b) have the user set the value in the parameter

I've put an checkboxparameter alongside it (effectivly an override switch) but i can't figure out a way of using the checkbox to switch between the two options, I was hoping that i could use some sort of hscript to say:

if(checked , let me set manually set the parameter, else use the ch(“reference”)

any help appreciated, or suggestions of a better way to approach the problem
User Avatar
Member
8080 posts
Joined: 7月 2005
オフライン
Here's one way (attached). There's several tricks involved for what I did:
- In the Type Properties dialog, I created a folder and then made it a “Radio Buttons”. Then I copy pasted it.
- Now I put the parameters that are switched inside
- In the Channels tab of the new “disp” parameter, I put in the channel reference to the “todisp” parameter to show its value
- In the Parameter tab of the new “disp” parameter, I put stuff in the Disable When field to disable it
- Finally, inside the HDA, I tell the Font sop to use a different parameter depending on the value of usedisp1.

Attachments:
parmswitch.hip (48.4 KB)

User Avatar
Member
3 posts
Joined: 9月 2008
オフライン
ah, thanks for the example…

in the end i used the good old opparm command:

basically on the checkbox i call the following script, which sets the “ch()” expression to reference the value of manual param, or deletes it depending on the value of the checkbox.. (see below)

I'm not happy about the full paths in the script ,but i assume i could replace them with “.” or “opdef:.” ?


CALLBACK SCRIPT ON CHECKBOX (param called “chk”)
——————-
if (`ch(“/obj/subnet1/chk”)`==1) then
opparm /obj/subnet1 todisp “ch(\”manual\“)”
else
opparm /obj/subnet1/ -r todisp `ch(“manual”)`
endif

——————

note: i could not get the script to execute on your example , was yours not a true digital asset but a modification of a geo object? it seemed to have problems finding/running the script, so i just replicated the params on a subnet/DA and it worked…..

thanks again
User Avatar
Member
8080 posts
Joined: 7月 2005
オフライン
No, it's a true HDA. It doesn't run any callback scripts, it's all done using channel references.
  • Quick Links