Sliders and Boolean button works great, and with python scripts,
I can easily bake output objects too, the problem is on the input:
Is it possible to toggle Boolean button on RCP so that I can trigger selected object feature (instead of run the method first then select objects)
and then the referenced objects will update automatically like how it works as a normal geometry nodes in GH.
the trigger variable is there to avoid GH canvas being locked up. you can search around the forum. it’s a known issue. also after you click the button you have to first click into the viewport before picking objects. i think someone on here might have solved that but I don’t remember
import Rhino as rh
import Rhino.Input.RhinoGet as rhget
if 'trigger' not in globals():
trigger = False
def funcDrawDoor(x):
global trigger
if x and not trigger:
trigger = True
return None
elif not x and trigger:
trigger = False
r,orefs = rhget.GetMultipleObjects(' pick lines', True, rh.DocObjects.ObjectType.Curve)
if r!=rh.Commands.Result.Success:
return None
else:
return [o.Curve() for o in orefs]
else:
trigger = False
return None
a = funcDrawDoor(x)
Thank you, the script works perfectly!!
I’ve searched the forum before and knew that trigger button may cause some issue more often than boolean toggles, that’s why I used toggles instead, but your script works good without any problem!
Thanks again for your kindly help!
Finally I can release some space on the screen for Rhino viewport!!
Please, someone could help me? I’m trying to reference rhino text object into grasshopper through RCP. The only way afaik is to get GUID of text object, but I don’t know how to get it through python script =(