Is there a Plugin to created a shortcut to quickly purge all layers / tags back to Layer 0 / Untagged?

(I’m new to the recent change of naming from layers to tags so by habit for this post, I will refer to them as layers!)

Part of my daily workflow involves importing 2D cad files (plans / elevations /sections etc.) and I typically delete all the layers, moving all the content to Layer 0 in the process. I then group and layer this up accordingly and take it into my main model (so as not to infest my main model layering with random layers from 3rd parties).

Although this is a relatively quick procedure, it would be great if someone knew of an existing plugin that would turn this into an automated process with either a simple keyboard shortcut to open a window that started the purge and meant that I didn’t have to select hundreds of layers scrolling down the stack and then clicking delete and confirming the move of geometry to Layer 0…

#1stworldproblem

I often do this several times every day and it just feels like one of those things that must have a plugin associated with it (that I haven’t been able to find)…

One that purges (deletes) all layers back to layer 0 keeping contents…

Cheers in advanced :slight_smile:

TIG’s Default Layer Geometry will parse through a model and assign Layer 0/ Untagged to all edges and faces. You can then select all of the Layers/Tags except Layer 0/ Untagged and delete them in one step without an extension.

Thom Thom’s CleanUp3 can also do what TIG’s Default Layer Geometry does.

1 Like

Hi DaveR, thank you for your suggestions, both great plugins, however they do not achieve what I needed. They appear only to affect and alter the loose geometry and leave the groups and components on the original layer, meaning that when I purge, the layer list is not completely emptied back to just layer 0.

These two plugins tackle it from one angle, what I need to happen is essentially an automated process of:

  • selecting all layers in the layer tray/stack (except Layer 0 which would be current)
  • delete all layers (and when prompted choose to ’ Move contents to default layer).

And then let Skp do what it normally does when doing the above steps the manual way.
Kinda like a script which could be assigned a keyboard shortcut.

Still, grateful for the reply and suggestion.

Many thanks,
Alan

Do you know you can click on the 2nd tag, scroll down and shift-click on the last tag, click the ‘-’ and delete them all at once?

Yes, this is what I do

And like I said in my OP, it is a bit of an ask! Since it is that easy.

But if there was an even quicker way, then it would be great. Especially if it could be linked to a shortcut.

Cheers,
Al

Layers Organizer (not a free extension) has a feature where you can (amongst others) delete layers / tags with the option to moved all info associated with them to Layer0/Untagged.

Since Layers Organizer was based on a free (not 100% stable and no longer supported / developed) extension called Layers Panel the functionality might be there as well IIRC.

Maybe even in some other extensions as well, can’t think of them (ones that I’ve used) off the cuff…

Here’s a simple extension that just makes Untagged/Layer0 the active tag/layer then deletes all the other layers without deleting geometry.

TagDelete.rb (1.4 KB)

Copy the file to your Plugins folder, then restart SketchUp. You can install without restarting if you copy the file then paste this into the Ruby conosole and press return:

load 'TagDelete.rb'

To use it, go to Extensions Menu → Delete Tags. There’s no warnings, it just deletes all the folders and tags so that it can be assigned a keyboard shortcut and you don’t have to click anything else. If you do it by mistake, you can Undo it, but apart from that, use at your own risk. It will delete all your tags and tag folders, so be careful.

Edit: Updated for SketchUp 2021

1 Like

McGordon,

That’s the ticket! Thank you very much. :+1:

No problem.

Get the latest version to fix problem where it would fail if a group/component was open for editing that was in a tag to be deleted.

I’m getting an error message for 2021. Any chance for an update? Tnx

To delete all tags you don’t need a plugin. In the Tags window select all and press delete. Press OK in the dialog that asks to move all entities to the default tag.

I’ve updated it for SketchUp 2021. It also now deletes all the tag folders too. The file is in the edited post above. This works reliably on a freshly opened file. Sometimes it fails while deleting folders when there’s something on the Undo stack, especially if you’ve used Undo on deleting a tag. If you don’t have any tag folders, it will work the same as the original plugin.

Save your file, close it, open it again and do “Delete Tags”.

Selecting tags and pressing delete doesn’t do anything, at least not in the Mac version. In SketchUp 2021, it can take quite a lot of mouse clicks to remove all folders and tags. You have to right-click and choose “Delete Tag” or “Delete Folders”.
If a selection contains a mixture of tags and folders then both the “Delete Tag” and “Delete Tag Folder” will be greyed out. You can delete multiple tags at the same time, but not multiple folders.

On Mac, select the tags that you want to delete. Then right click on any selected tag to bring up a contextual menu and choose Delete Tags in this menu.

Alternatively, you can also press the Horizontal arrow at the right end of the first line of the Tag Window to bring up a contextual menu and choose Delete Tags in this menu.

You can select a range of contiguous tags by clicking on one and shift clicking on another. This can be done either top down or bottom up.

You can select non-contiguous tags by pressing and holding the Command key while clicking on a tab name. Command-clicking on an already selected tag deselect it.

You can select all tags by clicking in the Tag Window and then do a Command-a (like for Select All). You won’t be able to delete all the tags since the Untagged one must be kept. Simply do a Command-Click on it to deselect it and then delete the selection as described previously.

1 Like

If your model contains only tags, then this is fine and everything you said above is correct (except you can’t do select all and just deselect Untagged, you’d have to unselect all folders too). Where it is much more work to remove is where you have a complicated hierarchy of folders and tags. Even one folder would be enough to stop you deleting them all at once.

The fastest manual way would be to command-click all the tags as @jean_lemire_1 described above and delete them, then purge to remove the empty folders. This could still be tedious if you have a lot of tags scattered through lots of folders.