Inventor General Discussion

Reply
Distinguished Contributor
nstalker
Posts: 180
Registered: ‎03-16-2012
Message 1 of 4 (287 Views)

Trouble understanding how rules work with parameters

287 Views, 3 Replies
11-01-2012 01:30 PM

OK so I got my first working iAssembly.  I'm very happy about this.  It's a roller conveyor and I used parameters and iParts to create different assemblies.  I have different widths, lengths and height for my roller conveyors.

 

I got to thinking that I could use rules to simplify things.  For example, I would like to create a rule that selects the number of rollers based on the length of the conveyor.  I thought the easiest way to do this would be to look at the part number for the rails to determine the length and then set the number of rollers accordingly.

 

So - my rail is an iPart shown below as either 36in LG conveyor:1 or 120in LG conveyor:1.  I first noticed that I could successfully change the number of rollers with the first two lines of code (and an endif).  That was cool.  So I thought, how about an ElseIf?  So I added the next 2 lines of code.  The problem is that if I swap out the 36in for the 120in, Inventor doesn't see the 36in piece so it errors out (see error below the code).  What should I do in this situation?

 

If Component.IsActive("36in LG conveyor:1") = True Then

Parameter("no_of_rollers") = 12 ul


ElseIf Component.IsActive("120in LG conveyor:1") = True Then

Parameter("no_of_rollers") = 36 ul

End If

Error in rule: No_of_Rollers, in document: conveyor bed.iam

Component: The component named "36in LG conveyor:1" was not found.

 
Contributor
JanVarholik
Posts: 20
Registered: ‎09-08-2011
Message 2 of 4 (262 Views)

Re: Trouble understanding how rules work with parameters

11-02-2012 04:04 AM in reply to: nstalker

Would it be possible to provide the dataset as well?

 

Thanks,

Jan

Distinguished Contributor
nstalker
Posts: 180
Registered: ‎03-16-2012
Message 3 of 4 (247 Views)

Re: Trouble understanding how rules work with parameters

11-02-2012 10:07 AM in reply to: JanVarholik

no I can't do that unfortunately

Employee
MjDeck
Posts: 958
Registered: ‎02-24-2009
Message 4 of 4 (201 Views)

Re: Trouble understanding how rules work with parameters

11-07-2012 08:31 AM in reply to: nstalker

Are you using an iLogic rule to select different iPart configurations (different conveyor lengths)?  Or are you selecting different lengths manually?



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

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