Is there some syntax that would refresh a previouse rule before the next one starts? I have a file where the constraint is not turning on when it is supposed to, but all I have to do is refresh the rule and it works.
See video:
http://screencast.com/t/Nnyru3ePIk
Solved! Go to Solution.
Solved by Breeze104. Go to Solution.
Solved by mrattray. Go to Solution.
iLogicVb.RunRule
("add rule name here!")
Sorry it took so long to get back...there have been issues..LOL
I tried what you suggested, But...there are issues....LOL
Rule Compile Errors in AxleBrackets, in Hoppers-01.iam
Error on Line 1 : Overload resolution failed because no accessible 'RunRule' accepts this number of arguments.
Error on Line 2 : Syntax error.
This is how I coded it
iLogicVb.RunRule
("Hopper_Type")
I also tried without the () as well and I get the same error.
I put the...iLogicVb.RunRule... code in as a seperate rule at the end and wrote it like this...
iLogicVb.RunRule ("Hopper_Type")
and the error quit but it acts like it isn't running the rule...or is just doesn't do what I need it to do.
Well I manually ran the rule and it worked like I wanted but why doesn't seem to run when I am switching between bodies via the form?
Well I am running into this same issue again with another file. This time I also tried what you suggested but it still didn't work, so I tried adding an extra rule specificly to rerun the rule in qhestion but it still didn't work. Any suggestions?
Can you post the code from the rule that "needs to be refreshed". I think I know what's going on but want to confirm it first.
BTW, sorry I never got around to going through those files you sent me. There was a lot there and every time I started pulling it apart and analyzing it something would come along.
Component.IsActive("72-3:1") = False Component.IsActive("PTH 72-2:4") = False Component.IsActive("PTH 72-2:3") = False Component.IsActive("PTH 72-2:2") = False Component.IsActive("PTH 72-2:1") = False InventorVb.DocumentUpdate()
I am adding a link to a video that shows the rest of the rules and the code for each.
If that's all there is in the rule, it's never going to run without being manually triggered. Rules are only triggered automatically when a parameter it references is changed. You need some sort of a trigger in the rule.
If you're using an iLogic form, then I would simply insert the rule into the form. This will create a button you can click.
If I tell the rule before it to run it would that work? If so then what happens when I suppress the rule? Is there a way to make an argument in the rule ahead of it to check to see if the rule is suppressed or active first and then react accordingly?
Yes, if you put the line...
iLogicVB.RunRule("The name of the rule you want ran")
... into another rule then it will run everytime the rule that contains the line is ran. It will run the rule regardless of wether it is suppressed or not. Suppressing a rule is different from suppressing a part Suppressing a rule only prevents it from running automatically, it doesn't unload the rule from memory.
so if I tell it to run it in the rule before it and the suppress it when I don't need it any more, it the just basicly becomes dead code.
Suppressing that code doesn't change anything because it already wont run automatically.
well I added the "run rule" code at the end of the rule above the "ScreenOnly" rule and it ran the rule eventhoug the rule was suppressed.
I figured it out. I had to use a the Event Trigger "Componet Suppression Change". That makes it work like it is supposed to.
Thanks for your help.
As touched upon by others, a rule will not just run you need to have a "trigger" like a parameter change or an event to "fire" a rule
You also mention suppressing rules, not sure exactly how you would do that much lessmake sure the rule was unsuppressed when required. I would have the rule unsuppressed all the time and surround the code within the rule with a "if" statement. That way the rule will only run if the if statement is True
I only need to run the rule when I am getting into the drawings associated with the wire mesh, so manually turning the rule on/off is not a problem.