Dear boys and girls, this is my first ever post here! Cakeday in a year ;-)
I am in need for really smart people :-), concerning the functions/scripting in Revit and a special case which I am trying to make.
It's about a (curse, I'm Dutch, I don't know the English terms, but I'll try) wooden truss. The case is this:
- I have a truss consisting of 2 horizontal wooden beams.
- these have to stretch as I pull it in Revit (already works)
- in between them, there a small standing beams (columns) in an array.
- this array nów works as: =length/hoh (hoh, means "heart to heart, so it is the distance between to consecutive standig columns)
- so the 'n', for number of little columns, is length divided by hoh.
- this 'n'works with a ROUNDDOWN. So in total it's: n= ROUNDDOWN(length/hoh).
This works fine, if you find it ok that at the end of the array, there can be a "double" column, whith the last one standing really close to the second last.
BUT, it needs to do something differently. It needs to work as follows:
It needs to divide the total length in equal spaced parts with columns. So the columns must be evenly spread throughout the length, BUT, the HOH (distance between columns) may never be larger than 600mm (or whatever /inches). So the HOH should be between 400mm and 600mm. When we pull the length of the truss, it should still be dividing the columns in even spaces, until the HOH reaches 600, after which the array number should be +1. than the proces should start allover. also while pushing it back in, the array should space evenly, until the HOH reaches the minimum of 400mm (or something like that), which makes the array lose n-1.
So I've tried it out, but I get a circular reference in the function. I cannot seem to logically think it out..
It should be something like: IF HOH>600, THEN N(umber of columns)+1. IF HOH<400, THEN N-1.
But simultaneously it should do: N = Length/HOH.
And thát my friends, creates the inception..
So is there a way around this in which it works? Does anybody know enough Revit code to do this..?
Your help would SOOOOO enourmously be appreciated!
|