# \#example

**URL:** https://forums.sketchup.com/tag/example/882.md

[Latest](https://forums.sketchup.com/latest.md) · [Categories](https://forums.sketchup.com/categories.md) · [Tags](https://forums.sketchup.com/tags.md)

---

## [\[Example\] An extension registrar file that checks for and loads Dynamic Components](https://forums.sketchup.com/t/example-an-extension-registrar-file-that-checks-for-and-loads-dynamic-components/322825)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 0\
**Last updated:** [April 10, 2025, 6:54am UTC](https://forums.sketchup.com/t/example-an-extension-registrar-file-that-checks-for-and-loads-dynamic-components/322825 "2025-04-10T06:54:07Z")

</div>

\[Example\] An extension registrar file that checks for and loads Dynamic Components. This is a dummy example extension (has no functions) other than to check for and attempt to load the Dynamic Components extension before …

---

## [\[Code\] Example: Simple CSV Export for Selected Components](https://forums.sketchup.com/t/code-example-simple-csv-export-for-selected-components/212078)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 0\
**Last updated:** [November 1, 2022, 3:14pm UTC](https://forums.sketchup.com/t/code-example-simple-csv-export-for-selected-components/212078 "2022-11-01T15:14:48Z")

</div>

Example: Simple CSV Export for Selected Components # encoding: UTF-8 # module YourNamespace # \<---\<\<\< Change to your unique namespace name module SomePlugin # \<---\<\<\< Change to some appropriate extension name e…

---

## [\[code\] Set Layer Colors menu command example](https://forums.sketchup.com/t/code-set-layer-colors-menu-command-example/26231)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 1\
**Last updated:** [June 8, 2016, 6:36pm UTC](https://forums.sketchup.com/t/code-set-layer-colors-menu-command-example/26231 "2016-06-08T18:36:24Z")

</div>

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 add…

---

## [\[Example\] Command to close all active edits](https://forums.sketchup.com/t/example-command-to-close-all-active-edits/25805)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 14\
**Last updated:** [June 9, 2021, 6:40pm UTC](https://forums.sketchup.com/t/example-command-to-close-all-active-edits/25805 "2021-06-09T18:40:22Z")

</div>

An simple example command to close all active editing contexts. Once loaded, a keyboard shortcut can be specified in Preferences \> Shortcuts. On PC, we cannot use CTRL+ESC (because it’s a system shortcut,) … so I used …

---

## [\[Code\] Example: Command to iterate a folder of Components and set their name property](https://forums.sketchup.com/t/code-example-command-to-iterate-a-folder-of-components-and-set-their-name-property/114047)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 0\
**Last updated:** [January 20, 2020, 9:06pm UTC](https://forums.sketchup.com/t/code-example-command-to-iterate-a-folder-of-components-and-set-their-name-property/114047 "2020-01-20T21:06:13Z")

</div>

Example: Command to iterate a folder of Components and set their name property. SketchUp version 2015+ RenameComponentsByFolder.rb (5.4 KB) BACKUP YOUR FOLDERS BEFORE RUNNING THIS UTILITY! THIS IS AN EXAMPLE. NO WARR…

---

## [\[Code\] Example: Saving Iso views to PNG image files](https://forums.sketchup.com/t/code-example-saving-iso-views-to-png-image-files/56762)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 4\
**Last updated:** [December 5, 2017, 3:01am UTC](https://forums.sketchup.com/t/code-example-saving-iso-views-to-png-image-files/56762 "2017-12-05T03:01:45Z")

</div>

Continuing the discussion from Waiting for Sketchup.send\_action to complete before continuing: I’ve actually modified my sample and removed the ViewObserver and got a working plugin. The strangest thing is that the us…

---

## [Is the train from this video in the 3d warehouse?](https://forums.sketchup.com/t/is-the-train-from-this-video-in-the-3d-warehouse/71563)

<div class="topic-metadata">

**Author:** [@spawn](https://forums.sketchup.com/u/spawn)\
**Replies:** 4\
**Last updated:** [July 5, 2018, 12:16am UTC](https://forums.sketchup.com/t/is-the-train-from-this-video-in-the-3d-warehouse/71563 "2018-07-05T00:16:46Z")

</div>

You guys know if the train showed in this video is available in the 3D warehouse? If it is, how can I find it? Thanks in advance.

---

## [Extension example: Count material area](https://forums.sketchup.com/t/extension-example-count-material-area/56332)

<div class="topic-metadata">

**Author:** [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Replies:** 5\
**Last updated:** [November 29, 2017, 4:34pm UTC](https://forums.sketchup.com/t/extension-example-count-material-area/56332 "2017-11-29T16:34:18Z")

</div>

I’ve just published a small Ruby Extension that counts the area of each material in the model. This is already a feature in SketchUp natively so it might not be the most useful extension. However, it serves as an exampl…

---

## [\[code\] Example of creating your own Exception subclasses](https://forums.sketchup.com/t/code-example-of-creating-your-own-exception-subclasses/36906)

<div class="topic-metadata">

**Author:** [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Replies:** 1\
**Last updated:** [January 7, 2017, 5:14pm UTC](https://forums.sketchup.com/t/code-example-of-creating-your-own-exception-subclasses/36906 "2017-01-07T17:14:12Z")

</div>

Prompted by a question (over at SCF,) about using a SystemExit exception (fired by exit(),) to bail out of an input handling routine. The main answer is: I know of no good use for exit() in an embedded Ruby subprocess. …
