Check which trigger started iLogic rule

Check which trigger started iLogic rule

pball
Mentor Mentor
496 Views
2 Replies
Message 1 of 3

Check which trigger started iLogic rule

pball
Mentor
Mentor

I'm making some ilogic code for my new drawing templates and I'd like run part of the code only when the rule is trigger by the "after open document" trigger. Is there a way to check which trigger started an iLogic rule or would I be stuck making a second rule which is only triggered by the "after open document" trigger?

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
497 Views
2 Replies
Replies (2)
Message 2 of 3

MegaJerk
Collaborator
Collaborator

I do not believe that there is an event to do this, however depending on what it is your code is doing, you may be able to either create a boolean True / False state that is changed whenever you create a new design and your initial Trigger rule is ran for the first time - Or - you may be able to test the values that you are changing / populating with the code that you would only like to run once along the lines of  If Not Data = Whatever It Should Be Then ... Otherwise, Don't Run This. 





If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
0 Likes
Message 3 of 3

pball
Mentor
Mentor
Well after thinking about it for a few minutes today I managed to think of the solution to my problem. Check if the file name is blank if it's not then do something that requires the document having a file name. I guess my brain was more fried on Friday than I thought it was.

if (ThisDoc.FileName(False) <> "") then
'Do stuff requiring document to have a file name or it'd cause a false alarm.
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes