sketchucation logo sketchucation
    • Login
    1. Home
    2. Bombarde16
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Groups 1

    Bombarde16

    @Bombarde16

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Bombarde16 Unfollow Follow
    registered-users

    Latest posts made by Bombarde16

    • RE: Having trouble ending a simple script

      Chris,

      Thanks so much for the help, the revised script works beautifully. Proof positive that I was and still am in way over my head.

      Rob

      posted in Developers' Forum
      B
      Bombarde16
    • Having trouble ending a simple script

      Hello all,

      I'm trying to get from the tutorials into my first ruby plugin and am tantalizingly close but still getting a syntax error at the very end. Here's the code:

      require 'sketchup'
      Sketchup.send_action "showRubyPanel;"
      
      UI.menu("PlugIns").add_item("Square Organ Pipe 2D")
      
      prompts = [$exStrings.GetString("Internal Width"),
      $exStrings.GetString("Internal Depth"),
      $exStrings.GetString("Thickness")]
      values = [0.inches, 0.inches, 0.inches]
      results = inputbox prompts, values, $exStrings.GetString("Pipe internal dimensions and thickness")
      internal_width, internal_depth, thickness = results
      
      model = Sketchup.active_model
      entities = model.entities
      
      outer_x = (thickness * 2) + internal_width
      outer_y = (thickness * 2) + internal_depth
      
      inner_x1 = thickness
      inner_x2 = thickness + internal_width
      inner_y1 = thickness
      inner_y2 = thickness + internal_depth
      
      center_x = thickness + (internal_width * 0.5)
      center_y = thickness + (internal_depth * 0.5)
      
      outer_1 = [0,0,0]
      outer_2 = [outer_x,0,0]
      outer_3 = [outer_x,outer_y,0]
      outer_4 = [0,outer_y,0]
      
      inner_1 = [inner_x1, inner_y1, 0]
      inner_2 = [inner_x2, inner_y1, 0]
      inner_3 = [inner_x2, inner_y2, 0]
      inner_4 = [inner_x1, inner_y2, 0]
      
      center = [center_x, center_y, 0]
      
      new_face = entities.add_face outer_1, outer_2, outer_3, outer_4
      new_face = entities.add_face inner_1, inner_2, inner_3, inner_4
      line = entities.add_line inner_1, center
      line = entities.add_line inner_2, center
      
      end
      

      I'm sure I've made some silly beginner's mistake in here. Anyone see it?

      FWIW, this is to produce some 2D boxes to assist in laying out the internal design of a pipe organ. They look like this:

      http://lh3.ggpht.com/_CFXfoZ7L-vI/Sonv734qxhI/AAAAAAAASH8/PyvNcdYv4x4/s576/basic pipe plan.jpg

      ...and I need to make nearly three hundred of them in sizes differing down to a thousandth of an inch. Whence the need to automate part of the process.

      Thanks,
      Rob

      posted in Developers' Forum
      B
      Bombarde16