Jump to content

A more simple setup for setting a string based on a dropdown menu


Man

Recommended Posts

I have a dropdown to select between 3 strings and a "Result" string that pulls the value based on the dropdown.  I'm wondering if there's a more preferred approach because if I want to add/remove an option I have to change it in 3 or 4 places.

I figured out my initial question of why everything isn't evaluated as expected when you first create a node when I set up this example, but I left it broken in the attached files.  If I change the default value of "dropdown" to "option1" it will work as expected.

dropdown_test.hda

Screen Shot 2019-03-07 at 11.30.22 AM.png

Link to comment
Share on other sites

I'm at work right now so can't look at your file, so I don't know how you set it up. But the way I'd do it is create a menu, as tokens I'd give it one, two, three with respective labels option1, option2, option3 

and in the result parm use `chs("menu")` (or whatever the name of the menu parm)

 

hope this helps :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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...