Component definition #1

I work for an exhibition company and am in the process of cleaning up our component library. My issue is Sketchup adding #1 to component definitions.

Components are fine when opened on their own and the definition is correct, once imported into a new blank document or working model a #1 is added to the definition.

Looking in outliner it would appear a duplicate component is somehow being created which is causing the issue. I have tried exploding, purging and creating the component again but always end up with the same result. The file is fine when opened but not when added to a working document. It’s driving me nuts!!

I’ve added attached the offending file. I also have a couple of screenshots but cant add these as I’m new to the community
9544 @ 500 e.skp (15.1 KB)

What process are you using to bring the component into the new blank document or the working model? If you are using Import, then it makes sense that you should get this #1 appended. You have a component with the same name as the SketchUp file name. So if you import that component it comes in as a nested component. The parent and the child components cannot have the exact same name so Sketchup appends the number.

Here’s Outliner showing your component imported into a blank SketchUp model file.
Screenshot - 4_28_2022 , 7_13_57 AM

Save your components into a local collection and then bring them into your new or working file from the Components panel. Example: I saved your component into one of my local collections. Then when I bring the component into a new file, it does not come in as nested.
comp

Generally the reason would be that you are importing a component into a model that already has an unpurged component definition with the same name. Deleting components from the model doesn’t remove its definition that would remain in the In Model components definition list unless you purge it.

1 Like

Ha! This must be new. It is a common mistake for people to create a component, save the containing file with the same name and post the file into the 3D Warehouse, creating a recursive reference. Previously this ended in a cryptic error message, sometimes even a crash.

2 Likes

I don’t remember when that changed. I’m not sure if it’s better to let users import components made this way or to prevent them from doing it. Obviously crashing isn’t a good thing.

It’s so much easier to manage creating and saving components into local collections and then using them all from the Components panel.

If that workflow is a mistake, what would be a better approach? Should the file into which a component is “Save As”'d be given a different name from the component-definition’s name (I hope not, that would be non-intuitive)? Perhaps I misunderstand the scenario.

That would be fine if either the user has no need for precision placement, or the user’s model has sufficient inference points to allow SketchUp’s Move tool-like features to place the new instance precisely.

In developing a very complex model, I use multiple SKP files for different “development” portions of the overall model. When a portion is complete, I use the Copy command in the development model file, then Paste In Place within the overall model file to ensure accurate placement. I usually end up with a bunch of “#1” component definitions (such as when re-using common parts, nuts and bolts say). As an alternative to Copy+Paste In Place, perhaps I will remember to try using the Components panel technique, along with reference guides or similar to re-create the desired positioning.

The correct way would be to create the component, right-click on it and use the “save as” function in the context menu. Then, giving the saved file the same name is no problem as there won’t be an additional container layer. I meant that the common scenario (I have made the mistake myself) of starting a new model, creating a component and saving the entire model with the same name as the component is the erroneous one.

There’s absolutely no reason that component placement can’t be precise. Proper placement of the component’s origin and orientation of the axes makes insertion as precise as you want it.

comp

With proper setup it’s easy to swap out components, too.

Or, what I find easier is to open the secondary pane in the Components panel and set it to the desired local collection. Then drag and drop the component thumbnail from In Model to the collection.

1 Like

Thanks for all the replies! I have all my components stored in a folder and access them through the components tab in Sketchup.

It would indeed seem to be down to the file name and the component definition being the same.
I created a simple 1m x 1m x1m cube, created a component called “Cube” and saved it as “Cube” this produced the same behaviour when bringing into a new document.
If I change the definition to Cube 1m3 then all is good, is this the correct behaviour? can we really not have file name and component definition the same??

A component is a (little) SketchUp file, so the answer is no.
It would have to start inserting itself and never stop.
Humans can imagine this, but a computer doesn’t know when to stop.

You can use a group and name that the same as the filename.

I tend to name my ‘working file’ WF_componentname and have all sorts of stuff inside (imported images, notes, preliminary versions, etc)
Then use ‘Save as’ by rightclicking on the final component to save it in a resource folder.

Thanks for the help everyone. This has been driving me crazy for a while now, funny thing is a actually figured out pretty quick that if file name and component definition were different things were OK. If it wasn’t for my OCD tendencies and wanting things named the same I would have saved a lot of effort trying to correct something I couldn’t!!

You could also save yourself a lot of effort by just saving componentsin the normal way so you aren’t creating the unneeded extra level of nesting.

What do you mean by normal way??

The way they designed components to be saved. Either as I described before by dragging the component thumbnail from In Model to the local collection or by right clicking on the component and choosing Save as… Neither of those methods will produce the nesting you are getting by making a component and then using File>Save to save the Sketchup file.

If you were making a bunch of related components to save for later use you could also use the Save as a local collection option from the Details menu in the Components panel

Screenshot - 4_28_2022 , 4_00_11 PM

I am working with a component library stored on a server that myself and others need to use, that would surely mean “save as local collection” isn’t an option? It’s not something I’ve used before so please forgive me if I’m missing something simple.

When I created the previously mentioned test cube earlier I used “save as”

Thanks for your patience DaveR, I thought I had resolved the issue and the method of using different file name and definition works fine. I just want to understand if this method is just a workaround or is Sketchup behaving as intended?