Grasshopper

algorithmic modeling for Rhino

Hi guys!

I have a problem when importing ghpythonlib.components into python. You know, the ghcomp would not work unless I set the type hints of inputs correctly. But sometimes in the middle of a script, I need to use ghcomp, and the input arguments are returned from other functions(eg. rhinoscriptsyntax functions). The type of the returned arguments is guid or something else and it would cause the ghcomp fail(return None). I know, I can split the whole script into pieces and write them in more than one 'python' components so that I can set type hint between components, but I want to keep the script as a whole. So can I set type hint in the middle of a script so that I can use ghcomp wherever I want. Or, are there any other methods to solve this problem.

Thank you!

Views: 505

Replies to This Discussion

Hi Wang,

Use the rs.coerce functions (rs.coerce3dpoint, rs.coercecurve, rs.coercebrep ...).

Hi djordje!

That really works! Thank you very much! :-)

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service