Wednesday, April 18, 2007

Arrays Less than 2?

NOTE: Nice... I got the layout adjusted to 820 pix wide. If you use revit, i cant imagine you work on less than 1024x768 anyway...

Recently someone on AUGI was looking to array an element in a family, but the array kept collapsing when the value got pushed down to less than 2. It is unfortunate that Revit will not "store" a dimension between the first element and the hypotehtical second (in case the second goes away) but cest la vie.

This is obviously treaded ground already, and there are much better explanations for how this works. But below is a quickie i used to explain it on AUGI:

Okay, ill go through the steps of what i did, and you can try it unless someone else has an example for you to reverse engineer. Sorry about that, but my home computer is demo version, it wont save.In IMAGE 1:

1. I made Family 1, just the one piece sweep.



2. I made Family 2, and loaded family 1 in to it. Family 1 is then arrayed, and i put in aparameter for COUNT and DISTANCE. I then assigned the param. COUNT to the label of the array. I dimension the First blade to the second, and assign the label DISTANCE to that dimension. (i went bottom to bottom...)



3. I loaded both families in to Family 3, and placed them both, one on top of the other. The parameters are then set as follows, as shown:


F1V: (Yes/No instance) This will control Family 1 visibility. For the formula, input COUNT = 1. Go to Family 1 that you placed, and go to its properties. Click the gray area at the end of the Visible field, and tie it to F1V.

F2V: (Yes/No instance) This will control Family 2 visibility. For the formula, input COUNT > 1. Go to Family 2 that you placed, and go to its properties. Click the gray area at the end of the Visible field, and tie it to F2V.



Now, make a parameter DISTANCE (length) and ARRAYCOUNT (integer). Go to the Properties of Family 2, and click the gray box at the end of the COUNT field, and tie it to ARRAYCOUNT. Also tie DISTANCE in Family 2 to DISTANCE in Family 3.



Make the Formula for ARRAYCOUNT the following: if (Count>1, Count, 2)What that is doing, is saying if the Value input (for COUNT) is greater than 1, use the value input. if its not greater than 1, use the value of 2, so the family doesnt collapse on itself. This wont matter, because the visibility parameter F2V will make Family 2 not present anyway.

**Peek at image 3. It demonstrates how the if statement, and the visibility parameters will behave. If the value is 1 (for COUNT), the if statement will save the arrays geometry by defaulting ARRAYCOUNT to 2. It will not display Family 2 in the project, so this is irrelevant.

When COUNT is greater than 2, Family 2 shows up with the actual value, and Family 1 is hidden.


4. Load Family 3 in to your project.


Now, in the properties of Family 3 (the actual "FAMILY"), you have a COUNT and a DISTANCE. Through the nested families, the ARRAYCOUNT parameter will make whichever one visible that should be, given the conditions.

If you decided to SHARE the families 1 and 2 (under fmaily catagories and settings, at the bottom) when you loaded them in to 3, (see image IN PROJECT).Both Family 3 AND Family (whichever) will schedule if you made them shared. In my opinion, i wouldnt, because Family 3 is your "actual family" and 1 and 2 are just necessary evils. (Thats more an argument about what youre doing though...)



Also bear in mind, much like Parameters DISTANCE and COUNT, any other parameters you wish to be flexible from the project will have to be nested. For instance, if you want to control the width of the Louvers...Family 1 Parameter WIDTH and Family 2 Parameter WIDTH must both be tied to FAMILY 3 Parameter WIDTH through their properties dialogue, before you load Family 3 in to a project. Because Family 3 is the real family.I hope this makes sense...