FYI
I wrote an Extension: LayerWatcher_v10.0
SketchUp Plugins | PluginStore | SketchUcation
You can download it from SketchUcation - you do need an account there - but a free one is readily available…
I wrote it to address the issues raised here and a few others…
It Autoloads with SketchUp.
It runs in the background waiting to spot your Layering changes, it also offers some extra layer-utilities…
Its Purpose:
It waits for certain actions…
It adds an Observer onto the Model’s Layers.
If the Current-Layer is changed to be anything other than “Layer0”,
then a dialog asks you if you really want to do that.
“Yes” will change it, “No” will make the Current-Layer “Layer0”.
The purpose is to prevent you from modeling raw Geometry on other Layers -
99.9% of the time it should be on “Layer0”, other Layers are to control the
visibility of Groups and Components which have been assigned those Layers.
SketchUp Layers only control visibility, they do not separate Geometry -
that is the role of Groups and Components.
You could change to another Current-Layer,
e.g. if you are adding lots of Text or Dims etc,
But most modeling involves geometry and then always use “Layer0”
It also adds Observers onto ALL Entities contexts.
Any ‘added’ Geometry [Edges or Faces] will always be assigned “Layer0”,
irrespective of the Current-Layer setting.
It only affects Geometry - other Entities are ignored.
Obviously it’s best to always draw raw Geometry with “Layer0”, the limit is
~200 pieces of geometry in one operation, so only very faceted circles etc
will hiccup, and affect the drawing tool’s ‘undo-stack’.
Since v9.0 LayerWatcher deals with Exploded Containers [Groups/Components]
differently. When you Explode a Container that is NOT assigned to “Layer0”,
then the resultant Geometry that appears in the Container’s context is assigned
that layer, sadly it’s just how SketchUp works, even when that Geometry might
have been assigned to “Layer0” while it’s inside the Container !
Because of limitations in the number of operations that can be in the ‘undo-stack’,
then unfortunately, if a lot of Geometry is reassigned to “Layer0” by LayerWatcher
after an Explode then the Explode itself cannot be Undone !
To avoid this, then any Geometry resulting from an Explode is left unchanged -
after the Explode the former contents are left highlighted, if they are not
assigned to “Layer0”, then you can use the Context-Menu item explained below -
“Selected-Geometry-To-Layer0” to fix the issue…
Alternatively [from v9.0] there is a Context-Menu item, available if the current
Selection contains a Group or Component-Instance -
it is called “Explode-To-Layer0”.
Use it to Explode All selected Containers, and reassign resultant Geometry
to “Layer0”. It only affects Geometry - other Entities are ignored.
The Exploding and Reassigning operation is one-step undo-able, per selection.
There is a Context-Menu item if the current Selection contains
Geometry [Edges and Faces] not assigned to “Layer0”, it is called -
“Selected-Geometry-To-Layer0” - it reassigns that Geometry’s Layer[s] to be
“Layer0”. The Layers of other Entities in the Selection - e.g. Groups -
are ignored, only Geometry in the Selection is changed.
However, if the Selection contains Groups or Components, AND they in turn
contain Geometry that is not assigned to “Layer0”, then you are then prompted
Yes|No to process those too…
These changes then mine down into any nested containers too…
These Layer changes are one-step undo-able, per selection.