Created
February 22, 2017 07:40
-
-
Save hanpama/2c2534d1085fe5c0af78e51c43aa25c3 to your computer and use it in GitHub Desktop.
Sketchup Layer Exporter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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