api-issue-tracker
api-issue-tracker copied to clipboard
Model#PlaceComponent modifies the GUID of the definition
I notice that Model#place_component(cdef) modifies the GUID of the definition.
Is there any reason for that, noting that this is NOT the case for:
- The manual placement of a component from the Component Browser via drag&drop
- the method
Entities.add_instance. - the Copy / Paste of instance
- the Move/Copy to create a new instance
This is an issue becauae the GUID of a definition is an indicator of whether a component definition has been modified.
The documentation says:
The guid method is used to retrieve the unique identifier of this component definition. The guid changes after the component definition is modified and the component edit is exited.
I'm not able to reproduce this:
model = Sketchup.active_model
=> #<Sketchup::Model:0x000001756e6ef9f8>
d = model.selection.first.definition
=> #<Sketchup::ComponentDefinition:0x000001757f0932b0>
d.guid
=> "8e697fce-c1a5-437b-8f07-278b9ab43973"
model.place_component(d)
=> #<Sketchup::Model:0x000001756e6ef9f8>
d.guid
=> "8e697fce-c1a5-437b-8f07-278b9ab43973"
Maybe you have some observer or something that trigger in that particular case? Can you try without any extensions/scripts enabled?