libsk.rb

I'm going to (have) start putting together a library of (hopefully) useful Ruby/SketchUp helper methods. Maybe called sk.rb, or libsk.rb.

I want to organize it in a way so that a user can require the entire lib, a subset of it, or an individual part of it. I think it can be organized into folders and sub-folders. For example, take Group.moveto() . Here is an example folder layout and usage:

*/Plugins/
sk.rb
sk/
groups.rb
groups/
moveto.rb

And here is the example usage:


# require everything.
require "sk.rb"

# include everything in the groups folder only.
require "sk/groups.rb"

# include only the moveto method in the groups folder.
require "sk/groups/moveto.rb"

You can download an example help file.

Thoughts?

Plugin: Randomize TIN

This plugn adds some (user specified) randomness to a Sandbox-created TIN. It adds a Randomize TIN option under the Plugins menu.



Installation
  • Download random_tin.rb.
  • Move the file into your SketchUp/Plugins folder, restart SketchUp.
Usage

The input can be any valid SketchUp length, i.e. 1", 35.54, 4m. A pop-up will tell you if the value is not valid. The TIN is looped over and each point is moved up or down by an amount in the range of -amt to amt, where amt is the user entered value.

Plugin: Unfold Tool

This SketchUp script assists the user in flattening, or unfolding, 3d objects onto a 2d plane.

Installation
  1. Download unfoldtool.zip.
  2. Move the file into your SketchUp/Plugins folder.
  3. Restart SketchUp.
The script creates an item Unfold Tool in the Plugins menu.

Usage
  • Select the Unfold Tool from the Plugins menu, start selecting faces to unfold. The selected face is unfolded to match next selection.
  • Hold the Control key to reverse operation - rotate the subsequent face to match the already selected face(s).
  • Alt-click on a face to select all the faces in the same plane.
  • Shift-click to toggle selection of faces.
  • Click off the model to reset the selection.
See Also

My unfold tool is pretty basic - you may want to check out the Flattery plugin as an alternative.

Plugin: Print Shortcuts

This plugin creates an HTML file of your shortcuts in your browser. You can select 1 or more columns, but I find 1, 2, or 3 work the best. Look for Print Shortcuts under the Plugins menu.

Download printkeys.rb

Plugin: Template Utilities

This script adds 2 menu items to the File menu: Save as Template, and New from Template. It allows the user to quickly create and use templates.

  • Save as Template saves the current model as a template in the templates folder.
  • New from Template lets you choose a template, and starts a new model using the template. The selected template becomes the default template.

Instructions
  1. Download template_utils.rb
  2. Move the file into your Sketchup.Plugins folder, and restart SketchUp

Plugin: Zoom Selection

Adds 2 menu items to the Camera Menu: Zoom Selection, and Zoom Out.
  • Zoom Selection zooms to the selected entities. If nothing is selected, zoom to the model extents.
  • Zoom Out zooms out by a factor of 2.
Download jf_zoom_selection.rb

I have set up 2 key shorcuts: 'z' for Zoom Selection, and 'Shift-Z' for Zoom Out.

Developers

Script writers can call these methods using the following syntax:
require "zoom_selection.rb"
JF::zoomSelection
JF::ZoomOut(factor)

Plugin: Point at Intersection

Select 2 lines, then right-click and select Point at Intersection. Adds a Guide Point at the intersection of the lines.

Instructions

1. Download point_at_intersection.rb
2. Move the file to your Sketchup/Plugins folder
3 Restart SketchUp


Popular Posts (Last 30 Days)