Grasshopper

algorithmic modeling for Rhino

I have problems in calling ShortestWalk with ghpythonlib.components, what am I doing wrong?

# how do I reference ShortestWalk with python?
shpath = []
for i in range(len(C)):
   shpath.append(ghcomp.ShortestWalk.ShortestWalk(C[i],lines)[0])


What am I missing?

Example attached.

Best regards 

Kristoffer

Views: 1589

Attachments:

Replies to This Discussion

Thank you both for the reply. I guess I have some reading to do on graph theory. The posts/guide for external python libs in grasshopper is obviously well covered in the forums but I guess there is always that one retard who asks the wrong question at the wrong place.., yea, Thanks!

Hi Dimitar and Kristoffer, I just added a GHPython component which implements NetworkX to my GitHub account, if you need a file to get going. It's the one called "MeshPaths" and there's an example in the Grasshopper definition in the examples folder. Hope that helps :)

Many thanks, Anders. I really needed some example to test if things are really running. I spent 2 hours wondering what's problem just to realize that I have downloaded v1.9.1. Just after re-reading your post for the 10th time I realized I need 1.5. Thanks a lot!

Haha, no worries. Yes it's too bad that 1.5+ isn't compatible with IronPython. I've found that it is fairly straight forward to port over missing functions from later versions though. That said, would be nice to get it sorted out properly..

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service