Skip to content

Instantly share code, notes, and snippets.

@thomthom
Created June 16, 2017 13:19
Show Gist options
  • Save thomthom/56316c2108ec9479b6407efed0b53f8d to your computer and use it in GitHub Desktop.
Save thomthom/56316c2108ec9479b6407efed0b53f8d to your computer and use it in GitHub Desktop.
require 'set'
model = Sketchup.active_model
selected = Set.new(model.selection.to_a)
edges = model.selection.grep(Sketchup::Edge)
faces = Set.new(model.selection.grep(Sketchup::Face))
border = edges.reject { |edge| edge.faces.all? { |face| faces.include?(face) } }
selected.subtract(border)
model.start_operation('Interior Erase', true)
model.active_entities.erase_entities(selected.to_a)
model.commit_operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment