Hi there, I have been programming a script where I want to retrieve the Point3d from the NurbsSurfaceControlpoints.
I got a NurbsSurfacePointList and I want to call the GetPoint() method which is Overloaded NurbsSurfacePointList
I know there is a solution for calling RHinocommon overloaded methods with the following error: “Message: Multiple targets could match” by using the Overloads Method as explained here: Calling Overloaded Methods from Python
But whenever I use the Overloads method on the .Getpoint() method as seen here:
srfControlPoints.GetPoint.Overloads[System.Int32, System.Int32, rg.Point3d](u, v)#Get point3d from control points
I get this error message:
No match found for the method signature GetPoint[Int32, Int32, Point3d]. Expected [Int32, Int32, Point4d&], [Int32, Int32, Point3d&]
Now i ask myself what this expected Type “Point3d&” is (It is not Rhino.Geometry.Point3d)
I have been trying to solve this, but I could not figure it out. Maybe I am overseeing something.
Any help would be helpful!
_dromaius
Here is a snipped of the code to recreate the error:
import Rhino, System
import Rhino.Geometry as rg
import scriptcontext as sc
import rhinoscriptsyntax as rs
def Main():
surfaceId = rs.GetSurfaceObject("Select surface")
if not surfaceId:
sc.errorhandler()
srfGeo = sc.doc.Objects.Find(surfaceId[0]).Geometry
if not srfGeo:
sc.errorhandler()
if srfGeo.IsSurface:
srfGeo = srfGeo.Surfaces[0]
else:
print ("User selected more then one surface")
return None
nurbsSurfacePoints = srfGeo.Points #Gets the NurbsSurfaceControlPoints
if not nurbsSurfacePoints:
print ("ERROR: Could not retrive NurbsSurfaceControlPoints")
return None
ControlPoints(nurbsSurfacePoints)
def ControlPoints(srfControlPoints):
#Get the u and v point from the surface
countU = srfControlPoints.CountU
countV = srfControlPoints.CountV
for u in range(countU):
for v in range(countV):
srfControlPoints.GetPoint.Overloads[System.Int32, System.Int32, rg.Point3d](u, v)#Get point3d from control points
if __name__ == "__main__":
Main()
edit: spelling