iLogic & Parameters

iLogic & Parameters

JoelMckone
Advocate Advocate
1,128 Views
6 Replies
Message 1 of 7

iLogic & Parameters

JoelMckone
Advocate
Advocate

I have created some parts and added parameters and iLogic so I can change the color and size of the parts.  If I go into the assembly I have to click on the parts to change the parameters.  I assume there is a way I can do this directly in the assembly but have not been able to find anything on the internet nor in one of courses I took on how to do this.  Can it be done and if so how?  (or can someone direct me to a tutorial on how this works?)

0 Likes
Accepted solutions (1)
1,129 Views
6 Replies
Replies (6)
Message 2 of 7

Curtis_Waguespack
Consultant
Consultant

Hi JoelMckone,

 

Typically you would just call your parameters from a rule in the assembly with a line such as this:

 

 

Parameter("Part1:1", "Length") = 1.2

 

Or this if the part is in a sub assembly:

 

Parameter(MakePath("SubAssem1:1", "Part1:1"), "Length") = 1.2

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 7

JoelMckone
Advocate
Advocate

A few more details...

 

What I have done is create a model of a octagon window that includes glazing stops and glass.  With most windows there would be a height and width however an octagon can be created from a single dimension.  To do this I created a user parameter named OsmW (outside measurement width) that is used to create all parts and is associated with the frame sill.  For example the frame parts are OsmW/2.414, the glazing stop is OsmW/2.414 - 1.562.  The frame consists of 2 different parts - Frame and Frame sill (sill requires additional processing).   From the sample code provided I cannot determine how the syntax has to be so I can change the dimension in the assembly rather that having to select the sill.

 

I have not had a change yet to experiment with the color options being selectable from the assembly.

0 Likes
Message 4 of 7

Curtis_Waguespack
Consultant
Consultant

Hi JoelMckone,

 

You could create a rule and use an input box to set the parameter value of the part. Here's a quick example:

 

oLength = Parameter("Test_Part:1", "Length")/2.54 'converts from internal cms to inches

oLength = InputBox("Enter New Length", "iLogic", oLength)

Parameter("Test_Part:1", "Length") = oLength

InventorVb.DocumentUpdate()

 

 I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

 

EESignature

0 Likes
Message 5 of 7

JoelMckone
Advocate
Advocate

Thanks - this works however it creates one more question - is there a way to get this information into a form so I do not have to run the rule every time I want to change the size?  Ideally the form would contain basic information such as size, color, glazing and jamb size so the options could all be entered in one location.

0 Likes
Message 6 of 7

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi JoelMckone,

 

Typically we would create a user parameter in the assembly (ex: Length_IAM) , and then include that parameter in the form. Then have a rule in the assembly that triggers on the change of Length_IAM and pushes its value to the Length parameter in all of the parts to be adjusted.

 

If the Form Rule resides in the assembly you could use something this, and Length_IAM would update automatically:

 

Length_IAM = Length_IAM

Parameter("Test_Part1:1", "Length") = Length_IAM
Parameter("Test_Part2:1", "Length") = Length_IAM
Parameter("Test_Part3:1", "Length") = Length_IAM

InventorVb.DocumentUpdate()

 

 

If it is a Global form External rule I think it would be like this, and you'd need an Apply button to run the rule.

(I might be forgetting something, here, working form memory, I didn't verify this)

 

 

 

Parameter("Length_IAM") = Parameter("Length_IAM")

Parameter("Test_Part1:1", "Length") = Parameter("Length_IAM")
Parameter("Test_Part2:1, "Length") = Parameter("Length_IAM")
Parameter("Test_Part3:1", "Length") = Parameter("Length_IAM")

InventorVb.DocumentUpdate()

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 7 of 7

JoelMckone
Advocate
Advocate
Once again thanks - I will give this a try as soon as I can find a bit of time to experiment.
0 Likes