Skip to content

Instantly share code, notes, and snippets.

@hanpama
Created February 22, 2017 07:40
Show Gist options
  • Save hanpama/2c2534d1085fe5c0af78e51c43aa25c3 to your computer and use it in GitHub Desktop.
Save hanpama/2c2534d1085fe5c0af78e51c43aa25c3 to your computer and use it in GitHub Desktop.
Sketchup Layer Exporter
def export_layer(layer, export_dir)
model = Sketchup.active_model
model.active_layer = layer
model.layers.to_a.each do |e|
e.visible = e == layer
end
model.export(File.join(export_dir, layer.name + '.dae'), {
:edges => true,
})
end
Sketchup.active_model.layers.to_a.each do |e|
export_dir = File.dirname(Sketchup.active_model.path)
export_layer(e, export_dir)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment