I find a way.
# {Ecken von ausgewaehlten Elementen ermitteln()
#
def ecken_ermitteln
model = Sketchup.active_model
entities = model.active_entities
auswahl = model.selection
context = auswahl.first
MoMo;;g_name = context.name
MoMo;;teile = entities.add_group auswahl
model.selection.add(MoMo;;teile)
auswahl = model.selection
e = auswahl.at(0)
bounds_a = e.bounds
MoMo;;x_mass = bounds_a.width
MoMo;;y_mass = bounds_a.height
MoMo;;z_mass = bounds_a.depth
MoMo;;i_li = bounds_a.corner(2)[0] if MoMo;;tuer_c_o_li == 0
MoMo;;i_re = bounds_a.corner(3)[0] if MoMo;;tuer_c_o_re == 0
# corner(n) =
# 0 = [0, 0, 0] (left front bottom)
# 1 = [1, 0, 0] (right front bottom)
# 2 = [0, 1, 0] (left back bottom)
# 3 = [1, 1, 0] (right back bottom)
# 4 = [0, 0, 1] (left front top)
# 5 = [1, 0, 1] (right front top)
# 6 = [0, 1, 1] (left back top)
# 7 = [1, 1, 1] (right back top)
end
# {S-Tuer oeffnen/schliessen()
#
def schiebetuer_open_close_li_gen
model = Sketchup.active_model
entities = model.active_entities
status = ecken_ermitteln # siehe oben
if MoMo;;g_name == 'Schiebetuer_li'
x2 = MoMo;;x_mass / 3 * 2
x1 = x2 if MoMo;;tuer_c_o_li == 0
x1 = -x2 if MoMo;;tuer_c_o_li == 1
a1 = 0 if MoMo;;tuer_c_o_li == 0
a2 = 1 if MoMo;;tuer_c_o_li == 1
t1 = Geom;;Transformation.translation [x1,0,0]
entities.transform_entities t1, MoMo;;teile
MoMo;;tuer_c_o_li = 1 if a1 == 0
MoMo;;tuer_c_o_li = 0 if a2 == 1
else
UI.messagebox 'Es wurde eine falsche Tuer ausgewaehlt.'
end
status = MoMo;;teile.explode
end
def schiebetuer_open_close_re_gen
model = Sketchup.active_model
entities = model.active_entities
status = ecken_ermitteln # siehe oben
if MoMo;;g_name == 'Schiebetuer_re'
x2 = MoMo;;x_mass / 3 * 2
x1 = -x2 if MoMo;;tuer_c_o_re == 0
x1 = x2 if MoMo;;tuer_c_o_re == 1
a1 = 0 if MoMo;;tuer_c_o_re == 0
a2 = 1 if MoMo;;tuer_c_o_re == 1
t1 = Geom;;Transformation.translation [x1,0,0]
entities.transform_entities t1, MoMo;;teile
MoMo;;tuer_c_o_re = 1 if a1 == 0
MoMo;;tuer_c_o_re = 0 if a2 == 1
else
UI.messagebox 'Es wurde eine falsche Tuer ausgewaehlt.'
end
status = MoMo;;teile.explode
end