How would I write a rule for vertical post placement and number?

How would I write a rule for vertical post placement and number?

chris
Advisor Advisor
311 Views
3 Replies
Message 1 of 4

How would I write a rule for vertical post placement and number?

chris
Advisor
Advisor

I've set up a handrail generator and I'm trying to figure out how to write something that would determine the number of and placement of the vertical posts. (see image)

 

I'd like something that would allow me to access the total length of the shown handrail (One_Side_Length), it would then divide it by 72" and figure out the number has any remainder that it should add another vertical and then equally space all of them from one side to the other.

 

Example:

if the (One_Side_length) was 156" long, then it should know that 156/72=2.166666666, so I'd need 3 verticals, each equally spaced at 52". 

 

I just don't know how to do the rounding and greater than/less than stuff

 

The two variables are:

 

Total Lenth:     (One_Side_Length)

Osha Spacing: (Osha_Spacing)

 

chris_0-1685642711053.png

 

0 Likes
312 Views
3 Replies
Replies (3)
Message 3 of 4

Curtis_Waguespack
Consultant
Consultant

Hi @chris 

 

I think something like this would work. I did this in a part, but you could do the same in an assembly with a pattern.

 

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

 

MaxLlength = 72
iCount = Ceil(One_Side_Length / MaxLlength)
Spacing = One_Side_Length / iCount
Count = iCount + 1

 

 

Curtis_Waguespack_3-1685655642116.png

 

Curtis_Waguespack_0-1685655500282.png

Curtis_Waguespack_2-1685655603335.png

 

 

EESignature

0 Likes
Message 4 of 4

chris
Advisor
Advisor

@Curtis_Waguespack  WOW! this thing works great, doing some tests with it now, but it is doing what I want, thank you so much! HUGE help!!