Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Form button to run all rules in 2012

3 REPLIES 3
Reply
Message 1 of 4
SteveX82
1196 Views, 3 Replies

Form button to run all rules in 2012

Long story short, I am trying to find a way to add a button to an iLogic form that will run all rules in the document and "apply" all of the parameters in non-automatic rules.

 

With IV2010, I had been using the iTrigger and a rule I had found here on the forums to do so. However, I want this functionality to be operated from a single iLogic form and haven't found a way to manipulate the iTrigger0 parameter without encountering a bunch of issues.

 

Here are the caveats:

1) Some rules are set to run automatically, as they modify MultiValueLists and update "feedback" parameters depending on other selected parameters. Consequentially, I cannot set the form to use OK/Cancel/Apply buttons.

 

2) Some rules are NOT set to run automatically. These rules can take awhile to run (30-60 seconds total), and I don't want the assembly to rebuild itself every time one of the 30-40 design parameters is changed.

 

 

Is there a hidden "RunAllRules" function that I'm missing, or is there a way to place the iTrigger button into a form? I could link a form button a rule that has a complete list of "iLogicVB.RunRule("XXXXXX")" lines, but this would be tedious and require upkeep as new rules are added and deleted.

 

Thanks for any input you can provide.

 

- Steve

Tags (3)
3 REPLIES 3
Message 2 of 4
xiaoyan.qi
in reply to: SteveX82

Hi, Steve 

 

for "RunAllRules", you can get it from the context menu on iLogic brower->Rule panel 

RunAllRule.png

is it works for you? 

 

Thanks 

Mick

Message 3 of 4
SteveX82
in reply to: xiaoyan.qi

I need to find a way to utilize that "Run All Rules" command (or even the iTrigger command) from within an iLogic form. I figure there has to be a way to add either of these buttons to a form (or even a rule that contains the API command), but it is curiously absent from both the rule and form editor.

Message 4 of 4
xiaoyan.qi
in reply to: SteveX82

Hi, Steve

 

i can't find the exist "RunAllRule" to be added on form, but  you can create a external rule contains code to run all rules, here is a rule to run all rules(in the document) for your reference

==============================================================

    Dim oDoc As Document
    oDoc = ThisApplication.ActiveDocument
   
    Dim oAddins As ApplicationAddIns
    oAddins = ThisApplication.ApplicationAddIns
   
    Dim oaddin As ApplicationAddIn
    Dim oiLogic As Object
    oaddin = oAddins.ItemById("{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}")
    oiLogic = oaddin.Automation
   
    Dim rule As Object
    Dim docRules As Object
    docRules = oiLogic.rules(oDoc)
    If (Not docRules Is Nothing) Then
      For Each rule In docRules
            iLogicVb.RunRule(rule.Name)
      Next
    End If

==============================================================

 

as to add the "iTrigger  command ", it's easy to create a rule to realize the same function, like:

=====================

iTrigger + = 1

=====================

Let me know if it works

Thanks

Mick

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

Post to forums  

Autodesk Design & Make Report