AnsweredAssumed Answered

(C#) Intersection curve: crash when using Insert3DSketch

Question asked by Marco Maso on Mar 10, 2016
Latest reply on Mar 20, 2016 by Marco Maso

Hi, I'm trying to get an intersection curve between a plane and a surface. Reading the API docs, I tried to use Insert3DSketch but everytime I try to use it Solidworks crashes without notice.

 

I also tried to register a macro in order to see the commands. The macro works fine.

 

I'm trying with this code:

 

swDoc = ((ModelDoc2)(swApp.ActiveDoc));

Body2 myBody = (Body2)bo;

swSelectionManager.AddSelectionListObject(myReferencePlane, selData);

swDoc.SketchManager.InsertSketch(true);

swDoc.Sketch3DIntersections();

swSelectionManager.AddSelectionListObject(myBody, selData);

swDoc.Sketch3DIntersections();

swDoc.ClearSelection2(true);

swDoc.Sketch3DIntersections();

swDoc.ClearSelection2(true);

swDoc.SketchManager.InsertSketch(true);

 

Thanks.

Outcomes