generative modeling for Rhino
I've been doing a script with the Python modules of GH and after the last Rhino 5.0 update yesterday all rs.Distance orders have stopped working.
I' ve written a simple distance between two points in a new module and I get the same error:
Runtime error (MissingMemberException): 'module' object has no attribute 'Distance'
I've tried to reinstall GH but nothing new. Its strange becouse now "Distance" doesn't even appear in the list of "rs." orders.
I have the last GH version and the 0.4.6.0 of the GH Python.
Hope you know what might be hapenning.
I also installed the update on 32-bit and this error did not show up.
import rhinoscriptsyntax as rs
a = 
a.append(abs(result - math.sqrt(2)) < 0.01)
a is returned as a list with 1.41..., True.
Can you try the file?
If this does not work, could you do the following:
Did this solve the problem?
Same error after restore. The rs.Distance doesn't work in the PythonScript editor outside GH either. Just doesn't appear in the list of orders (?).
I'm going to reinstall everything and try again.
Fotgot to mention its 64 bits version.
Thanks for the quick answer!
If you haven't done so already, I would recommend running Giulio's script both in a grasshopper python component and in the "EditPythonScript" command. Hopefully that will shed some light on the issue.
Well, I know it's weird, but I've checked it several times:
- If after opening Rhino, I open first the Python editor, it works in the editor and later in GH too.
- If after opening Rhino, I open first GH, it fails here and in the editor later too, with this error:
Message: 'module' object has no attribute 'Distance'
Traceback: line 8, in <module>, line 5, in <module>, "C:\Users\David\Desktop\dd_cmd.py"
I think I see what is going on. There is a lot of work that is performed when the python engine is first started and this work is being done in a separate thread. I missed a spot where the grasshopper python component thread should wait until the "warmup" thread is done.
This should be fixed in next week's V5 beta. Sounds like you know a workaround for the time being.
Yeah, I have that trick for the time being haha.
Thank you guys.