algorithmic modeling for Rhino
Hi all,
I'm working with GHPython and I would like to evaluate the center of a referenced surface and then do other stuffs (please see attached files).
The problem is that when I access to the rs.SurfaceAreaCentroid(surface) it returns a "Null" value.
Seems that GhPy can't access to the surface - object ID.
Is there any work-around to avoid this problem?
Thanks in advance.
Tags:
Hi J
this is an issue deriving from using RhinoScriptSyntax mixed with RhinoCommon objects. In this case, it is the type hint 'Surface' that does not work with RhinoScriptSyntax. To fix this, just use the default hint: 'ghdoc objects when geometry (rhinoscriptsyntax)'. Then your script will work.
Secondly, please note that the output of these functions contains also the error value. So, you need to actually extract the first parameter out of the return value.
Finally, adding a little error checking might be useful to improve the script. See the attached file for examples.
I hope this helps,
Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by