Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Message box opens for all assemblies

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
madstrolle
98 Views, 2 Replies

Message box opens for all assemblies

Hi guys😊,

 

I have a message box that pops up with warnings of things to do after closing an assembly (triggered after closing).

The problem is that it pops up for all assemblies inside the top assembly.

I only want it to pop up for the top assembly.

 

2 REPLIES 2
Message 2 of 3

Hi @madstrolle . You can add a document check to see if it is an active document. Here is an example of such a check:

 

Dim oDoc As Document = ThisDoc.Document
If oDoc Is ThisApplication.ActiveDocument Then 
	MessageBox.Show(oDoc.DisplayName & " - is active document!")
End if

 

ThisDoc.Document - receives the document in which the rule is executed;

ThisApplication.ActiveDocument - receives an active document;

All you have to do is compare these 2 documents using the IS operator.

Andrii Humeniuk - Leading design engineer

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

Hi @Andrii_Humeniuk ,

 

Looks like it did the trick.

Thanks😊

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report