Inventor crashing when a SketchLine3D is selected

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am in an assembly and editing a part in that assembly(in-place edit) through code. I am editing a Sketch3D (through code) and giving option to select a SketchLine3D through user interaction so that I can get the start and end point of selected SketchLine3D for further processing. But when I select a SketchLine3D of a sweep path interactively, Inventor is crashing. Can anybody help me with this issue?
Part of my code(Using Inventor 2015 and VS 2012):
foreach (ComponentOccurrence oCompOcc1 in asmDoc.ComponentDefinition.Occurrences.AllLeafOccurrences)
{
oCompOcc = oCompOcc1;
if (oCompOcc.Name == "XYZ")
{
oCompOcc.Edit();
break;
}
}
PartComponentDefinition oPartCompDef = oCompOcc.Definition as PartComponentDefinition;
foreach (Sketch3D oSketch3d1 in oPartCompDef.Sketches3D)
{
oSketch3d = oSketch3d1;
if (oSketch3d.Name == "SketchName")
{
oSketch3d.Edit();
break;
}
}
m_inventorApplication.ActiveView.Update();
Object oPicked = m_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kAllLinearEntities, "Select a sketch line"); //Inventor crashing after this line is executed as soon as the SketchLine3D is selected.