# encoding: UTF-8
m = Sketchup.active_model
out = []
tgt = m.entities.grep(Sketchup::Group).select { |g| g.name.to_s.start_with?("SWD_02_jog30_6T_") || g.name.to_s.start_with?("SWD_03_jog20_6T_") }
out << "삭제 대상 #{tgt.length}개: #{tgt.map { |g| g.name }.inspect}"
unless tgt.empty?
  m.start_operation("잘못 만든 격판 삭제", true)
  tgt.each { |g| g.erase! }
  m.commit_operation
  out << "삭제 완료"
end
won = m.entities.grep(Sketchup::Group).find { |g| g.name == "조립부원판_20260919" }
if won
  b = won.bounds
  out << "흰판 존재: bbox z #{(b.min.z*25.4).round(2)}..#{(b.max.z*25.4).round(2)} hidden=#{won.hidden?}"
else
  out << "흰판 없음!!"
end
g2 = m.entities.grep(Sketchup::Group).find { |g| g.definition.name == "그룹#2" }
out << "그룹#2 자식: #{g2.entities.grep(Sketchup::Group).map { |g| [g.name, g.hidden?] }.inspect}" if g2
puts out.join("\n")
"DELBOGUS"
