"Any model parameter change" event trigger doesn't work with a change to a boolean parameter

"Any model parameter change" event trigger doesn't work with a change to a boolean parameter

Stuart.FowlerW85LG
Explorer Explorer
404 Views
2 Replies
Message 1 of 3

"Any model parameter change" event trigger doesn't work with a change to a boolean parameter

Stuart.FowlerW85LG
Explorer
Explorer

Hi folks,

 

Perhaps I am missing something here, but I am trying to get an iLogic rule to fire when I change a boolean parameter between true and false. The rule fires just fine when any of my numerical parameters change, however no joy when my boolean parameter is changed.

 

If this is not possible, can anyone suggest a work around that will run the rule when this boolean parameter is changed?

 

Here is my iLogic code:

 

If Parameter("angled") = True
	Parameter("off") = Parameter("H_")
InventorVb.DocumentUpdate()
End If

If Parameter("angled") = False
	Parameter("off") = (Parameter("L_")) / 2 ul
InventorVb.DocumentUpdate()
End If

 

Like I mentioned I have set up an event trigger to run this rule under the "any parameter change" trigger.

 

I have attached a screenshot of my parameters as well as the part file, any help would be greatly appreciated.

 

Many thanks,

Stuart

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

WCrihfield
Mentor
Mentor
Accepted solution

Hi @Stuart.FowlerW85LG.  That parameter is a 'User Parameter' not a 'Model Parameter', so you need to put that rule under the 'Any User Parameter Change' event, instead of under the 'Any Model Parameter Change' event.

Edit:  I think that 'Any User Parameter Change' event became available in 2022 release of Inventor, so If you have an older version, that specific event will not be available.  In that case, you could get your internal rule to be triggered to run by adding this line of code to that very beginning of your rule's code, on a line by itself.

 

oTrigger = angled

 

The word 'angled' should turn blue by default, because it is recognized as a local parameter.  Then any time the value of that parameter is changed, it will trigger this rule to run.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

Stuart.FowlerW85LG
Explorer
Explorer

Hi @WCrihfield

 

Many thanks for your help! I read you're initial reply when I got home last night about using the 'Any User Parameter Change' event trigger and was kicking myself for not seeing it, but then as you pointed out it wasn't added until 2022 and we're still running 2021 here (updating to 2023 soon).

 

That line of code worked perfectly though, thank you again.

0 Likes