Trying to get some input from the Remote Panel.
I can’t get this to work. It gets stuck in a loop for some reason after I click the button in the Remote Panel.
There’s no problem if I click the button on the GH canvas… but that’s what I’m trying to avoid. I want to set up everything in the remote panel.
import Grasshopper as gh
import rhinoscriptsyntax as rs
def getUserInput(currentValue):
return rs.EditBox(currentValue,"","Edit Panel Content")
def updatePanel(id):
for obj in ghenv.Component.OnPingDocument().Objects:
if obj.InstanceGuid == id:
if type(obj) is gh.Kernel.Special.GH_Panel:
temp = getUserInput(obj.UserText)
if temp:
obj.UserText = temp
obj.ExpireSolution(True)
return
id = ghenv.Component.Params.Input[1].Sources[0].InstanceGuid
if run:
updatePanel(id)