- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I created an add-in and added it to the ribbon. I would like to select a drawing line when I click the button. The program waits for the line to be selected, but I can't select anything. The program crashes and stops in the code.
private void btnPick_Click(object sender, EventArgs e)
{
DrawingCurveSegment pickedLine = (DrawingCurveSegment)m_inventorApp.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "pick line"); //here the program stops
.
.
.
}
The same code works if I run it in visual studio and use the(then windows form is independent of Inventor):
m_inventorApp = MarshalCore.GetActiveObject("Inventor.Application") as Inventor.Application;
In the picture shows that the add-in can read the names of open drawings, so it works. Everything except the line selection.
I cannot perform any action in Inventor until I close the add-in.
I tried to hide windows form, but it is not enough.
I suspect that I need to deactivate windows form during line selection, however I have no idea how I can do that.
Do you have any advice on how to do this?
Screen after click btnPick (The program crashed. There is no "pick line" message visible, which is in the code)
Solved! Go to Solution.