• Dummy Article For Plugin Page

LayerWatcher    v12.0

  • Overview
  • Release Notes

TIG (c) 2015-2020

All rights reserved.

TIG-LayerWatcher.rb

NOTE: in >= v2020 'Layer[s]' is replaced with 'Tag[s]' and 'Layer0' is known as 'Untagged'.
Although the Ruby files are the same across all versions, in >=v2020 the Extension is also renamed 'TIG-TagWatcher'.

Installation:

The RBZ installs from Preferences > Extensions > Install... button
into the Plugins folder.
It Autoloads with SketchUp.

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...

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'.

From 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...
These changes then mine down into any nested containers too...
These Layer changes are one-step undo-able, per selection.

1.0 20150602 First issue.
2.0 20150603 Selected-Geometry-To-Layer0 Context-Menu added.
3.0 20150611 Trapped for clash with ACT stupidly making a new layer, activating it for a millisecond and then reverting to the previous layer! Also skips all non-native tools when layer/geometry making.
4.0 20150801 Trapped obscure errors from some other plugins' operations affecting its observers etc.
Made into an Extension.
5.0 20151113 Minor tweaks. Future-proofed.
6.0 20151114 Better reporting of Assignment to Layer0 completion. Also some more security tweaks.
7.0 20151228 Loading files' regime adjusted to suit v2016 glitch.
8.0 20160103 Layer Observers dropping out on SKP change addressed.
9.0 20160306 Rare splats on MACs trapped. No longer reassigns layers of Exploded Containers' Geometry, BUT new context-menu item "Explode-To-Layer0", Explodes and reassigns the resultant Geometry to Layer0.
9.1 20160312 "Explode-To-Layer0" now works on all Containers, even those already assigned Layer0. Final reporting dialog enhanced.
10.0 20160516 Observers to assign new geometry to Layer0 now trapped to avoid MAC BugSplat if multiple external-components picked, but not then added to model.
11.0 20190626 Re-signed for full compatibility with newer SketchUp version.
12.0 20200223 Reworked for v2020 where Layers >> Tags etc...