Skip to content

Instantly share code, notes, and snippets.

Jim Foltz jimfoltz

Block or report user

Report or block jimfoltz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jimfoltz / su.ahk
Created Oct 6, 2018
Launch SketchUp from Command Line & Auto-click Splash Screen
View su.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Versions := {}
Versions[17] := "C:\Program Files\SketchUp\SketchUp 2017\Sketchup.exe"
Versions[16] := "C:\Program Files\SketchUp\SketchUp 2016\Sketchup.exe"
jimfoltz / tw5-server.rb
Last active Jun 4, 2019
A local server for TiddlyWiki5 that allows saving wiki.
View tw5-server.rb
require 'webrick'
require 'fileutils'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
root = '.'
BACKUP_DIR = 'bak'
jimfoltz / a2s.cpp
Last active Jan 14, 2017
convert mesh files to .skp using assimp library
View a2s.cpp
#include <SketchUpAPI/SketchUp.h>
#include <iostream>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <assimp/DefaultLogger.hpp>
#include "output_sketchup_error.h"
jimfoltz / code.js
Last active Oct 1, 2016
firefox bookmarklet to wrap selected text in bbode [code] tags
View code.js
jimfoltz / sketchup-ruby-api-sidebar.html
Created Apr 3, 2016
SketchUp Ruby API Sidebar for Firefox
View sketchup-ruby-api-sidebar.html
<!DOCTYPE html>
<title> SketchUp Ruby API</title>
body {
font-family: monospace;
font-size: 12px;
jimfoltz / infix2postfix.rb
Last active Jan 3, 2016
infix to postfix
View infix2postfix.rb
require "awesome_print"
exp = "1 + 2 * 3"
exp = "9 + 24 / (7 - 3)"
exp = "3 * atan(2/3)"
exp = "(12.3mm - 1')*52 - 473 mm/(4 + 2^3)"
def prec(op)
case op
View parentize-dc.rb
# Replaces references to a parent Coponent in a DC
# with the "Parent!" reference.
module JF
module Parentize
DICT = "dynamic_attributes".freeze
View model-size.rb"Extensions").add_item("Print Model Size") {
module JF
module ModelSize
def self.main
bb = Sketchup.active_model.bounds
# 8.times {|c|
jimfoltz / make-dc-door.rb
Last active Oct 30, 2015
View make-dc-door.rb
# make dc door
# Right-click a Instance, select Make DC Door
UI.add_context_menu_handler do |menu|
if ((sel = Sketchup.active_model.selection).length == 1)
if sel[0].class == Sketchup::ComponentInstance
menu.add_item("Make DC Door") do
ret = UI.inputbox( ["From", "To"], [0, 90], "Degrees")
if ret
entity = sel[0]
jimfoltz / limit-scale.rb
Last active Oct 30, 2015
View limit-scale.rb
# Limit the scale handles for Groups and Instances
UI.add_context_menu_handler do |menu|
model = Sketchup.active_model
selection = model.selection
if selection.nitems == 1 and selection[0].is_a? Sketchup::Group or selection[0].is_a?(Sketchup::ComponentInstance)
menu.add_item("Limit Scale") do[0])
You can’t perform that action at this time.