add new ipart when length is over a given value

add new ipart when length is over a given value

joakim.boge
Contributor Contributor
237 Views
3 Replies
Message 1 of 4

add new ipart when length is over a given value

joakim.boge
Contributor
Contributor

Hello. 

 

i have a inventor layout model with ilogic that is controlled by ilogic form where i insert and suppress different parts. And now i would like to add an ipart of a pipe that we use, The  pipe is Ø50 and up to 6000mm long at max. 

 

The layout can sometimes be 8500mm or bigger. ( never under 6000mm)  Normaly i would add the ipart at 6000 and then 2500mm. is there a way to make ilogic add the parts or change length of the parts when the layout changes?  

 

Example: I edit my form of the layout to 15000mm long, and when i press ok, i would like ilogic to add two pipes of 6000mm and one on 3000mm. even better if it was possible to get the lengt of the custom pipe in the properties. 

 

 hopefully you understand what i am looking for. 

 

Best regards Kim

 

 

0 Likes
238 Views
3 Replies
Replies (3)
Message 2 of 4

A.Acheson
Mentor
Mentor

Hi @joakim.boge 

Are you using custom content part for the pipe or is it a library ipart? This sounds like it would be better suited to a custom  content center part or a regular part both driven by ilogic. Custom iparts are difficult to handle via code but it can be done if that is the preferred workflow. You will need to build out the logic for what standard lengths to use and then if exceeded  insert a shorter pipe to this same occurrence and constrain. 

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 4

joakim.boge
Contributor
Contributor

Hello.
I have made a custom iPart that is saved in a custom library in the workspace, not Content Center. How can I do this if I want to do it with a regular part and iLogic? I want the part or parts to have a different part number.

I will try and see how to solve this; I am not the best at writing code.

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor

So a regular part is kind of the same as a custom ipart in that it is saved locally. Custom iparts can be driven from the factory still. 

Driving a part by code is simply a matter of hooking into the parameter driving the length. 

The below assumes the part is just inside the assembly being worked on. 

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

Can you share with us the code you using for changing the parts and at what level the parts are in? 

 

If you are going to be dealing with multiple parts to make up the length the first thing you have to do is make each file unique. This way you can drive each length parameter in isolation and also customize iproperties etc. 

 

If your struggling with the code make bullet points of what the manual steps are. Then start filling in code in the order of these bullet points that replicate the manual task. 

 

 

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