This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module JF | |
module Nudge | |
class NudgeTool | |
def enableVCB? | |
true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module JF | |
module DetectDC | |
DICT = "dynamic_attributes" | |
class AppObserver < Sketchup::AppObserver | |
def expectsStartupModelNotifications() | |
return true | |
end | |
def onOpenModel(model) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: unhide-all.rb | |
# author: jim.foltz@gmail.com | |
require 'sketchup.rb' | |
module JF | |
module UnhideAll | |
def self.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# require 'win32api' | |
module CLI | |
module_function | |
class Cmd | |
attr_accessor :name, :help, :proc | |
def initialize(name, help, prc) | |
@name = name | |
@help = help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
JF::LimitScale.do(selection[0]) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] |