Can model parameters trigger an add component?

Can model parameters trigger an add component?

IlatVBKUW
Explorer Explorer
481 Views
5 Replies
Message 1 of 6

Can model parameters trigger an add component?

IlatVBKUW
Explorer
Explorer

Hi guys I’m especially new to ILogic and I have a question. I have a sketch that is a simple rectangle with two model parameters-simply the width and length dimensions of the rectangle. I want to be able to automatically bring in components that are controlled by both model parameters. For instance if the sketch is a 32’ by 24’ rectangle, I would like for 4 of the same components to automatically be added, 2 at 32’ length and 2 at 24’ length. I see that after running the add component rule, you can bring your part into the assembly. I’m trying to see if my model parameters can be detected and automatically add those parts into the assembly. That way I can modify the shape of the sketch(maybe creating 4 or 5 model parameters), and potentially, automatically add more parts to my assembly.

0 Likes
Accepted solutions (1)
482 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

Hi @IlatVBKUW 

If you assembly contains the parameter as local parameters then yes, if not then you will need to target the part the parameter is in by using the Parameter function. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

IlatVBKUW
Explorer
Explorer

Thank you! I think I understand and appreciate your response. Do you think you could maybe direct me to a simple code for that? Here are some of my thoughts with screenshots. Here is an example of a rectangle sketch, sketched in the assembly, with the dimensions in the model parameters. The second picture is my goal, I would like to increase the number of dimensions in the sketch, and those new parameters trigger an automatic add component so that I can get a larger multitude of walls dependent on the sketch.

The code in the rule I have in my screenshot is obviously not runnable, but I’m trying to illustrate what I would like to do I just don’t know how to code for it. Thank you!

0 Likes
Message 4 of 6

A.Acheson
Mentor
Mentor

If your looking to drive the part parameter from the assembly parameter you can use the parameter function shown here. This way the occurrence name is used to target the parameter to change. 

 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 6

IlatVBKUW
Explorer
Explorer

Understood, I think instead of driving the part parameter from the assembly parameter, I am in a way thinking to “summon” parts into my assembly automatically, by adding parameters to the sketch in my assembly. I’m thinking the add component rule is in the ballpark I just wonder if I can write a rule to add a new component to the assembly whenever it notices a new parameter in the sketch?

0 Likes
Message 6 of 6

A.Acheson
Mentor
Mentor
Accepted solution

Really that level of automation would be difficult to achieve with out an addin and even then it would be difficult. You can loop through sketch parameters via the Inventor API yes but what code would be associated with these new parameters? Usually you know what the parameters are and then you associate the adding of objects based on these parameters.

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan