The Naming of Groups is a difficult matter,
It isn't just one of your holiday games;
You may think at first I'm as mad as a hatter
When I tell you, a group must have THREE DIFFERENT NAMES.
-- adapted, with apologies, from The Naming Of Cats by T. S. Eliot;
http://famouspoetsandpoems.com/poets/t__s__eliot/poems/15121
I've never paid a lot of attention to Groups, but I've been looking into them recently, with the intent of using them as hierarchical levels (along with components) in Model Viewer. I've run into some naming issues that may have obvious (or even standardized) solutions, but if so, I haven't found them. So, I'm asking for some Wise Counsel (TM).
In a hierarchy, it's critical to have unique names for the items at each level. So, for example, most OSes don't allow a directory to have more than one item with the same name (including extension, etc). This uniqueness allows the OS to maintain an unambiguous handle (eg, "full path name") for each directory or file in the tree.
SketchUp's naming policies for components and groups are somewhat at odds with this need. It's quite possible, for example, to have 300 groups or components named "chair", all listed within a given level of the Outliner. Any given chair will have its own position. If the chair is a group, it may even have different attributes than other chairs.
The Outliner has no problem with this. It simply lists all of the chairs, using the same name for each one. There is no way for the user to tell which is which, unless s/he takes the trouble of inventing a unique name for each one. The Outliner is also willing to allow multiple instances of a given component to have the same name. In this case, however, the essential attributes (eg, dimensions) must be identical.
My presumption is that the Outliner uses each component or group's unique ID (ie, Entity.entityID) to keep track of the individuals, but this information is only accessible via the API; the UI doesn't appear to present it. In any case, I can't create unique paths out of non-unique names.
I've thought of several ways to avoid or deal with this ambiguity. The simplest solution would be to qualify each otherwise ambiguous item name with the unique ID (eg, "chair #43583"). Alternatively, I could maintain a human-friendly sequence number (eg, "chair #1").
However, before I do anything of this sort, I'd like to know if I'm simply missing something or if there is an existing Best Practice for handling this issue. Suggestions, anyone?
-r