1) Start a new model in SU2023
2) Take a component definition (cdef), for instance the Heather component, with name Heather
3) Change its name via cdef.name = 'Fredo'. This works fine. The component shows the name Fredo
4) Perform an UNDO. The component gets its original name back (Heather).
5) Redo the change of name cdef.name = 'Fredo'. The component receives the name Fredo#1.
The issue is that there is NO way to correct the definition name via the API from now on.... The name Fredo is supposed to be used for as long as the model is opened.
Strangely, you can correct the name manually in the Component panel, as shown at the end of the video.
It seems that the table for Unique definition names is not restored to its previous state when you do an UNDO. So, the name 'Fredo' is still in the table and you therefore get a name with a suffix when you try to assign it. This also happens if you re-assign the same name to a component definition: on Heather component, cdef.name = cdef.name will result in the component being named Heather#1...!
More generally, the method cdef#name = <new_name> has a strange behavior, trying to make the new name unique, even if the new_name is not used in the model. The correct behavior would be to check if there is already a definition with the specified in the model. If not, then should be accepted.
1) Start a new model in SU2023 2) Take a component definition (
cdef
), for instance the Heather component, with name Heather 3) Change its name viacdef.name = 'Fredo'
. This works fine. The component shows the name Fredo 4) Perform an UNDO. The component gets its original name back (Heather). 5) Redo the change of namecdef.name = 'Fredo'
. The component receives the name Fredo#1.See video attached for illustration
https://github.com/SketchUp/api-issue-tracker/assets/57754157/ab0ccf52-cc65-4cd0-b662-7f6e09efe247
The issue is that there is NO way to correct the definition name via the API from now on.... The name Fredo is supposed to be used for as long as the model is opened.
Strangely, you can correct the name manually in the Component panel, as shown at the end of the video.
It seems that the table for Unique definition names is not restored to its previous state when you do an UNDO. So, the name 'Fredo' is still in the table and you therefore get a name with a suffix when you try to assign it. This also happens if you re-assign the same name to a component definition: on Heather component,
cdef.name = cdef.name
will result in the component being named Heather#1...!More generally, the method in the model. If not, then should be accepted.
cdef#name = <new_name>
has a strange behavior, trying to make the new name unique, even if the new_name is not used in the model. The correct behavior would be to check if there is already a definition with the specified