Component Copies Naming Problem

I have just noticed what appears to be a bug with the naming of component copies that seems to be happening with the latest release of Sketchup - 26.2.242.

In previous version of Sketchup, if you placed a component into a model where one of the same name already exists, your new component would get the basename plus #1 added to the end. In the current version release in some circumstances (not sure exactly what these circumstances are) when you perform the same operation, the new component has no basename and is just named #1.

This may not be very important issue for the standard user but in more advanced uses, this naming convention change (and I assume that it was not deliberate) breaks a lot of things.

Has anyone else found this problem as of yet?

Ohhhhh. I will have to test today. Last week I was getting really strange material list results when I copied in portions of a framing scheme from one model to another. I thought maybe it was the list plugin I use but this makes more sense as no matter how I adjusted the component definition names came out strange. I manually adjusted in the spreadsheet but that is a PITA at scale and prone to errors.

Hi,

I ran some tests with the “make unique” function, and it seems that if the last characters aren’t letters, they’re removed and replaced with #1.

Since your component is named 54003, everything is removed. If it were named 54003a, the problem wouldn’t occur.

Hmm… interesting and problematic.

@TedVitale_SU I checked the 26.2 Application Release Notes and there is nothing listed about component name behavior changes.

I just tested and if the part/catalog numbers are in parenthesis, then the numeral removal does not happen.

This indicates that a part, stock or catalog number property (separate from the name) would be valuable especially if it were to be displayed prominently in the Components picklist and the 3D Warehouse.

yes, i have had the same problem.

now when a component is inserted in the model using the ruby code “entities.add_instance”, and if a component with the same name already exists in the model, instead of just adding #1 or #2… SketchUp now removes the last characters of the component definition name and then adds #1 or #2 to it …

I changed the ruby code of my extension to avoid this problem:

  • before adding an component instance of a definition
  • i check if there is already one in the model
  • if so, i copy the one that already exists instead on adding a new one in the model

This change in sketchup, that has not been documented, has big consequences when you try to export a bill of materials from a sketchup model, because bills of materials rely upon the name of the components.

:thinking:
It occurred to me that in 2026 they added the Pages #unique_name instance method.

It is possible that changes were made on other similar methods on that time or since:

DefinitionList #unique_name
Materials #unique_name
Layers #unique_name

Maybe it would be worth checking what’s going on with these? And whether there might be a connection with the “native unique renaming”?

How do you copy a component instance? Their class does not have a #copy method (although we have asked for one for years.)

I just made a report on Issue tracker

copy is not the appropriate word

i check if the component definition name already exists

if so i use this definition to add a new instance

	model = Sketchup.active_model
	definitions = model.definitions
	entities = model.entities
    for d in definitions
		#nom_group is the definition name of the component instance i want to insert in the model
		if d.name == nom_group
			#point_cible is the insertion point of the new instance
			point_cible = Geom::Point3d.new(@X, @Y, @Z)
			transformation = Geom::Transformation.new(point_cible)
			ma_definition = definitions["#{nom_group}"]
			# add a new instance
			@composant = model.entities.add_instance(ma_definition, transformation)
			return
		end
	end

There seems to be confusion in this topic about the difference between a ComponentDefinition and a ComponentInstance. So far as I know, SketchUp has never generated or modified ComponentInstance names. And, unless a second copy of a ComponentDefinition is loaded from an external source or a ComponentInstance is made unique, there is no need for a second ComponentDefinition and no need to do anything to the ComponentDefinition’s name.

What am I failing to understand?

UVL_MAPU_Lo_257_La_109 is a component embedding components, and the first instance introduced in the model

UVL_MAPU_Lo_257_La_#1 is the second instance of the component

Sketchup changed automatically its definition name:

  • 4 last characters have been deleted
  • #1 added instead

Does it make the second embedded component introduced a distinct one? i don’t know.

But since i used to split the definition name of each components using the # to edit a bill of materials, now it is not possible because ‘UVL_MAPU_Lo_257_La_109’ and ‘UVL_MAPU_Lo_257_La’ have different definition names

It really looks like you inserted the same definition into the model twice.
But still, this should not be removing any of the definition’s name.

Is there a software developer from Trimble that could respond to this issue? Is it a bug or the intended way forward for the handling of numerical component definition names? If this is the intended way forward for future Sketchup releases then anyone with a components collection based on numbered definition names will need to come up with a workaround…

I pinged @TedVitale_SU but he has not yet weighed in.

This is causing us problems at my company as well. We use generate report for our warehouse packing lists, and have had a few packing errors due to this bug. Do we know if trimble is aware or if there is a workaround please?

There is a bug report about this, SKOR-22033 in our system. I added a link to this topic, so that when there is progress I will know to come back and tell you.

Someone mentioned the work around of not ending the component name with a digit.

this workaround is not realistic is some cases: you don’t always choose the definition name of the component, it already exists and you have to use it (for scaffolding components)

Thanks Colin! Just getting through my email and saw Dans note, Just came here to say we had a bug on file for this issue.