algorithmic modeling for Rhino
Hi everyone,
I encountered one problem while executing this simple code in GhPython below:
import rhinoscriptsyntax as rs
rs.RebuildCurve(crv, 3, 15)
rs.EnableObjectGrips(crv)
the error turned to be:
Runtime error (MissingMemberException): 'AttributedGeometry' object has no attribute 'GripsOn'Traceback: line 15, in EnableObjectGrips, "C:\Users\Hurriarc\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\grips.py"
So, I tracked back to the grips.py script, in which, the .gripson method could not work.
Btw, this code runs ok in Rhino python script editor.
Does anyone have any ideas?
Thanks
Tags:
Hi Arthur
rhinoscriptsyntax uses ids (Guid's), you remeber?
RhinoCommon uses objects. More. So x is an id that the coercecurve function makes sure is linking to a curve and returns the curve object from the default document.
Thanks,
- Giulio
_______________
giulio@mcneel.com
Hi Giulio,
The "Rhinoscrypt syntax usage" menu seems to be gone since 0.5 version of GhPython?
Is there any other way to solve the "This call is not supported from within a Grasshopper component" error message?
Grazie.
Hi Djordje,
For some reason I couldn't reply directly to your post. Anyhow, you can set the script context directly in the script itself like so:
import scriptcontext as sc
# Set the script context to the current Rhino doc
sc.doc = rc.RhinoDoc.ActiveDoc
# Do your Rhino doc business...
# Then set the script context back to the Grasshopper doc
sc.doc = ghdoc
Thank you for the reply Anders.
The "rc" shortcut is for "Rhino" module?
Each time somebody directly replies to a certain post, that new one shrinks. Ning put some kind of a restriction to what size the post could shrink, or how many could be tied one to other. At some point it is impossible, to reply anymore (on certain post) so a regular "reply" needs to be used.
Oh yeah, forget that part. Was writing it from memory. Just add:
Import Rhino as rc
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by