# encoding: UTF-8
m = Sketchup.active_model
puts "PATH=#{m.path}"
puts "TITLE=#{m.title}"
puts "MODIFIED=#{m.modified?}"
puts "TOPLEVEL ENTITIES=#{m.entities.length}"
mm = 25.4
m.entities.grep(Sketchup::Group).each_with_index do |g,i|
  bb = g.bounds
  puts "G#{i} name=#{g.name.inspect} layer=#{g.layer.name} hidden=#{g.hidden?} ents=#{g.entities.length}"
  puts "    bbox mm min=(#{(bb.min.x*mm).round(1)},#{(bb.min.y*mm).round(1)},#{(bb.min.z*mm).round(1)}) max=(#{(bb.max.x*mm).round(1)},#{(bb.max.y*mm).round(1)},#{(bb.max.z*mm).round(1)})"
end
m.entities.grep(Sketchup::ComponentInstance).each_with_index do |c,i|
  bb = c.bounds
  puts "C#{i} name=#{c.name.inspect} def=#{c.definition.name} hidden=#{c.hidden?}"
  puts "    bbox mm min=(#{(bb.min.x*mm).round(1)},#{(bb.min.y*mm).round(1)},#{(bb.min.z*mm).round(1)}) max=(#{(bb.max.x*mm).round(1)},#{(bb.max.y*mm).round(1)},#{(bb.max.z*mm).round(1)})"
end
puts "SEL=#{m.selection.length}"
"SURVEY1"
