Forums >> Revit Building >> Technical Support >> Formulas
|
|
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
I have been creating this ladder and I'm stuck on how to get a formula to work right for me. I have the ladder created and everything works fine except I need a formula to keep my rungs at a MAX. 12" apart when the ladder changes lengths. I need the bottom rung to constantly be at 12" and the top rung to be constantly at the top of the ladder rails and the intermediate rungs to infill the rest of the space no greater than 12".
Edited on: Mon, Jun 4, 2012 at 11:22:41 AM
|
This user is offline |
View Website
|
 |
|
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
BUMP
No ideas?
|
This user is offline |
View Website
|
 |
active
Joined: Wed, Oct 7, 2009
654 Posts
 |
Just take the distance between your top and bottom rungs (there are a couple ways of doing this), divide by your max spacing, then add 1 (to account for one of the ends). This needs to be an integer parameter.
That's the minimum you need to do, and should work for you. There are things you can do to check if the formula is rounding down instead of up, and to make sure you don't accidentally make the formula end up less than 2
(if that happens it will break the array). I don't have time at the moment to go into any more detail, let me know if you can't get it figured out and I can post a similar family I have made.
|
This user is offline |
|
 |
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
I'm still not sure where I am going wrong with the family. I must still be missing something that you are saying or still not writing my formula right. I took out the bottom rung that I wanted to be constantly at 12" because I really dont need it so not it can just be divided equally with the rest of the rungs. For some reason I still cannot get it to add a rung when my rung spacing gets larger than 12". I attached my newest family so you can see what I have done. Hope you can help. Thanks!
|
This user is offline |
View Website
|
 |
active
Joined: Wed, Oct 7, 2009
654 Posts
 |
I don't have 2013 yet, so I can't open your file. I've attached a simple family I just put together that shows how to do it.
If you want, I can explain how to check for odd rounding problems with the formula, and how to fix it. It's not strictly necessary though.
|
This user is offline |
|
 |
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
I attached a screen shot of my paramaters, maybe that will help. It's adding a rung to my Ladder Rung parameter but not to the Numer Of Rungs parameter. I'm sure I'm missing something small. There wasn't a family attached to your post.
|
This user is offline |
View Website
|
 |
active
Joined: Wed, Oct 7, 2009
654 Posts
 |
D'oh. Forgot to attach it.
ETA: Looking at your fomulas, I'm not seeing anything wrong. Are you using number of rungs instead of ladder rung in your array?
Edited on: Wed, Jun 6, 2012 at 9:50:55 AM
|
This user is offline |
|
 |
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
That wont quite work for me. at 8' the rungs should be 12" same for 9', 10' etc. but never exceed 12"
|
This user is offline |
View Website
|
 |
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
I was using NUMBER OF RUNGS for my array parameter, I changed it to LADDER RUNG and it breaks when I go 6'-5", 6'-4", 6'-3", 6'-2", 6'-1" but fine for 6'-6" and above (6' being and example, same for 3',4' etc)
Edited on: Wed, Jun 6, 2012 at 10:00:06 AM
|
This user is offline |
View Website
|
 |
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
My problem is that I cant get it to roundup to always keep the larger number so it adds a rung
|
This user is offline |
View Website
|
 |
|
active
Joined: Wed, Oct 7, 2009
654 Posts
 |
Ok, here is a family I made that has a nearly identical problem. It is a family that spaces table legs at a user-specified spacing. The biggest difference between this family and yours is I also have a parameter to turn off the auto-spacing and let the user manually specify the number of legs, but you should be able to ignore that. Also attached is a .txt file that explains how it works.
|
This user is offline |
|
 |
site moderator|||

Joined: Fri, Nov 12, 2010
1749 Posts
 |
That was really helpful! I am so close! My only problem now is that in your you know that your Leg Offset will be 3 7/8" on both sides and your array infills in between that. For mine I know that my array will start at the top of the ladder rails (its aligned and locked there) and go down to the floor at the rung spacing provided which I can do. My problem is having it stop one rung space short of the floor and that space will constantly change with the rung spacing.
|
This user is offline |
View Website
|
 |
active
Joined: Wed, Oct 7, 2009
654 Posts
 |
Do something similar to what I did. If your top and bottom offset you can just use '(Height - 1'-6")' instead of 'Height' in your formula (assuming 12" at the bottom and 6" at the top), or if you want them adjustable use '(Height - Bottom Offset - Top Offset)'. That will give you the distance between the top and bottom rungs instead of the overall height.
You may even be able to use a reporting parameter between the two ref planes. I'm not sure about that, I haven't played with reporting parameters at all. If that works I would do that, it would be much simpler.
|
This user is offline |
|
 |
 |