# encoding: UTF-8
m = Sketchup.active_model
sel = m.selection
puts "SEL COUNT=#{sel.length}"
sel.each_with_index do |e,i|
  puts "[#{i}] #{e.class} name=#{(e.respond_to?(:name) ? e.name : '')} " +
       (e.respond_to?(:definition) ? "def=#{e.definition.name}" : "")
  next unless e.respond_to?(:bounds)
  b=e.bounds
  puts "    world bbox mm min=(#{(b.min.x*25.4).round(1)},#{(b.min.y*25.4).round(1)},#{(b.min.z*25.4).round(1)}) max=(#{(b.max.x*25.4).round(1)},#{(b.max.y*25.4).round(1)},#{(b.max.z*25.4).round(1)})"
  if e.respond_to?(:transformation)
    t=e.transformation
    puts "    scale x=#{t.xscale.round(5)} y=#{t.yscale.round(5)} z=#{t.zscale.round(5)}"
  end
end
"SEL1"
