Edges, faces, etc to layers
-
I know what I am asking for violates one of the cardinal rules of SU. I do model with all objects (edges, faces, etc) on layer 0 with groups and components on appropriately named layers.
I also work with Revit and have the need to control visibilty of the imported SU objects. I can bring the layers from SU into Revit but cannot play with visibilty because all the actual edges and faces are on layer 0.
Is there a plugin which will take all the objects (edges & faces) within a group or component and put those objects on the groups layer. This would only be used in a copy of the model which would be saved for the Revit export.
Any ideas?KrisM
-
That works like a charm. This will save me a lot of tedious work. Thank you.
KrisM
-
@krism said:
I know what I am asking for violates one of the cardinal rules of SU. I do model with all objects (edges, faces, etc) on layer 0 with groups and components on appropriately named layers.
I also work with Revit and have the need to control visibilty of the imported SU objects. I can bring the layers from SU into Revit but cannot play with visibilty because all the actual edges and faces are on layer 0.
Is there a plugin which will take all the objects (edges & faces) within a group or component and put those objects on the groups layer. This would only be used in a copy of the model which would be saved for the Revit export.
Any ideas?KrisM
This works from the Ruby Console on a selection of components or groups.
mod = Sketchup.active_model ent = mod.entities sel = mod.selection sel.each{|corg| ents = corg.entities if corg.class==Sketchup;;Group ents = corg.definition.entities if corg.class==Sketchup;;ComponentInstance ents.each{|e| if e.class==Sketchup;;Edge || e.class==Sketchup;;Face e.layer = corg.layer end } }
or this from the context menu when you right click on a component or group
unless file_loaded?(__FILE__) mod = Sketchup.active_model ent = mod.active_entities sel = mod.selection UI.add_context_menu_handler do |menu| unless sel.empty? || (sel.first.class != Sketchup;;ComponentInstance && sel.first.class != Sketchup;;Group) menu.add_separator menu.add_item("Move Entities To Comp/Group Layer") { corg = sel.first ents = corg.entities if corg.class==Sketchup;;Group ents = corg.definition.entities if corg.class==Sketchup;;ComponentInstance if ents ents.each{|e| if e.class==Sketchup;;Edge || e.class==Sketchup;;Face e.layer = corg.layer end } end } end#unless sel end#do file_loaded(__FILE__) end#file
Advertisement