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

Draw face from webdialog

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 276 Views 2 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.
  • D Offline
    davesexcel
    last edited by 17 Nov 2014, 09:59

    I have HTML code to create a webdialog form.
    How do I Make a face with these points and Use the pushpull selection and create the group name---when I click the button?

    require 'Sketchup'
     
    def show_dialog
    dlg = UI;;WebDialog.new("DialogTest", false,
    "DialogTest", 600, 150, 150, 150, true);
    html = <<-HTML
    <form>
    <body>
    
    <div class="style1" style="width; 511px; height; 70px">
    				<label id="Label1">Name 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    				pt1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pt2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    				pt3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    				pt4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    				Thick<br>
    				</label>
    				<input name="Group1" type="text" value="Group1" style="width; 62px" />&nbsp;&nbsp;&nbsp;&nbsp;
    				<input name="pt1" type="text" class="style2" style="width; 46px" value="(0,0,0)" />&nbsp;
    				<input name="pt2" type="text" style="width; 54px; height; 22px" value="(0,10,0)" />&nbsp;
    				<input name="pt3" type="text" style="width; 63px" value="(0,10,10)">&nbsp;
    				<input name="pt4" type="text" style="width; 58px" value="(0,10,0)">&nbsp;
    				<select name="pushpull" style="width; 65px">
    				<option></option>
    				<option selected="">1</option>
    				<option>2</option>
    				<option>3</option>
    				</select>&nbsp; <input name="OK" type="button" value="button"></div>
    <p>&nbsp;</p>
    
    
    </body>
    
    </form>
    HTML
    dlg.set_html html
    dlg.add_action_callback("ruby_messagebox") {|dialog, params|
    UI.messagebox("You called ruby_messagebox with; " + params.to_s)
    }
    dlg.show
    end
     
    show_dialog
    
    

    Thanks

    1 Reply Last reply Reply Quote 0
    • S Offline
      sdmitch
      last edited by 17 Nov 2014, 16:58

      add an action to the form
      <form action="skp:ruby_messagebox@">

      change button type to "submit"

      In the callback
      tokens=params[1..-1].split("&");
      tokens.each{|t|
      var,val = t.split("=");
      case var
      when "pt1" then pt1=Geom::Point3d.new(val)
      .
      .
      end

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

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

      Advertisement