@cadfather said:
> def matrename
>
> Sketchup.active_model.start_operation('Rename Materials',true); Sketchup.active_model.materials.each_with_index { |m,i| m.name = "- #{'%03d' % i}"; p m.name };Sketchup.active_model.commit_operation
> end
>
> if( not file_loaded? "TT_materials_renamer.rb" )
> UI.menu("View").add_item("Materials Rename") { matrename.new }
> file_loaded("TT_materials_renamer.rb")
> end
Great! Thanks!
One thing that would be really interesting would be that this script index materials application in areas with higher per square meter first. Thus, a material that was on all the walls would be in first place. A material that was in small areas (a decorative object for example) would be the end of the numbering.