Variable Feature To Edge Spacing with set Pattern Spacing

Variable Feature To Edge Spacing with set Pattern Spacing

amarinXG8V6
Advocate Advocate
386 Views
2 Replies
Message 1 of 3

Variable Feature To Edge Spacing with set Pattern Spacing

amarinXG8V6
Advocate
Advocate

Hi Everyone,

 

I'm trying to create a pattern in a component that is driven by the overall length of the part, max spacing of the pattern and a variable offset from edge condition. I understand how to create simple ilogic code with parameters that have a variable spacing between features with a constant offset from edge condition. See screen shot below of what I know how to do.

 

amarinXG8V6_0-1650063747193.png

 

I would like to write some ilogic code that allows me to have a variable offset from the edge of a part with a constant spacing. I want the count to be determined based on the overall length of the part, the spacing between features would be a set value stored in a parameter (like 24") but I want the offset from the edge of the part to be a variable with a set minimum value that it can be. I also need the offset from the edge of the part to be the same on both ends of the pattern. What would that code look like? Screen shot below is what I would like to be able to do.

 

amarinXG8V6_1-1650064225807.png

 

0 Likes
Accepted solutions (1)
387 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

If (Length - 2 * MinOffSet) Mod Dst = 0 Then
	Cnt = (Length - 2 * MinOffSet) / Dst +1
Else
	Cnt = Ceiling((Length - 2 * MinOffSet) / Dst)
End If
Offset = (Length - ((Cnt -1) * Dst)) / 2

where Parameters are:

- Length is the Extrusion length

- MinOffSet the minimum offset from part edge

- Cnt the count off holes

- Dst the distance between hole centers


R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 3 of 3

amarinXG8V6
Advocate
Advocate
@Anonymous,

This worked great! Thank you for the help.
0 Likes