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"
View code.js
javascript:(function(d){var%20a=d.activeElement;t=a.value;s=a.selectionStart,e=a.selectionEnd;a.value=t.slice(0,s)+'[code]'+t.slice(s,e)+'[/code]'+t.slice(e);}(document));
View sketchup-ruby-api-sidebar.html
<!DOCTYPE html>
<html>
<head>
<title> SketchUp Ruby API</title>
<style>
body {
font-family: monospace;
font-size: 12px;
}
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
private
DICT = "dynamic_attributes".freeze
View model-size.rb
UI.menu("Extensions").add_item("Print Model Size") {
JF::ModelSize.main
}
module JF
module ModelSize
def self.main
bb = Sketchup.active_model.bounds
# 8.times {|c|
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]
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
JF::LimitScale.do(selection[0])
end
end
View cli.rb
# require 'win32api'
module CLI
module_function
class Cmd
attr_accessor :name, :help, :proc
def initialize(name, help, prc)
@name = name
@help = help
View 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)