Skip to content

Instantly share code, notes, and snippets.

@madeindjs
Created December 9, 2016 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madeindjs/7bd8c47fd06e753408dd6d4e00054e56 to your computer and use it in GitHub Desktop.
Save madeindjs/7bd8c47fd06e753408dd6d4e00054e56 to your computer and use it in GitHub Desktop.
A Sketchup script to do boring stuff tu improve my 2015 library to 2016
# Edit materials
Sketchup.active_model.materials.to_a.each do |mat|
case mat.name
when / Ext/
Sketchup.active_model.materials.remove(mat) unless mat.deleted?
when / Int/
mat.name = "! Int"
when "! RAL 7012"
mat.color = Sketchup::Color.new 87, 93, 94
mat.texture = nil
when "! RAL 7042"
mat.color = Sketchup::Color.new 142, 146, 145
mat.texture = nil
when "! Teintage des vitres"
mat.color = Sketchup::Color.new 255, 255, 255
mat.texture = nil
end
end
Sketchup.active_model.definitions do |definition|
definition.name.gsub! "Joue", "Cheek"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment