Yes, Dan, I’ve seen it.
There is a little "issue" there:
folder.parent.remove_folder(folder)
the #parent
method is undocumented…
But this is minor…
From now on, I’m really sorry, I hope you don’t take it personally because I’m not talking against you Dan, or anyone else, I’m just letting off steam…
In fact, it was one of the reasons I looked down the rabbit hole. In other words, I dug into the pitfalls of studying the Sketchup::LayerFolder
.
The other - main - reason, the second comment in the referenced issue #844:
“Folder names can have duplicate names per design.”
per design! by design?? There is a lot of confusion about this.
These lead me to question whether “duplicate names per design” is easy to say.
“That’s how we planned it and it’s done. You, the Ruby developer, figure out what to do with it.”
It brings an awful lot of uncertainty into the system. I think so.
Yes, I understand the reason. Have a Windows folder on every floor. Wunderbar.
And the consequences?
I deleted the floors. I have a bunch of Windows, can I merge them?
Sure, Dan did it. Nice code!
However I do not think it can be merged just because these have a same names. What about these?: #visible?
#visible_on_new_pages?,
Page #layer_folders
Once more:
duplicate names per design.
Dan: “It makes no good sense to me why anyone would want duplicate folder names at the same level.”
Sure not. But the user is user and it is possible to make like this, and sure it will happen:
It reminds me that they may not have paid attention to this during the design: SketchUp Extension UX Guidelines
Once more:
duplicate names per design.
I saw some code snippets on the forum, which are intended to patch the shortfall, when we import a model containing several layers and layer folders, the layer folders are not transferred. Neither can handle duplicate names.
Can you guess why?
Can you guess why the layer folders are not transferred natively?
__
My current answer is:
"Dear user, here is the latest TF Extensions, it transfers Tag Folders hierarchy . Duplicate names are not supported. "
PER DESIGN
Ps: This is a Ruby API topic, the API retains the use of “Layer” for compatibility and is synonymous with “Tag”.