Jump to content

Is there a better way...


Recommended Posts

Just curious, I'm creating a UI that will modify elements in a cluster and was wondering if the following picture depicts the best solution. I have a boolean button that, when pressed, will trigger a corresponding boolean within the cluster to change its state. I'm using Value Signaling.

I guess I was interested to see if this could be done without using a FOR loop to determine which element in the cluster I'd like to reference.

post-10-1086115654.jpg?width=400

Link to comment

If you know the index of the control in the cluster (cluster order) then you can use Index Array function and not have to go through the entire cluster in the for loop. The thing you have to be careful of here is if the cluster order changes.

You could also use the Search Array function to find it's index then use index array to get the controls reference that way.

Hope this helps. :thumbup:

Steve

Link to comment

Another option (not necessarily better) is to convert the variant back to a cluster then just bundle the new value. Of course this requires the cluster constant which then requires you to make it a type def (for 'safety'). Maybe not worth the hassle.

post-10-1086138212.png?width=400

Link to comment

...or just right click on the control (withing the cluster, and not the cluster itself) of which you want its value changed, and create a "property node".

This way one can change the value of a cluster element without having to bundle and unbundle the whole stuff. You can also use this way to change/read a control value even if you have a boolean with latch action in the cluster.

Didier

Link to comment

Thanks for all the great solutions and ideas!

Hmmm...A little twist seems to be that you can't "click" on a cluster element thats Strict Type Def. So what I ended up doing (correct or not) was disconnecting the cluster from the Strict Type Def, select the control within and creating its property node, then replace the cluster back to its original Strict Type Def. form. This seems to work although a slight workaround....

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.