cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic global forms and External rules run automatically in response to particular parameter changes

ilogic global forms and External rules run automatically in response to particular parameter changes

It would be beneficial if it worked. Please vote. Thank you

External rules run automatically in response to particular parameter changes

The current situation is restrictive.

External rules do not run automatically in response to particular parameter changes

Example:
I have global forms, I have external rules. I open the form, change the parameter (drop-down list) and the rule starts.

4 Comments
WCrihfield
Mentor

Hi @dusan.naus.trz.  I like the general idea.  If you use the Event Triggers dialog, then drag an external rule over under the 'Any Model Parameter Change' or the 'Any User Parameter Change' event, it will run that rule every single time any model parameter or user parameter changes.  That is not always ideal, and can lead to lots of extra processing and inefficiency.

 

Then there is the scenario where:  if you create an iLogic rule within the document (not an external rule), then you put the unquoted name of a parameter (one that is already present in that document) within that rule, it will cause that rule to be ran every time that parameter changes.  This is much more efficient, because it is only triggered by that one specific parameter, not all of them.  You could create (or inject) a local (saved within the document) iLogic rule into the document, which includes the unquoted name of the 'trigger' parameter, then use the iLogicForm.ShowGlobal("Form 1")  to launch the iLogic form when that parameter changes.

oTrigger = Length
iLogicForm.ShowGlobal("Form 1")

The next option would be to use the OnParameterChange() Event and write your own custom event handler code that can run in the background.  This type of thing is usually best used in Add-ins, but I have used them in iLogic rules before too.  Even though the main even will be triggered every time a parameter is changed in the specified document, with this type of code, you know which specific parameter caused it to be triggered, and and can direct your code to only react to it if it was the parameter you are targeting.  And if this event handler is created and launched by an iLogic rule, you can still use the iLogic only snippet (featured above) to launch the iLogic form.  Here is a link to one of my contribution posts about creating your own event handler code using iLogic.  Just a couple current possibilities.

dusan.naus.trz
Advisor
Yijiang.Cai
Autodesk
Status changed to: Under Review

Many thanks for you posting the idea to us, and tracked as [INVGEN-61544].

MjDeck
Autodesk

Here's the simplest workaround for external rules. This is similar to the recommendation by @WCrihfield for global forms.
Create a rule in the document that looks like this:

 

Dim trigger = Length & Width
iLogicVb.RunExternalRule("Length and Width")

 

Then in the external rule, use the Parameter function to get and set the parameter values:

 

If Parameter("Length") > 10 Then

 

 

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

Submit Idea  

Autodesk Design & Make Report