• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Google Example Plugin Box.rb

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 1 Posters 271 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    simonstaton
    last edited by 14 Aug 2009, 09:23

    I am using googles box.rb example to generate a floor I have managed to set up the Width and Depth functions properly. however now I want it so they can select a material from a drop down list. either grass or concrete or bark. this is the current code I am using

       prompts = [$exStrings.GetString("Garden Width"), $exStrings.GetString("Garden Height")]
        values = [6.feet, 4.feet]
        results = inputbox prompts, values, $exStrings.GetString("Your Garden Size and Material")
        return if not results # This means that the user canceld the operation   
        width, depth = results    
        model = Sketchup.active_model
        model.start_operation $exStrings.GetString("Create Box")    
        entities = model.active_entities
        group = entities.add_group
        entities = group.entities    
        pts = []
        pts[0] = [0, 0, 0]
        pts[1] = [width, 0, 0]
        pts[2] = [width, depth, 0]
        pts[3] = [0, depth, 0]
        base = entities.add_face pts      
        model.commit_operation
    

    any ideas on how I can add a materials prompt that will fill this box with a material.

    1 Reply Last reply Reply Quote 0
    • S Offline
      simonstaton
      last edited by 14 Aug 2009, 09:27

      I also just found this page that might help. http://code.google.com/apis/sketchup/docs/ourdoc/material.html

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement