algorithmic modeling for Rhino
I know in python list is dynamic,But some method's input in RhinoCommon needs to be Generic list,like "Curve.ClosestPoints Method (IEnumerable(GeometryBase), Point3d, Point3d, Int32)",and I write some code like below:
sphere 1=Sphere(Point3d(0,0,0),10)
sphere 2=Sphere(Point3d(20,20,20),10)
spherelist=[]
spherelist.append(sphere1)
spherelist.append(sphere2)
crv.ClosestPoints(spherelist,pt1,pt2,int)
then I got this" Runtime error (ArgumentTypeException): expected IEnumerable[GeometryBase], got list",and after search hard in web,I find this
https://github.com/mcneel/rhinopython/issues/25,so I tried to write something like this:
spherelist2=List[Brep](spherelist)
also there is an error message"Runtime error (MissingMemberException): 'type' object has no attribute '__index__'"
Is there any possible idea for the answer?
Any help would be greatly appreciated.Thanks!
Tags:
Your problem is somewhat difficult to understand. You'll usually get more of a response by providing a file(s) to troubleshoot. That said, have a look at the attached example. I implemented the Curve.ClosestPoints method for a curve and a list of three spheres. The method returns a list containing a boolean value indicating success followed by the closest point on the curve and then the closest point on the closest sphere. Seems to work, hope that helps.
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