algorithmic modeling for Rhino
Hi Marcus
that's because CurveEditPoints(crv) returns a <type 'Point3dList'>, which is enumerable but does not support slicing. This collection is more memory-optimized for points, but has the disadvantage of being a little less friendly. I think in the future we could add slicing functionality to that class.
When something is not working like this, you should check with which type you are dealing, like, in this case, Point3dList, and not the usual Python list. You can then convert that special list this with a simple pts = list(pts), or pts = [p in pts] or pts = [p for p in pts].
I hope this helps,
Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com
You can use a panel to display the contents of a wire/stream
That's the standard Python function for that job. As Python is dynamic, it's actually more difficult to recognize types as you write. We can try to improve the editor, though.
This is the code that runs in the background and provides you with CurveEditPoints:
rhinoscript CurveEditPoints (Python):
mcneel/rhinopython/../scripts/rhinoscript/curve.py
Then again that calls into RhinoCommon NurbsCurve (C#)
mcneel/rhinocommon/../dotnet/opennurbs/opennurbs_nurbscurve.cs
As you see it's often easier to just ask the type.
You also need that information once.
--
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by