When component instances equals component definitions

I’m looking at a model for someone, that is extremely demanding even though it’s only 60 MB. There are over 500,000 faces, but the thing that seems most odd to me is that there are over 10,000 component definitions. And, the number of component instances is exactly the same number. Model Info, Statistics, Purge Unused, doesn’t change those numbers.

I tried CleanUp and a Purge extension, they didn’t have very much to fix. When the model first opened it had some things that SketchUp wanted to fix, and when I asked for the Details, the text of the details was so much that it locked up SketchUp. Also, showing the components panel (I’m on Mac by the way) locks up SketchUp, and never appears.

Just opening the model in SketchUp 2018 can take about 40 minutes.

I can’t upload the model, it’s not mine to share, but on the general question of that many components, and every one of them being unique, is there any extension that could replace all identical unique components with just one of them? Or any other thoughts about how you could easily get to have over 10,000 unique components.

Select all components, right click on one in the component browser and select replace selected. No plugin needed.
Mind you it will take forever to open the component browser with 10,000 components.

1 Like

That sounds like it would work for 10,000 components of the one single component, but suppose there are 100 unique components and 100 instances of each. And I don’t know what the components look like (because I can’t open the components browser). What then?

ps, I should give the components browser the same 40 minutes to succeed that I gave the model in opening it.

Use Thomthom’s Groups 2 Components to select only the specific instances and replace them with one, repeat 99 times.

Such a tool is a part of his SelectionToys too.

1 Like

Cheers @Cotty I always get that confused.

1 Like

@colin, since you say that (after a sizable delay) you can open the model, perhaps you could provide some additional insight as to the nature of the model without resorting to the component browser or outliner, both of which are going to be incredibly sluggish.

When you view the model do you see large numbers of repeats of what appear to be the same objects? Is everything a component instance, or are there also loose edges and faces in the model? For example a large building might have a lot of identical windows or a performance venue might have thousands of identical chairs. If you select a couple of seemingly identical objects, does Entity Info show anything different about them other than their Component definition, such as layer, instance name or advanced attributes? Without resorting to some Ruby, one can’t see whether the model has other kinds of attribute dictionaries attached to objects, but that would also be valuable to know.

I ask because the only way I can imagine such a model coming to be (without someone dying of fatigue and boredom) is if it was created by some automated mechanism that either has no concept equivalent to SketchUp’s components or that for some reason thinks each object has one or more unique non-geometric properties. The answers are relevant to “fixing” the model in SketchUp because you may risk losing distinctions that were originally important if, for example, you bulk replace a mass of unique components with multiple instances of a single component.

Also, the suggestions above all glibly rely on the assumption that you can somehow select the existing instances you think are equivalent. Unless all the equivalent instances use the same distinct layer, I don’t think ThomThom’s tools provide a way to accomplish that. That is, they don’t have any “select all instances of component definitions whose internal edge and face geometry is identical”. Unless the similar objects are spatially organized separately from all others, it will be terribly tedious to try to select them one-by-one.

I can conceive an algorithm that would identify geometric duplicates and unify them as instances of the same component (though numeric precision effects might be an issue depending on how the locations of vertices were originally generated). Implemented in Ruby there is the risk that it would take a very long time, though!

Sounds like an export from Revit.

Quite possible. It’s a large warehouse, or something like that, with no walls but lots of beams.

are all the origins set at a global 0,0,0?

ifc, and some other formats uses that as the basis for component geometry positions…

it uses the naming conventions to tell it there are multiple, identical components…

it is a pita to manually change all the axes and find common items…

even with a ruby script it take a long time…


Some information that may help, here is a typical definition in Entity Info:


Also, going into any component shows that its bounding area goes from where the geometry is, to the other side of the global origin. All components have an origin that is at the same location as the global origin. Exploding and making a new component makes it more normal.

Check this thread:

Glibly really? Colin said ‘100 unique components and 100 instances of each’, Thomthom’s tools will select all 100 of those instances no matter what layer they are on, no glib needed.:slightly_smiling_face:

Well, first of all his original statement was that there were 10000 instances each of its own unique component, with no information about how many are geometrically identical. I admit I’m not an expert, but I don’t see something in TT’s tool that is helpful for that case. And even if it was 100 instances each of 100 different components, doing them one at a time would be pretty tedious!

1 Like

If you are able to select all 10,000 components, which can be done in several ways, you can exchange all of them for one. Not quite enough info in the OP to determine if they are 10,000 unique but identical or a mixture. I gave an answer for 10,000 unique identical.
Yes 100 by 100 would be tedious which is why I said, repeat 99 times.

1 Like