# Creating Common Types of Dynamic Components

I have a problem related to a topic illustrated in the User Guides, namely “Repeating a sub-component within a dynamic component (1 Dimension)”. At point 16 it is written “Type =5+COPY*(Fence!spacing+LenX)”, what does the 5 represent?
Thank you

5 is the first position
copy is a read only attribute with a value equal to the copy number
for original this is 0, next 1, then 2,…to N where N = copies

… but 5 has a unit of measurement or not

no need, the default in this case is inches

the formula is read as a value in inches

Sorry if I insist, I write from Italy, so I have to convert inches into cm, what I’m interested in knowing is: the 5" represent the dimension of what? Attribute? or sum of Attributes? or what?

No you can work in cms, you choose at two points as needed, if required

5+COPY*(Fence!spacing+LenX)
let’s assume you are using cm

the original (copy = 0) would evaluate to 5cm
the next would the 5 + the picket(lenx) and the spacing
the second copy = 5 +2 times(picket(lenx) and the spacing)
and so on…

for most if you define the unit then a formula will respect the unit chosen

Ok, now yes, many thanks

The DC units house of cards collapses if the “display units format” box is not checked in Window>Model Info>Units. Bug found about 15 years ago already.

I forgot a clarification: the formula =5”+Copies*(Fence!spacing+LenX) should be inserted in Picket > Position X ?

correct

As the Pickets increase, the TopRail and BottomRail, while not having locked their respective LenX, do not resize automatically. Is there a way for this to happen? Or do you just have to do it manually?

You can set a formula to calculate the LenX for the rails.

I wrote an improved version of the SU simple Picket Fence, which illustrates this:

Fence±+picket.skp (176.2 KB) (SU v2015)

The right hand post is not part of the Dynamic Component, but copied manually.

I was working in inches, but the principle is the same.

Here are the DC options:

The fence length is adjusted by using the Scale tool - only the X dimension is scalable.

The timber sizes are ‘nominal’ sizes - in the UK, normally 1/4" smaller in the actual dimension than the nominal size, because of planing allowance. So a post made from 4" x 4" sawn timber 100mm x 100mm (nominal) would end up 3 3/4" square or approx 94mm square after planing smooth.

USA and Canada have larger planing allowances - normally 1/2" or about 13mm.

In BottomRail (in my case in Italian: TraversaInf) > LenX I inserted the formula you suggested =Fence!LenX-Fence!PostSize (=Recinzione!LenX-Recinzione!PaloDimensione) and it gives me an error