algorithmic modeling for Rhino
Hi,
I have GH definitions using many parameters the user has to enter before generating Rhino objects.
In order not to forget some parameter, i add checkboxes that print messages to remind that all entries have been completed, or not:
Now, I am trying to give the user the possibility to reset the states of all those checklists. Is this possible to do this with some VB code or by others means ?
Thank in advance,
Jean-Louis
Tags:
Thank you, it could be a solution indeed.
In practice, the GH definition may become a bit too heavy. It may take too much room in our definitions to place the two components each time (button+panel, the cluster could be placed outside)...
Yes, it works fine !
I'm wondering if it would be possible to access, via VB, directly to our GH checkboxes objects :
If I set their name to "check", I can get the GH object via this code :
For Each obj As IGH_DocumentObject In owner.OnPingDocument().Objects
If obj.Nickname = "check" Then
... add some code here to set the state ?
End If
Next
The next step is to know how to access specific methods/subs in order to set the state of checklist...
Got It!
If reset Then
Dim checkBox As Grasshopper.Kernel.Special.GH_ValueList = Nothing
For Each obj As IGH_DocumentObject In owner.OnPingDocument().Objects
If obj.Nickname = "Check" Then
checkBox = TryCast(obj, Special.GH_ValueList)
If checkBox IsNot Nothing Then
If checkBox.SelectedItems().Count = 1 Then
checkBox.ToggleItem(0)
End If
End If
End If
Next
End If
Here is the GH file.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by