Thanks TIG for the explanation. I also noticed the "path" and "rename definition" tricks.
BUT what I discovered is the following:
If a component was imported from a path that doesn't exist anymore on you system, even if you rename its definition, Sketchup.active_model.selection[0].definition.name will output the imported SKP file name, and you cannot retrieve the new definition name.
Strange behavior, isn't it...
In fact:
The component definition name is NOT ALWAYS the name of the SKP you imported to use that component:
- import a component, say A.skp, containing a red cube
- select it and type Sketchup.active_model.selection[0].definition.path, you'll get, say c:\Users\TIG\DeskTop\A.skp
- BUT Sketchup.active_model.selection[0].definition.name will output, say: Red cube
- open the A.skp file in Sketchup
- Sketchup.active_model.name will output, say: Red Cube
Sketchup.active_model.name is NOT (always) the same as the SKP file name...