Grasshopper

algorithmic modeling for Rhino

id like to make a way for a user to select from a drop down list and then the list removes that choice so that I can control the user selection process... So if there are six colors to choose from in a drop down menu and the user chooses one the next time the list is used there are only five colors and so on... any ideas how to do this. Thanks

Views: 2215

Replies to This Discussion

my follow up question would be if i have a list of numbers and I want to check for duplicate data and make a warning that one number is used more than a certain amount of times, say by making a geometry red or outputting a warning text in to a panel... any idea how i can do that? thx again- e

Hi,

i think best way would be to use C#/VB Visual Studio to make your own GH component. It's easy to manage the Click events of your own ComboBox.

Also for the second question. Make your own component and you can create a list<> and asc for mylist.Contains(...). If true then you have your dupplicate item.

Hope this helps...

Raul

Yeah, custom code for sure...

As to the second question, you can create a set out of your list and if the set has fewer items than the original list, then at least one duplicate was found.

--

David Rutten

david@mcneel.com

Thanks Raul and David. very helpful, Ive been learning python for gh and will investigate the custom component option. The set method is great also... This forum is the best!

- ethan

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service