Inventor Customization

Reply
Member
andrewhaigh
Posts: 4
Registered: ‎01-30-2013
Message 1 of 3 (722 Views)

iLogic - Rule Driven Assembly - Update Problems

722 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.

 

Andy

 

- Inventor Professional 2011 64Bit SP2 -

Member
andrewhaigh
Posts: 4
Registered: ‎01-30-2013
Message 2 of 3 (686 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:

 

RuleParametersOutput()

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
Carthik_Babu
Posts: 120
Registered: ‎01-29-2013
Message 3 of 3 (618 Views)

Re: iLogic - Rule Driven Assembly - Update Problems

05-27-2013 10:44 PM in reply to: andrewhaigh
Hi,
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
Email:carthik.ms@gabriel.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube