Event tiggers : After Open Document - Not triggered in file within an assembly

Event tiggers : After Open Document - Not triggered in file within an assembly

serge2NPMD
Participant Participant
283 Views
3 Replies
Message 1 of 4

Event tiggers : After Open Document - Not triggered in file within an assembly

serge2NPMD
Participant
Participant

We are using Inventor 2022 with the latest updates and have an ilogic rule that is trigger on After Open document for all parts document.

 

If we open an assembly, the rule is not triggered for any the the parts that are in the assembly.

If a part is open from that assembly, the rule is not triggered.

If the assembly is closed and we open the part, the ruled is trigger.

 

When we were using Inventor 2021 and we opened an assembly, the rule was triggered for all the the parts that was in the assembly.

 

Is there a way to trigger the rule for all parts within an assembly when we open the assembly ?

 

Thanks.

 

0 Likes
Accepted solutions (1)
284 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor
The event you are searching for is not in the OpenDocuments but on the OnAcivateDocument. This is not as selection in the Eventrigger dialog. You may need an addin for this or a different i-logic code. I would prefer the add-in because this is easier.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Hi @serge2NPMD.  Just out of curiosity, how is that iLogic rule identifying the document that it is supposed to be targeting?  Is it using 'ThisApplication.ActiveDocument', or 'ThisDoc.Document', or some other phrase (please specify)?  Are you 100% sure that the rule is not being triggered, but then maybe just not doing what it is supposed to be doing, due to incorrect document reference?  If using 'ThisApplication.ActiveDocument', then that term will always be pointing to the 'main/top level' assembly, instead of a part within the assembly, so your code would be trying to do something with that main assembly instead.  And when editing a part type component within an assembly, the term 'ThisApplication.ActiveEditDocument' can often be used to access that part that is being edited.  It is best to use 'ThisDoc.Document' term within iLogic rules that may be ran remotely.  It is a dynamic term, and attempts to reference the most appropriate document in different situations.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

serge2NPMD
Participant
Participant

Hi @WCrihfield ,

Your the man ! One of the line was calling  ThisApplication.ActiveDocument instead of ThisDoc.Document
Now everything works fine.
Thanks !

0 Likes