Inventor Customization

Inventor Customization

Posts: 4
Registered: ‎01-30-2013
Message 1 of 3 (842 Views)

iLogic - Rule Driven Assembly - Update Problems

842 Views, 2 Replies
04-23-2013 01:21 AM

Hi all,


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 -

Posts: 4
Registered: ‎01-30-2013
Message 2 of 3 (806 Views)

Re: iLogic - Rule Driven Assembly - Update Problems

04-26-2013 06:04 AM in reply to: andrewhaigh

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.

Distinguished Contributor
Posts: 121
Registered: ‎01-29-2013
Message 3 of 3 (738 Views)

Re: iLogic - Rule Driven Assembly - Update Problems

05-27-2013 10:44 PM in reply to: andrewhaigh
i got this code from some link., i have not used this yet....check the same and reply
Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
map.Add("user_parameter_1", "user_parameter_1")
iLogicVb.RunRule("Rule 1", map)
Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA ,
"May all beings be happy"
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.