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.
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.
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.
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.
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.
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.
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
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âŚ
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)