Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic form not updating between open documents when they become active

Anonymous

iLogic form not updating between open documents when they become active

Anonymous
Not applicable

Does anyone have this issue. 

I have created lots of external iLogic rules and when I manually run any of these rules in any open document they all work fine.

To make things easier I created a global form, with which I can press a button and fire the corresponding iLogic rule.

This works well for all rules in a newly opened drawing, but when I move to another already open drawing certain rules don't work. If I close the form and reopen the form in that already open drawing all the rules work again.

 

I have the event trigger on "open drawing" to fire a rule which loads the form, so if I only open one drawing at a time I have no problems...less than ideal.

All my code is pretty robust, with "thisapplication.activedocument" and " oDoc.ActiveSheet" etc to look only at the current document

Any suggestions?

 

Using Inv2018.3

64 bit

 

0 Likes
Reply
Accepted solutions (2)
2,220 Views
23 Replies
Replies (23)

Anonymous
Not applicable

Now i do. Thank you for the information

0 Likes

Curtis_Waguespack
Consultant
Consultant
Accepted solution

 

 


@Anonymous wrote:

 

...

All my code is pretty robust, with "thisapplication.activedocument" and " oDoc.ActiveSheet" etc to look only at the current document

 


Hi @Anonymous,

 

I'm just adding this in case it helps you or someone else in the future, I think you should be able to use ActiveEditDocument to do this. 


As an example try creating an external rule with this simple code in it, and then run it from the global form.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

oDoc = ThisApplication.ActiveEditDocument
sName = oDoc.FullFileName

MessageBox.Show(sName, "iLogic")

 

Anonymous
Not applicable

Genius, thanks Curtis.

0 Likes

DRoam
Mentor
Mentor

FYI for anyone who comes on this thread, I created an Idea for this so it can be tracked as an enhancement request. You can add your vote here: iLogic: Option to close or refresh Global Forms when switching documents.

 

Here's a photoshopped image I posted of what it might look like:

 

Global Form Switching Options.png

 

The "ThisDoc" and "ActiveDocument" workarounds work well for External rules fired from the form, but iProperty fields, parameter fields, and local rule buttons in the form remain stuck linked to the original document the form was fired from. The form needs to refresh between documents for these to reflect or modify on the active document.