
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm programming in C# in inventor 2016/2017. I use this event to detect if a user activates a sheet.
private static Sheet oldval = null;
private static void ApplicationEvents_OnActivateView(Inventor.View vw, EventTimingEnum BeforeOrAfter, NameValueMap Context, out HandlingCodeEnum HandlingCode)
{
DrawingDocument drawingdoc = _inventorapp.ActiveDocument as DrawingDocument;
if (drawingdoc != null)
{
Sheet sheet = drawingdoc.ActiveSheet;
if (sheet == oldval)
{
HandlingCode = Inventor.HandlingCodeEnum.kEventHandled;
return;
}
oldval = sheet;
ExecuteTools.SetStartupValue(_inventorapp, drawingdoc);
}
HandlingCode = Inventor.HandlingCodeEnum.kEventHandled;
}
There are two problems. First of all, when I open an IDW and activate a sheet, the code above is repeatedly being accessed. Even though I kEventHandled is Handled, it keeps returning in this function with the HandlingCode being back at nothandled.
Second problem, This code isn't being called for when I have an IDW with several sheets in it. When I activate another sheet in the same IDW, the
OnActivateView isn't called. What event do I need to use for this ?
Solved! Go to Solution.