Group By Layer? Is there a plugin?
-
Hi
I have an imported archicad file into SKP and its broken up in layers nicely... but not grouped.
Is there a plugin that can group these layers?
Thanks
S -
I have a Scene that turns off all layers apart from layer zero. If you do the same then you can just step throught turning on each layer one at a time and grouping what is on screen (Ctrl-A then group). If there are entities on layer zero you may need to group and move them to a new layer, as layer zero will keep reverting to default and become visible.
The above assumes you don't have any entities "Hidden" in the scene as they won't be picked up in the grouping process.
So simple it could take longer to write the plugin, but TIG hasn't commented yet...
-
so simple im embarassed i didnt think of it
thnaks for your help!
@arcad-uk said:
I have a Scene that turns off all layers apart from layer zero. If you do the same then you can just step throught turning on each layer one at a time and grouping what is on screen (Ctrl-A then group). If there are entities on layer zero you may need to group and move them to a new layer, as layer zero will keep reverting to default and become visible.
The above assumes you don't have any entities "Hidden" in the scene as they won't be picked up in the grouping process.
So simple it could take longer to write the plugin, but TIG hasn't commented yet...
-
Even entities are on other Layers they are always on the Layer 0! They are just hidden
Layers in Sketchup are only visibility layers, not geometry layers -
Another quick way would be to select an object on a layer and note its layer-name from the open 'Entity Info' window, then context-menu > Select on same layer... context-menu > Make Group... group is selected in the still 'Entity Info' window type in it's name based on its layers.
If you want the group to be on the same layer change its layer in 'Entity Info' too... if you want objects within the group to be on Layer0 then edit the group, Edit>SelectAll [Ctrl+A] and again use 'Entity Info' to change the layer to Layer0...This one liner does that on all active_entities...
m=Sketchup.active_model;a=m.active_entities;s=[];m.start_operation("!");a.to_a.each{|e|s<<e if e.layer==m.layers[0]};g=a.add_group(s);g.name=m.layers[0].name;g.layer=nil;(g.entities.each{|i|i.layer=nil})unless s.empty?;m.layers.to_a[1..-1].each{|l|s=[];a.to_a.each{|e|s<<e if e.layer==l};next if s.empty?;g=a.add_group(s);g.name=l.name;g.layer=l;g.entities.each{|i|i.layer=nil};};m.commit_operation;
Copy/Paste into the Ruby Console + <enter>...
-
And here is a plugin, too: http://www.smustard.com/script/GroupByLayer
-
I have used this plugin for years and it works just fine, but.....
Sometimee it takes forever to group_by_layer.Does anyone know if there is a fastplugin or an other way to group by layer?
Thanks
Jorgensen -
I want to do exactly what Tig described in one of my models. (Anytime I import a survey actually)
In Smustard's plugin posted by Gaieus, the description says the following:
@unknownuser said:
Explodes all groups and components, then regroups all entities by layer
Does Tig's snippet simply run through the selection organizing geometry (edges and faces) by group by layer as described?
Or does it explode whatever it finds first? Because in my model I have some components that I want to keep.
Advertisement