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: 

Creating triggers when specific parameters are changed

2 REPLIES 2
Reply
Message 1 of 3
zchambliss
95 Views, 2 Replies

Creating triggers when specific parameters are changed

All, 

I know there is quite a bit of reading material on iTriggers, and Event Triggers but I have yet to find something that fixes my specific issue. 

My company uses an assembly with multiple sub assemblies utilizing quite a few local rules to configure and control all assemblies and parts. Adding those rules to Event Triggers "Any time user parameter is changed" was the best way I found to get everything to run how I wanted in the beginning. However, doing that causes too many to run when trying to change something simple. 

 

I'm looking for a way to trigger rules specific to the parameters inside that rule. I.E. -- I change Frame_wdth and the rule "Frame Layout" runs and none of the other ones. 

 

Is there a way to add custom Event triggers? Or is it possible to have as many iTriggers as needed and run rules that way? 

 

I'm kind of at a loss on this one and may not be explaining it correctly but any help would be greatly appreciated. 

2 REPLIES 2
Message 2 of 3

I am sure creating an add in will bring you further, then using ilogic for these things.

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !

Message 3 of 3
WCrihfield
in reply to: zchambliss

Hi @zchambliss.  I agree that often when you need to be able to react to very specific events, in very specific ways, creating an Inventor ApplicationAddIn is often the way of making that possible that will give you the most control, but it can also be rather complicated, and sometimes is just not an option, for one reason or another.  Like in my case, I am pretty good at writing code, but can not create my own add-ins, because of corporate restrictions at work.  When the event is for a specific parameter changing though, that is among the easiest to automate.  When we include the unquoted name of a parameter within an internal iLogic rule, and that rule is saved within the same document that the parameter exists in, those parameter names will turn blue by default, which indicates that it recognizes them as being local parameters, and that will cause that rule to automatically be triggered to run any time the value of any of the blue parameters within that rule changes.  This behavior can be turned off, but it is on by default.

 

We can use that behavior to our advantage in a situation like this though.  I use this technique a lot myself.  I simply create a very simple internal iLogic rule within that document, then create a dummy variable (not going to be used for anything), then set its value to that blue, unquoted parameter name.  That will cause the triggering when that specific parameters value changes.  Next, write a line of code that just runs some other external iLogic rule that does the actual work that needs to be done as a reaction to the value of that (those) parameters values changing.  Below is just one possible example of a rule like that.

oTrigger = Thickness
iLogicVb.Automation.RunExternalRule(ThisDoc.Document, "External Rule Name")

oTrigger does not represent anything, and is not being used for anything, but is only a dummy variable that I am setting the value of the Parameter named "Thickness" to, because we can't just put Thickness on that first line by itself.  We either have to be getting its value, or setting its value, one way or another.  Then that second line is just one of several ways we can run another iLogic rule, but this one allows us to specify a document that we want the other rule to 'focus on' when it runs (if that other rule is set up to work with that suggestion).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report