@susketch17 wrote:
hi.,
I am getting error, while trying to load the code in the ruby console# encoding: UTF-8 require 'sketchup.rb' module Sekar24 # Main module names module Kitchen # Module name Class << self def start_test() model = Sketchup.active_model entities = model.active_entities group = entities.add_group #----INPUT DATA ------------- prompts = ["Width: ","Height: ","Depth: "] # array of prompts defaults = ["50.0","100.0","10.0"] # array of default inputs (as strings) list = ["","",""] # array of default responses input = UI.inputbox prompts, defaults, list, "Enter Panel Parameters" # displays prompt / returns array of inputs width = input[0].to_l # converts input string to model units height = input[1].to_l # converts input string to model units depth = input[2].to_l # converts input string to model units # --------------------------------------------- face = group.entities.add_face([0,0,0],[width,0,0],[width,0,height],[0,0,height],[0,0,0]) # add a face using the data face.pushpull(depth,false) # push/pull the face (special case: if created on the x/y plane, a negative number is needed) end # end of 'def' end # end of 'class' unless file_loaded?("kitchen.rb") # if the file is not loaded into SketchUp, execute the next lines # The next line adds a menu item to the PlugIns menu (i.e., 'Extensions' menu) and executes the code inside # the braces (i.e, 'start_test()') when clicked - the 'UI' is a SketchUp API item menu = UI.menu("PlugIns").add_item("Kitchen") { start_test() } file_loaded("kitchen.rb") # since the file wasn't loaded at this point, load it from disk end #end of 'unless' end #end of 'module' end #end of 'module'
Image may be NSFW.
Clik here to view.
Posts: 1
Participants: 1