meshclosestpoint_testfile.3dm (118.9 KB)
I tried example code from the link below, to get a point closest to mesh, but it gives me an error message (Rhino 5). What could be the problem and how to solve it?
https://developer.rhino3d.com/api/RhinoScriptSyntax/#mesh-MeshClosestPoint
import rhinoscriptsyntax as rs
obj = rs.GetObject(“Select mesh”, rs.filter.mesh)
point = rs.GetPoint(“Pick test point”)
intersect = rs.MeshClosestPoint(obj, point)
if intersect: rs.AddPoint(intersect)
Example file included.
Error:
Message: not all arguments converted during string formatting
Traceback:
line 375, in coerce3dpoint, “C:\Users\gdlfa\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 80, in AddPoint, “C:\Users\gdlfa\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\geometry.py”
line 6, in , “C:\Users\gdlfa\AppData\Local\Temp\TempScript.py”