Grasshopper

algorithmic modeling for Rhino

How to use Rhino.Python's modules in Gpython ( Grasshopper)

Hello,

I'm working through a uni project in which I'm trying to use Rhino.Python's modules (like getobject and so on) in Grasshopper's python, called Gpython.

[Gpython( Grasshopper python script editor)]

line3: srf = rs.GetObject("Pick surface to divide")

[Error]

Runtime error (NotImplementedException): The method or operation is not implemented.

As I show upper, I can not use this module,GetObject. Please tell me how to fix it. Also, I would like to know the differences between Rhino python and Gpython.

Thanks in advance for any advice!

TOM

Views: 613

Replies to This Discussion

You can't use GetObject in GhPython because Grasshopper doesn't have access to Rhino interface. Instead of that, just add a variable srf in the input parameter of your GhPython component and reference it.

Thanks Ayoub.

I would appreciate it if you give me instructions. I would like to add a a variable srf in the input parameter of my GhPython component. 

Could you give me a reference or your Python script?

Thanks in advance.

Here is a very basic example of how to access a surface from your Python code in Grasshopper. Just right click on the surface component, choose set one surface. Then you can use it in your Python code

Attachments:

Thanks a lot, Ayoub.

I’ve figured out how to use surface and point components in Python script.

I really appreciate your help.

 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service