Grasshopper

algorithmic modeling for Rhino

Hi everyone.

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.

 

Thanks, David.

 

 

Views: 364

Reply to This

Replies to This Discussion

I also installed the update on 32-bit and this error did not show up.

Also, writing:

import rhinoscriptsyntax as rs
import math

a = []
a.append(rs.Distance([0,0,0], [1,1,0]))
a.append(abs(result[0] - 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:

  • go to the Windows Control Panel
  • choose Uninstall a Program
  • find Rhinoceros 5.0 WIP
  • choose Restore

Did this solve the problem?

 

Thanks,

- Giulio
_______________
giulio@mcneel.com
McNeel Europe

Attachments:

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.

Thanks,

-Steve

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.

Thanks,

-Steve

Yeah, I have that trick for the time being haha.

 

Thank you guys.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2019   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service