Skip to content

Instantly share code, notes, and snippets.

View jimfoltz's full-sized avatar

Jim Foltz jimfoltz

View GitHub Profile
@jimfoltz
jimfoltz / cli.rb
Last active October 10, 2015 13:57
cli.rb
# require 'win32api'
module CLI
module_function
class Cmd
attr_accessor :name, :help, :proc
def initialize(name, help, prc)
@name = name
@help = help
@jimfoltz
jimfoltz / draw-camera-axes.rb
Last active October 10, 2015 14:02
draw-camera-axes.rb
module JF
def self.draw_camera_axes
camera = Sketchup.active_model.active_view.camera
eye = camera.eye
entities = Sketchup.active_model.active_entities
entities.add_cpoint(eye)
@jimfoltz
jimfoltz / trim-and-keep.rb
Created October 10, 2015 11:55
trim-and-keep.rb
# Trim and Keep (C) Copyright 2011 jim.foltz@gmail.com
# Version: 0.1
# gist_id: 39395cc0e6c6ec0010f3
#
# Trim and Keep aims to "fix" SketchUp Pro's Solid Tools Trim function. As it currently
# works, SketchUp's trim changes ComponentInstances into Groups.
#
require 'sketchup'
module JF; class TrimAndKeep
@jimfoltz
jimfoltz / nudge-tool.rb
Last active October 10, 2015 11:56
nudge-tool.rb
module JF
module Nudge
class NudgeTool
def enableVCB?
true
end
@jimfoltz
jimfoltz / unhide-all.rb
Last active October 10, 2015 13:00
unhide-all.rb
# file: unhide-all.rb
# author: jim.foltz@gmail.com
require 'sketchup.rb'
module JF
module UnhideAll
def self.start
@jimfoltz
jimfoltz / dim-layer.rb
Last active October 9, 2015 08:14
dim-layer.rb
# Switches the active Layer to "DIMS" when DimensionTool is used.
# Puts all Dimensions on DIMS Layer.
module JF
module DimLayer
DIM_LAYER_NAME = "DIMS"
class AppObserver < Sketchup::AppObserver
def expectsStartupNotifications()
DROP TABLE "Patient Medication" IF EXISTS;
DROP TABLE "Medication" IF EXISTS;
DROP TABLE "Payment" IF EXISTS;
DROP TABLE "Schedule" IF EXISTS;
DROP TABLE "Assignment" IF EXISTS;
DROP TABLE "Therapists Number" IF EXISTS;
DROP TABLE "Phone Number" IF EXISTS;
DROP TABLE "Patient" IF EXISTS;
DROP TABLE "Psychiatrist" IF EXISTS;
DROP TABLE "Medical Doctor" IF EXISTS;
@jimfoltz
jimfoltz / component-layers.rb
Last active October 26, 2015 23:16
component-layers.rb
# Right-click an Instance to move it and all sub-components
# to a new set of Layers prefixed by component name.
# Use to keep imported models off your Layers.
#
module JF
module ComponentLayers
def self.separator
"__"
end
@jimfoltz
jimfoltz / detect-dc.rb
Last active October 10, 2015 11:58
detect-dc.rb
module JF
module DetectDC
DICT = "dynamic_attributes"
class AppObserver < Sketchup::AppObserver
def expectsStartupModelNotifications()
return true
end
def onOpenModel(model)
class Node
attr_reader :ins, :name, :path
def initialize(ins, path, name)
@ins = ins
@path = path
@name = name
end