I've come up against a confusing wall in my rule driven assembly, hopefully someone can point out what might be the problem.
The setup is:
I have a rule which first gets a number of user parameters via input boxes.
This rule then runs a number of other rules, using:
iLogicVb.RunRule("Rule 1") iLogicVb.RunRule("Rule 2") iLogicVb.RunRule("Rule 3")
Each of these rules control parameters, part/feature/constraint suppression etc. in the top level and subassemblies/parts based on the previously obtained user parameters.
All the rules have the 'Don't run automatically' option selected, so all should only run as intended when I manually run the first rule.
When I run the first rule, I enter all the parameters, and the subsequent rules run.
The problem is, the suppression states etc. in the subassemblies/parts do not update.
Looking at the parameters dialog box after the rules have run, all user parameters have updated with the new values.
If I run the first rule again the subassemblies/parts update correctly.
It appears that the rules that control the suppression states etc. of the subassemblies run using the initial values of the user parameters, i.e. the values as they were before the user input is obtained, rather than the new values.
This is confusing me, as the code is structured as follows:
user_parameter_1 = InputBox("User Parameter 1", "Input", "xx") user_parameter_2 = InputBox("User Parameter 2", "Input", "xx") iLogicVb.RunRule("Rule 1") iLogicVb.RunRule("Rule 2")
Many thanks for any pointers you can offer.
- Inventor Professional 2011 64Bit SP2 -
Just for information if anyone finds this while searching for a similar problem, the solution is to use the following in the main rule before the subsequent rules are called:
As I understand it, the new parameter values need saving from iLogic back to the model (which is accomplished using the code above), from where they can be used by the subsequent rules. If you don't do this, the new parameters are not saved back to the model until the rule exits, which occurs after the subsequent rules have run.
Access a broad range of knowledge to help get the most out of your products and services.