Componenti dinamici

armadio6ante.skp (200.5 KB)

ciao a tutti. chi mi aiuta a capire il problema? cambiando le dimensioni dell’armadio, spesso le mensole non si adattano in altezza se ce la cassettiera.

In English:
Hello everyone. who helps me understand the problem? Changing the size of the wardrobe, often the shelves do not fit in height if there is the chest of drawers.

Thank you

Is this a Sketchup problem or a space management one?

Also, I think you might have a problem with door conflict as drawn:

It’s a dynamic component issue.

Il problema sono le mensole sopra la cassiera al centro o a destra.
Gli sportelli li devo sistemare. Lo so

The problem is the shelves above the cashier in the center or on the right. I have to fix the doors. I know it

What is another Italian or English word for ‘cashier’. It doesn’t make sense to me in this context.

Seems to mean the ‘chest of drawers’.

I can see that it works fine if the drawers are in the left compartment

but not always in the centre or on the right. But oddly, it often worked correctly.

When it doesn’t work, it looks as if the space for the shelves is not being reduced by the height of the drawer unit.

Look at what’s different in the code/formulae for centre and right shelf positions, compared with formulae in the left positions.

E uguale.
Sto impazzendo…

There is something very odd going on. When I change the overall length of the wardrobe, the shelf position changes. There should be NO interaction between the length and the shelf positions.

This works properly when the drawers are in the right side.

But when I change the length to 300, the shelves just ignore the height of the drawer unit.

I look at the formula for the right hand bottom shelf Z position and see this:


And the formula for the variable PolloDx (which translates confusingly as Chicken Right!) which seems to control whether the drawer height is deducted from the space for the shelves) is:


which is evaluating to 0, not 1.

There is a syntax error in this formula - there shouldn’t be a trailing comma here, nor in the corresponding formulae when the drawers are centre or left.

But removing it doesn’t fix the issue.

I don’t understand this formula.

Why is the formula for the left shelf position PolloSx different?


When the option for the chest position is to the left, PolloSx correctly evaluates to 1.

But when it is either centre or right, the corresponding variables evaluate to 0, not 1 as they should.

Something is going wrong here.

Surely the logic should be (in words):
IF there is a chest, AND it is in the left, centre or right position, THEN space the shelves in the corresponding position to leave room for the drawers.

I’ve just noticed that you have defined the PositioneCasseteria to display as Sx, Centro or Dx (Left, Centre or Right),

but to give it it from your list the same value as the shelf Y position + 6 cm.

The test for equality between these two values is failing, even though they contain the same formula.

I would suggest making two separate variables, one for the display value and one for the position of the shelf.

Say PosCass = “Sx”, “Centro” or “Dx” and then testing for string equality, not the matching of two floating point lengths.

Then (for example)

PolloDx =  AND(PosCass = "Dx" , CassettieraSioNo=1) 

and you calculate the position of the drawers separately for each case of the position - left, centre or right.

Left = 8.5
Centre = RipianoCentro!Y + 6
Right = RipianoDestro!Y + 6.

using nested IF statements.

PositioneCassettiera = IF(PosCass = "Sx", 8.5, IF(PosCass = "Centro", RipianoCentro!Y + 6, IF(PosCass = "Dx", RipianoDestro!Y +6)))

The logic works, but for a reason I don’t understand, the PositioneCassettiera calculated apparently correctly, is putting the drawer unit in the wrong position!

However, the space between the shelves is now calculating correctly.

Over to you!

But I’ll keep working on it for a bit longer.

Non sempre restituiscono 0…
Potrebbe essere che a sx la posizione a sx è sempre 8.5, mentre al centro è dx varia inserendo molti decimali??
È molto strano.

They don’t always return 0 …
Could it be that on the left the position on the left is always 8.5, while in the center it is right it varies by inserting many decimals ??
Is very strange.

I think that is the issue - you need to add a tolerance (x is between y +/- some small value)

Ho provato ad aggiungere la formula ceiling per arrotondare, non funziona

I think I have it working now. Here’s the SU 2017 version.

armadio6ante JWM.skp (397.0 KB)

Solo un problema di versione di sketchup??
Ho hai modificato qualcosa?

Just make sure to download the file, then import it into an empty SketchUp file. The version should not be an issue.

Faccio sempre così…
Ma non risolvo

My file was working here. But the first time I uploaded it, it was in v2021 and your profile says you are using v2017 - so I saved it as v2017 for you.

I made two changes, as I described - separated the text list (Sx, Centro, Dx) from the Y position of the drawer set, as I outlined in my post.

But as @TheOnlyAaron says, the version makes no difference to the formulae or the way they work.

If you imported it, you might need to explode it once to see the Component Options.

If you are no longer using v2017 please update your profile.

Sembra ok.
Ma non ho capito cosa hai modificato…
Puoi dirmelo?

It looks ok.
But I didn’t understand what you changed …
You can tell me?
Thank you

Several things changed. These are the main ones:


I should have changed the Display Label from PosCass to Positione Cassettiera.


Hope that helps you understand what I changed.

Sei stato gentilissimo.
Spero di poter ricambiare il favore

You should mark my previous post as the solution.

Grazie mille.