Hi TIG, sorry I should have been more clear. I always import components, from my component library, in the component browser. I save them here, too.
To explore the issue further, I tried importing a component(definition name:spectacles), to a file which already had this definition nested within a component(definition name:spectacles display). It was appended to spectacles#1.
To remedy this, I tried repeating the process, but reloaded the spectacles nested within the spectacles display (via right clicking them in the outliner), to ensure they were exactly the same component. They appended again .
As a last attempt, I repeating this process, but saved the spectacles display component, after reloading the nested spectacles, in order to prompt SU to update, before I imported the spectacles, which this time were not appended .
So I guess it's about being diligent & making sure SU is updated, unless there's anything i'm missing???
Secondly, I'm new to coding, would you put:
model.definitions.load('fullpathtoskpname.skp')
in place of "defn" in your second snippet?
Cheers