Draw face from webdialog
-
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 pt1 pt2 pt3 pt4 Thick<br> </label> <input name="Group1" type="text" value="Group1" style="width; 62px" /> <input name="pt1" type="text" class="style2" style="width; 46px" value="(0,0,0)" /> <input name="pt2" type="text" style="width; 54px; height; 22px" value="(0,10,0)" /> <input name="pt3" type="text" style="width; 63px" value="(0,10,10)"> <input name="pt4" type="text" style="width; 58px" value="(0,10,0)"> <select name="pushpull" style="width; 65px"> <option></option> <option selected="">1</option> <option>2</option> <option>3</option> </select> <input name="OK" type="button" value="button"></div> <p> </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_dialogThanks
-
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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement