sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Google Example Plugin Box.rb

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 1 Posters 292 Views 1 Watching
    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

      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

        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
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement