I want to use this in a Grasshopper python component, but I can’t get it to output to a. Is there any reason this would not work? Is there another way I need to do this? The value is getting stored in a as I can print it, but the value in the output is empty.
# The script that will be using the dialog.
def RequestRoomNumber():
dialog = SampleEtoRoomNumberDialog();
rc = dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
if (rc):
outText = dialog.GetText()
print(outText)
a = outText
you need an event listener that tells grasshopper to update when the dialog contents change
however i don’t know whether grasshopper’s canvas updates when there a modal shown on top.
def RequestRoomNumber():
global a
dialog = SampleEtoRoomNumberDialog();
rc = dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
if (rc):
outText = dialog.GetText()
a = outText