Rename Group or Component Based on Geometry Name
-
@dave r said:
I don't know how you went about creating this model but you're using layers incorrectly. Geometry should be on Layer 0. Only groups and components get assigned to other layers. The edges and faces inside the groups and components remain on Layer 0. To make it even worse in your model, the faces are on different layers than the edges.
It is modeled this way because of how it was imported. In fact the following attachment is how sketchup imports the DXF from a program called SolidBuilder. I used an addon from smustard that groups geometry by layer which works pretty well except the whole naming convention. I agree with you on what you are saying and would like to somehow get it to that. If there is a better way to turn the geometry into groups or components I am all ears. Any help is greatly appreciated! Thanks!
-
add the dxf, the plugin has ruined any easy chance of obtaining a better outcome...
john
-
The layer issue in the second file would be easy enough to fix but it's all loose geometry and it would be very tedious to fix the loose geometry. The extension you used to group the geometry doesn't help you use the proper workflow.
TIG made a plugin that will move all geometry back to Layer 0 where it belongs but your groups are all on Layer 0 so they would need to be moved to other layers if that's what you want.
Frankly, I think you'd be better off with components instead of groups. You could have a more efficient workflow if you were using components
-
I have a similar need when importing from a program called Softplan.
Rick Wilson was the original author of group by layer.....SD Mitch added some lines of code to that plug (now called layers to groups) in so it would first group by layer.....then consolidate the "like named" layers....then put all geometry on layer zero.IDK the SOP for sharing plug in w/o authors permission (though Rick Wilson allows for it's modification/distribution as long as copyright remains)
Anyhow....see attached file.......took about 1.5 seconds for Layers to groups to sort it all out.
C
-
attached us a copy of the DXF note that its scale is off by 1/12 but is easy enough to fix. Frankly it doesn't matter if it is groups or components or if the geometry is on layer 0 or not because all I need is a material takeoff from cutlist and I am done with the model. I would like each stud to have the layer name so in the cutlist I know what wall it belongs to and if its a stud, cripple, jack etc. Even if there was script to rename a group based on any one of its underlying geometry would work.
-
I started playing with this question as an exercise of Ruby API programming. On the surface, it is pretty easy to do. But when you look closer, the question is an excellent illustration of why the standard advice is to leave all edges and faces referencing Layer0. In this model, none of the edges and faces do so, and this causes issues in the attempt to convert geometry into groups or components! I realize the abuse is a result of the way the model was constructed in CAD before import, but nonetheless it shows the kind of things that happen.
To be more specific, an edge or face can reference only one layer. When, as in your model, the layers have been employed to identify objects, wherever two such objects touch their shared edges and faces can reference only the layer for one or the other object. So, if you turn off visibility for all except one layer, you get strange effects as shown in the attached images, where edges are missing from the faces they border and faces are missing from what should be a continuous surface. The geometry that references a particular layer does not form a SketchUp solid! This happens because the associated edge or face references a different layer than the one for the rest of the object.
In this specific context, it means that it is much more complex for a conversion tool to find and fix these defects while creating groups or components from the geometry that references a particular layer. Every object will have missing edges and/or faces as illustrated (because they all touch at least one other object), and the tool would have to understand this to find and collect copies of the missing parts into the assembly for each object.
-
Thank you @slbaumgartner for your in depth review, I think I may of noticed some of those issues in prior imports. The good news though is that my end goal in this is to use a add on called CutList which has been working wonderfully even with the problems you mention. The problem is that cutlist names every group as group 1, group 2, etc. I was hoping to rename the groups based on the geometry layer name solely for cutlist results, that way the builder knows what they are cutting for what wall. Again I do not care about the correctness of the model since I have already verified that cutlist works just as I would like regardless of those issues mentioned. Thank you.
-
I downloaded the GroupByLayer.rb from Smustard and looked at the code. It would actually be quite easy to modify it to apply the layer name to each of the groups it creates (and also to bring it in line with modern coding practices which it badly violates - it hasn't been updated since 2006!), but the Smustard general EULA expressly forbids altering any downloaded files and the extension's source code does not provide a more lenient license. I don't know how to contact the author, Rick Wilson, as he doesn't provide any info in the source. But if you can reach him, he might be able/willing to make this simple change or to grant permission for someone else to make it.
-
info@smustard.com is ricks email. I emailed him already and said he would look at it when he gets time, but i havnt heard anything yet. I will email him about this and see his thoughts, i appreciate you looking into that though, big thanks.
-
I didn't read the whole thread here but there is a "Rename by Layer" plugin in Sketchucation that is very helpful for bulk renaming groups and/or components. (It also renames by selection and other methods...)
-
I have tried the rename by layer but the problem is that once all the geometry is grouped the layer of every group becomes Layer0. But thank you I can see some other cases where that would be useful.
-
Ok so the author of that addon rick got back to me and updated the script and it works exactly how I need it. Thank you everyone for your help, if you need the pluggin make sure you visit smustard.com for a list of there wonderful extensions. Rick also wanted to convey his appreciation for honoring the EULA. Thanks again everyone.
Advertisement