Hi, I am having issues with rs.GetPointOnMesh() where when I click outside of the mesh it returns (0,0,0) instead of “Null”.
Is this intended?
If it is intended then how should I detect if a mesh isn’t clicked on or if the mesh had a vertice at (0,0,0) that was clicked at?
This goes for both V5 and V6
i think this could be improved in RhinoScript syntax so it does not return a point when no pick was done on the mesh. Below is a possible workaround:
import rhinoscriptsyntax as rs
id = rs.GetObject("Pick a mesh", rs.filter.mesh, True, False)
if not id: return
mesh = rs.coercemesh(id, True)
gp = Rhino.Input.Custom.GetPoint()
gp.SetCommandPrompt("Point on mesh")
if gp.CommandResult() != Rhino.Commands.Result.Success:
Thanks, I’ll test that out!