/ext.rb Secret
Created
September 17, 2019 09:19
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
# Copyright 2016 Trimble Inc | |
# Licensed under the MIT license | |
require 'sketchup.rb' | |
module Examples | |
module HelloCube | |
def self.create_cube | |
model = Sketchup.active_model | |
model.start_operation('Create Cube', true) | |
group = model.active_entities.add_group | |
entities = group.entities | |
points = [ | |
Geom::Point3d.new(0, 0, 0), | |
Geom::Point3d.new(1.m, 0, 0), | |
Geom::Point3d.new(1.m, 1.m, 0), | |
Geom::Point3d.new(0, 1.m, 0) | |
] | |
face = entities.add_face(points) | |
face.pushpull(-1.m) | |
model.commit_operation | |
end | |
unless file_loaded?(__FILE__) | |
toolbar = UI::Toolbar.new "Xenakis" | |
# This toolbar icon simply displays Hello World on the screen | |
cmd = UI::Command.new("Sync") { | |
## I NEED TO RUN IT HERE | |
} | |
cmd.small_icon = "ToolPencilSmall.png" | |
cmd.large_icon = "ToolPencilLarge.png" | |
cmd.tooltip = "Sync with Xenakis" | |
cmd.status_bar_text = "Testing the toolbars class" | |
cmd.menu_text = "Test" | |
toolbar = toolbar.add_item cmd | |
toolbar.show | |
file_loaded(__FILE__) | |
end | |
end # module HelloCube | |
end # module Examples |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment