I have a python macro that takes a fair amount of time to complete and I’ve been sending messages to the command line asking the user to wait, which they may or may not see.
Is there a way to display a message box that simply says “Please Wait” and then turn it off after finishing the task in Python? It’s never going to be a set amount of time so a timer won’t work.
I thought about writing a text object to the Rhino Screen asking them to wait and then deleting it but I am looking for a cleaner way if possible.
Thank you. I think this will work for me. Just for my own edification, can you explain what these lines of code do? Not familiar with sticky?
sc.sticky['wait_form'] = form
Rhino.RhinoApp.WriteLine('Do something that takes a long time')
rc, str = Rhino.Input.RhinoGet.GetString("Press Enter when done", True, '')
if sc.sticky.has_key('wait_form'):
form = sc.sticky['wait_form']
if form:
form.Close()
You display the form when you call show.
The reason for the sticky is so that the form can remove itself after you complete the task in the background.
The form can be closed by the user, after being shown, but will automatically close once the task is complete.
if sc.sticky.has_key('wait_form'):
form = sc.sticky['wait_form']
if form:
form.Close()
Checks if the form has been closed by the user or not and closes it.
The lines:
Rhino.RhinoApp.WriteLine('Do something that takes a long time')
rc, str = Rhino.Input.RhinoGet.GetString("Press Enter when done", True, '')