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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement