Door dynamic open left or right side?



Hello, everybody,

I’m doing my first steps with Sketchup and now I have a problem where I found no way.

I have a cabinet where the door can be opened by clicking.
But how can I now dynamically set whether the door should open to the left or right?



I thought about this a bit - and it’s a tough one!

For a door such as you have pictured, I would give it dynamic open/close capabilities by setting its axis on one of the corners on the hinged side, then using an “OnClick” action such as “animate(RotZ,90,0)” (you might need -90,0"), but that won’t work if you also have a “Hinged: Left/Right” option.

I’d approach it with two doors! Used the “Hinged: Left/Right” option to determine which door is visible (using the “Hidden” attribute and some logic. Give them axis on their hinged side, then use the “OnClick” action to animate a custom variable of the enclosing component - call it something like “Open_Angle” - animate it 0,90, then derive the RotZ for each actual door from the “Open_Angle” attribute. You might have to go through some trial and error to get both doors to swing correctly.

Hope this helps.


Hello sjdorst,

I would just like to move the axes position, but that won’t work with Sketchup.
But the idea of hiding the 2 door was very helpful.

Unterschrank_Tueranschlag.skp (126,1 KB)



just to show that it is possible to do it without hidden elements, door is reversed using a wrapped door within a swing movement by changing leny to a negative value and moving position and rotation sign

reverse swing.skp (55.1 KB)


Great job, thx.


That solution came to me as well as I was falling asleep last night! I thought to add it this morning. But - Lo and Behold! - you beat me to it! :smiley_cat: