Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set event in Addin OnViewUpdate

0 REPLIES 0
Reply
Message 1 of 1
prixodkomv
218 Views, 0 Replies

How to set event in Addin OnViewUpdate

Hello I have a problem with the event OnViewUpdate. I need to track the event OnViewUpdate. I ask for the activation of the document, but the event handler does not work. Sewn Addin in Visual Studion 2010 on a C # using Inventor 2011.
My code:

void ApplicationEvents_OnActivateDocument (_Document documentObject, EventTimingEnum beforeOrAfter, NameValueMap context, out HandlingCodeEnum handlingCode)
{
try
{
if (beforeOrAfter == EventTimingEnum.kAfter)
{
var drawDocument = (DrawingDocument) MInventorApplication.ActiveDocument;
foreach (Sheet sht in drawDocument.Sheets)
{
foreach (DrawingView drawV in sht.DrawingViews)
{
if (drawV.ViewType == DrawingViewTypeEnum.kStandardDrawingViewType)
{
drawV.DrawingViewEvents.OnViewUpdate + = new DrawingViewEventsSink_OnViewUpdateEventHandler (DrawingViewEvents_OnViewUpdate);
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show (ex.Message);
}
finally
{
handlingCode = HandlingCodeEnum.kEventHandled;
}
}
void DrawingViewEvents_OnViewUpdate (EventTimingEnum BeforeOrAfter, NameValueMap Context, CommandTypesEnum ReasonsForChange, out HandlingCodeEnum HandlingCode)
{
MessageBox.Show (@ "Standard drawing view is updated");
HandlingCode = HandlingCodeEnum.kEventHandled;
}

Thanks in advance for ideas.

Использовать Переводчик Google в следующих ситуациях:Поиск
Видео
Электронная почта
Телефон
Чат
Бизнес:Инструменты переводчика
Global Market Finder
Website Translator
О Переводчике GoogleОтключить моментальный переводКонфиденциальностьСправка

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report