Hi;
Which friend cant give me a sample of this Method in c#?
@pythonuser, below pyton code might help to find out:
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def pline_filter(rhino_object, geometry, component_index):
if isinstance(geometry, Rhino.Geometry.PolylineCurve):
return True
return False
def DoSomething():
poly_id = rs.GetObject("Select polyline", 4, True, False, pline_filter)
if not poly_id: return
mesh_id = rs.GetObject("Select mesh", 32, False, False)
if not mesh_id: return
polyline = rs.coercecurve(poly_id, -1, True)
mesh = rs.coercemesh(mesh_id, True)
intersect = Rhino.Geometry.Intersect.Intersection
pts, faces = intersect.MeshPolyline(mesh, polyline)
if pts.Count > 0:
rs.AddPoints(pts)
else:
print "No intersection points found"
DoSomething()
c.
Think you @clement; in python I kown how to use it, but in c# I do not, because it mush 3 parameter in c#.
I am new in c# now:grinning:.
Think you very much.
Here is a C# example…
https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCsIntersectionMeshPolyline.cs
Think you very much @dale