Hello,
I have created a program in C# with "Windows Forms". Everything works when I start program in VS and use the active instance of Inventor :
"MarshalCore.GetActiveObject("Inventor.Application") as Inventor.Application"
I created a second application that adds this functionality to the ribbon. But the form does not work the same way as in the first program.
For example, a simple button that closes a form does nothing:
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
Another button that starts selecting lines in the drawing stops at the selected place and I can't select the line. (in first program it works) Should I somehow hide the form window? How to do it?
private void btnCreateSymetricAnnotates_Click(object sender, EventArgs e)
{
selectedCurve = (DrawingCurveSegment)m_inventorApp.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select curve"); //stop here
.
.
.
}
I would also like to ask how to get the Inventor.Application variable in the Add-In. Currently, I am still using :
m_inventorApp = MarshalCore.GetActiveObject("Inventor.Application") as Inventor.Application;
The code works, but maybe it would be correct to use another way?
Solved! Go to Solution.
Solved by Hubert_Los. Go to Solution.
Hello,
I found where the problem was. I copied the windows form to the second project and something copied wrong. I don't know what yet, but when I created a new form it worked.
Can't find what you're looking for? Ask the community or share your knowledge.