inner = [[211.304795230314, 59.3387335473855, 144.121274015103], [198.016313479612, 93.8459200290483, 144.121274015103], [198.016313479612, 93.8459200290483, 209.586476052542], [211.304795230314, 59.3387335473855, 209.586476052542]]
outer_right = [[123.368393800971, 287.689711452616, 222.214015434512], [124.599206984753, 284.49356753989, 222.214015434512], [124.599206984753, 284.49356753989, 7.04087985299685], [123.368393800971, 287.689711452616, 7.04087985299685]]
outer_bottom = [[123.368393800971, 287.689711452616, 0.0], [123.368393800971, 287.689711452616, 7.04087985299685], [124.599206984753, 284.49356753989, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685], [280.16221708339, -119.468442554957, 7.04087985299685], [280.16221708339, -119.468442554957, 0.0]]
outer_left = [[278.931403899616, -116.272298642254, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [280.16221708339, -119.468442554957, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685]]
outer_top = [[121.306929034951, 293.042869957925, 227.414539710024], [201.765305442185, 84.110634448818, 323.731055308166], [282.223681849419, -124.821601060289, 227.414539710024], [282.223681849419, -124.821601060289, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [278.931403899616, -116.272298642254, 222.214015434512], [278.931403899616, -116.272298642254, 227.414539710024], [201.765305442185, 84.110634448818, 314.768300386351], [124.599206984753, 284.49356753989, 227.414539710024], [124.599206984753, 284.49356753989, 222.214015434512], [123.368393800971, 287.689711452616, 222.214015434512], [121.306929034951, 293.042869957925, 222.214015434512]]
# place bounding faces
temp_group = Sketchup.active_model.entities.add_group
outer_right_face = temp_group.entities.add_face outer_right
temp_group.explode
temp_group = Sketchup.active_model.entities.add_group
outer_bottom_face = temp_group.entities.add_face outer_bottom
temp_group.explode
temp_group = Sketchup.active_model.entities.add_group
outer_left_face = temp_group.entities.add_face outer_left
temp_group.explode
temp_group = Sketchup.active_model.entities.add_group
outer_top_face = temp_group.entities.add_face outer_top
edges=temp_group.entities.grep(Sketchup;;Edge)
temp_group.explode
###
edges.each{|e| e.find_faces if e.valid?}
# place a textured inner face
temp_group = Sketchup.active_model.entities.add_group
inner_face = temp_group.entities.add_face inner
temp_group.explode
( material = Sketchup.active_model.materials.add("Red") ) unless material=Sketchup.active_model.materials["Red"]
material.color="Red"
# make 'red' once only
inner_face.material = material
###
# inner_face.erase! ### alternative
# inner_face has lost it's material
puts inner_face.material
This works.
It adds a face within the overall form too.
The 'window' is colored after the explosion.
Note how I also only make a 'Red' material once.
You could erase the 'window' instead of making it 'Red'...
The order of operations and exploding groups affects the result, but knowing that you can avoid it.