Skip to content

Instantly share code, notes, and snippets.

View sam75782008's full-sized avatar

PENG-YU CHEN sam75782008

  • UCLA Taciroglu Research Group
View GitHub Profile
# WebDialog Test
face_wd = UI::WebDialog.new "Face Maker"
face_wd.set_size 600, 350
path = Sketchup.find_support_file "Html_try.html", "Plugins"
face_wd.set_file path
# callback from html
face_wd.add_action_callback("create_face") {|d, arg|
if arg.to_s.length ==0
puts "Coordinate must be effective."
<html>
<head>
<script type="text/javascript">
function sendPoints()
{
var ids = new Array ("x1", "y1", "z1", "x2", "y2", "z2", "x3", "y3", "z3", "x4", "y4", "z4");
var arg = ""; var entry = ""; var valid = true;
for (i in ids)
{
entry = document.getElementById(ids[i]).value