# Color by layer pre set

**URL:** <https://forums.sketchup.com/t/color-by-layer-pre-set/114438>\
**Category:** SketchUp\
**Tags:** template, layers\
**Created:** [January 25, 2020, 6:42pm UTC](https://forums.sketchup.com/t/color-by-layer-pre-set/114438 "2020-01-25T18:42:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [January 25, 2020, 8:46pm UTC](https://forums.sketchup.com/t/color-by-layer-pre-set/114438/4 "2020-01-25T20:46:39Z")

</div>

I recently used some code:

> [@\[code\] Set Layer Colors menu command example](https://forums.sketchup.com/t/code-set-layer-colors-menu-command-example/26231):
>
> An example that creates two menu commands at the bottom of the “View” menu. It sets all layers whose name begins with “Demo” to red, “New” to gray, and any others to white. It saves the previous color settings, and adds a complimentary command to reset the layer colors back to previous. EDIT: But,… this can add a bunch of undo operations to the undo stack. See the [next post](https://forums.sketchup.com/t/code-set-layer-colors-menu-command-example/26231/2), for an example that wraps the commands in named undo operations. 
> 
> > **Example without undoable operations (click to expand…**
> >

---

_[View the full topic](https://forums.sketchup.com/t/color-by-layer-pre-set/114438)._
