# Why does this work?

#1

Hi All,

I’ve been creating a simple stud wall panel that has three pre-determined heights 2.4m (2.44m), 3m (3.04m) and 4m (4.04m).

When increasing the height the nogin component repeats in the Z direction correctly using the following.

nogin z position

=(((copy+1)/(Copies+2))*StudwallPanel!WallHeight)-StudwallPanel!NogginHeight/2

Behaviors

Hidden =StudwallPanel!WallHeight<100
Copies =Floor(StudwallPanel!WallHeight/80)-1

I copied these formulas form a lynda course tutorial on sketchup components for a bookcase and just altered the numbers slightly as a trial and error process (100 & 80)

but what do these numbers mean?
The spacing between noggins a would like is roughly 347mm

Please can anyone explain these formulas, so I can use them correctly in the future.

Many Thanks

test wall.skp (158.8 KB)

#2

To reverse engineer a dynamic component it helps to write out the formula and fill in the numbers to see what is happening.

Here is the Z position of the noggin component and shows how the number of copies correlate to the position.

Try writing some out yourself and filling in the blanks (StudwallPanel!WallHeight) and it should start making sense.

I think this is correct.

#3

Wow, thank you very much for the indepth explanation.
You made all it very clear, which has helped tremendously.
Can I just ask do you think the “hidden” behavior is actually doing anything?
I copied it over from a previous the previous tutorial, but I’m not sure it’s needed

Many Thanks