by Didier Bur » Sun Jul 21, 2019 11:27 am
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...
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
-

Didier Bur
-
- Posts: 1383
- Joined: Wed Nov 14, 2007 10:07 pm
- Location: Nancy, France
- Name: Didier Bur
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced