How do I go about assigning a "maximum spacing" distance parameter to an array in a family? I would like the object to space equally within a given distance, but never more than a certain distance apart from each other.
|
How do I go about assigning a "maximum spacing" distance parameter to an array in a family? I would like the object to space equally within a given distance, but never more than a certain distance apart from each other.
You need to provide the family with a way to resolve the problem.Originally Posted by grav8e
Basically you need something like: If spacing > x then increase array count value by x.
The trick is the count value could be so small that even a single increase is too little to fix the problem. So you might need to nest the logic to work out the. You might also try to work out the spacing based on the width first then use the results to assign values to parameters that flex the array.
Give it a go and let us know how you do.
Hi grav8e
see this and Mr Spot's helpful response... http://forums.augi.com/showthread.php?p=97064#post97064
I might also add this is very difficult to achieve because there is no way to specify how Revit rounds a value.
For instance, say you have a width of 4800mm window and the maximum span for mullions is 1200mm.
You could create a formula to calculate how many mullions to have given this maximum span;
no of mullions = (Width/Maximum Span)+1 (Note: I'd typically use an IF parameter to make sure number of mullions can never equal 1.)
This would give you 5 mullions at 1200mm spacing (+1 because there is one more mullion than the actual panels)
But if your width is 5000mm, the actual number of mullions should be 5.116, revit will round this to 5 and therefore your maximum spacing is now broken.
We need a way of making revit always round up in this situation! I think there is a really awkward workaround, just wish it was a little easier.
Would the following modification of Mr. Spot formula work for you in huge percentage of cases?
Count = Width / MaxSpacing + 1.9999
Notice that I use 1.9999 instead of 1.0 (more 9s works even better)
If Width is a multiple of MaxSpacing then 0.9999 becomes irrelevant because assignment to integer parameter does the round off. Otherwise extra 0.9999 does the trick of not going over MaxSpacing. Besides, unless Width < 0.0001 * MaxSpacing resulting Count is at least 2.
LRaiz,
you lost me there? If i then put in those values sure it won't break the max spacing ever... But it also want give you the most correct answer...
For instance if i then substitute my values from the example before into your formula you would now have 6 mullions when given the maximum spacing you could actually get away with 5...
Sorry if i am confusing anyone.Originally Posted by grav8e
To go about it you would use array to last, then edit the label for the array and add a parameter for the integer. Then go to your family types and add another length parameter for maximum span. (there is no need for this parameter to be associated to any dimension string as it is for the purpose of the above formula only.
HTH.
It appears that I made a wrong assumption that assignment of floating point number to an integer simply drops the fractional part. Experiments seem to indicate that current behavior rounds off to the nearest integer instead. In that case how about?Originally Posted by Mr Spot
Count = Width/MaxSpacing + 1.4999
If MaxSpacing = 1200mm then
Width = 4800mm -> Count = Roundoff(5.4999) = 5
Width = 5000mm -> Count = Roundoff(5.6666) = 6