Pattern with Ilogic

Pattern with Ilogic

JalarsenRV66Z
Contributor Contributor
247 Views
1 Reply
Message 1 of 2

Pattern with Ilogic

JalarsenRV66Z
Contributor
Contributor

Hi all,

 

I'm having difficulties figuring out how to approach this models code in Ilogic- can any one point me in the right direction? a guide or similar?

i want to be able to change the length of this assembly, ranging from 2320 to 2600, so i can place it in Factory Design, which we use for our projects. I know how to control length on sub parts from assembly level using Ilogic,

But the Vertical bars on top is added or removed according to length, the 90 between is static and it may differ in the ends from 35-92. If above 92 a bar is added and if below 35 a bar is removed. How would you build this code?

Thanks in advance!

JalarsenRV66Z_3-1665475604498.png

 

 

 

 

 

0 Likes
248 Views
1 Reply
Reply (1)
Message 2 of 2

Zach.Stauffer
Advocate
Advocate

Shouldn't be too hard. If you set the pattern count to a parameter called "verticalBarCount" or something similar, you can do some easy math to figure out how many bars you need. This code will give you a max spacing of 125 at the end of the pattern:

 

'assuming you have an overallLength parameter and verticalBarCount parameter
verticalBarCount = overallLength / 90

Dim remainder as double = overallLength % 90
if remainder < 35 then 
     verticalBarCount -= 1
End if

 

 

0 Likes