reset an ilogic rule for different file without closing rule

reset an ilogic rule for different file without closing rule

andrew_canfield
Collaborator Collaborator
549 Views
2 Replies
Message 1 of 3

reset an ilogic rule for different file without closing rule

andrew_canfield
Collaborator
Collaborator

Hello

 

There is a iLogic rule to right an iproperty which works fine when one drawing is open but if it is ran & then a second file (drawing) clicked (new focus) the rule will not re run until closed & reopened.

My guess a line is needed at the bottom of the rule to reset/refocus? 

What am I looking for? (hope this makes sense!)

 

Regards

 

Andrew

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

WCrihfield
Mentor
Mentor

Are you working with a non-modal iLogic Form, and attempting to click a button on the form, which runs a rule?  iLogic Form's maintain their focus on the document that was open/active when the form was launched.  In order for the form to focus on another document, it has to be closed then reopened, as you are describing.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

WCrihfield
Mentor
Mentor
Accepted solution

If not working with a Form.  It is likely just in how you are referring to the 'target' document, if any.  Also, some built-in iLogic 'tools' tend to work on either the 'local' document, or the 'active' document, depending on the scenario.  If you are using the [ iProperties.Value("PropertySetName", "PropertyName") = "a new value" ] call, that is designed to work with whichever document is 'active' at that point in the code where it is used.  Most Document objects have an "Activate" method, which will cause the specified document to become 'active'.  And there are other methods/actions that will change which document is 'active' too.  You may need to either use this Activate method, to ensure the right document is active, or you can just go the longer route of Document.PropertySets.PropertySet.Property.Value = "", instead, while the Document variable used is the one you want to read/write properties from/to.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)