What different method would you suggest. Iām actually at wits end right now with this issue since it is an intermittent problem and I canāt seem to find the exact reason why sometime some of the parameter fields in the html form donāt get populated.
The html form in its entirety is here:
http://design.medeek.com/test/web_dialog_editwindow.html
The ruby code that connects to the html and talks to it is below:
############################################
#
# Medeek Design Inc. - Medeek Wall Plugin - Copyright 2016-2018
#
# Name: MEDEEK_EDIT_WINDOW
# http://design.medeek.com
# Author: Nathaniel P. Wilkerson PE
# Created: Apr. 11, 2018
# Last Revision: May 19, 2018
# Version 1.0.0
# Company: Medeek Design Inc.
#
# TOOL TO EDIT WINDOWS
#
#
# Place this file in your Google SketchUp plugins directory
#
#############################################
# First we pull in the standard API hooks.
# require 'sketchup.rb'
# require 'extensions.rb'
# require 'langhandler.rb'
# Define Module Hierarchy
module Medeek_Engineering_Inc_Extensions
module MedeekWallPlugin
module Wall
##############################
#
# Class Methods of Plugin
#
##############################
class MedeekMethods
class << self
# include Math
######################################################
#
# EDIT WINDOWS
#
######################################################
def show_edit_menu_window (wallfamily, wall_group, opening_group_name)
MedeekMethods.get_window_library_files
@Wallfamily = wallfamily
# Loads Parameters from Dictionary
@Win_geom = @Windowattr[0]
@Win_loc = @Windowattr[1]
@Win_width = @Windowattr[2]
@Win_height = @Windowattr[3]
@Win_header = @Windowattr[4]
@Win_headerhgt = @Windowattr[5]
@Win_sill_num = @Windowattr[6]
@Win_king_num = @Windowattr[7]
@Win_trimmer_num = @Windowattr[8]
@Win_sill_trimmers = @Windowattr[9]
@Win_ro_offset = @Windowattr[10]
@Advwinoptions = @Windowattr[11]
if @Advwinoptions == "YES"
@Win_installoption = @Windowattradv[0]
@Win_trimoption = @Windowattradv[1]
@Win_casingoption = @Windowattradv[2]
if @Win_installoption == "YES"
@Win_installstyle = @Windowattr_install[0]
@Win_installloc = @Windowattr_install[1]
@Win_framewidth_install = @Windowattr_install[2]
@Win_framedepth_install = @Windowattr_install[3]
@Win_sashwidth_install = @Windowattr_install[4]
@Win_sashdepth_install = @Windowattr_install[5]
@Win_glassthk_install = @Windowattr_install[6]
@Win_outset_install = @Windowattr_install[7]
@Win_mullions_install = @Windowattr_install[8]
@Wininstallmat = @Windowattr_install[9]
@Winframematname = @Windowattr_install[10]
@Win_mulliondepth = @Windowattr_install[11]
@Win_mullionwidth = @Windowattr_install[12]
@Win_installmode = @Windowattr_install[13]
@Win_file = @Windowattr_install[14]
@Win_insertion = @Windowattr_install[15]
end
if @Win_trimoption == "YES"
@Win_trimstyle = @Windowattr_trim[0]
@Win_trimloc = @Windowattr_trim[1]
@Win_headerwidth = @Windowattr_trim[2]
@Win_jambwidth = @Windowattr_trim[3]
@Win_sillwidth = @Windowattr_trim[4]
@Win_headerthk = @Windowattr_trim[5]
@Win_jambthk = @Windowattr_trim[6]
@Win_sillthk = @Windowattr_trim[7]
@Win_headerext = @Windowattr_trim[8]
@Win_sillext = @Windowattr_trim[9]
@Wintrimmat = @Windowattr_trim[10]
@Wintrimmatname = @Windowattr_trim[11]
end
if @Win_casingoption == "YES"
@Win_casingstyle = @Windowattr_casing[0]
@Win_casingloc = @Windowattr_casing[1]
@Win_headerwidth_casing = @Windowattr_casing[2]
@Win_jambwidth_casing = @Windowattr_casing[3]
@Win_apronwidth_casing = @Windowattr_casing[4]
@Win_jambextdepth_casing = @Windowattr_casing[5]
@Win_headerthk_casing = @Windowattr_casing[6]
@Win_jambthk_casing = @Windowattr_casing[7]
@Win_stoolthk_casing = @Windowattr_casing[8]
@Win_apronthk_casing = @Windowattr_casing[9]
@Win_jambextthk_casing = @Windowattr_casing[10]
@Win_headerext_casing = @Windowattr_casing[11]
@Win_stoolext_casing = @Windowattr_casing[12]
@Win_apronext_casing = @Windowattr_casing[13]
@Win_stoolproj_casing = @Windowattr_casing[14]
@Win_reveal_casing = @Windowattr_casing[15]
@Win_shim_casing = @Windowattr_casing[16]
@Wincasingmat = @Windowattr_casing[17]
@Wincasingmatname = @Windowattr_casing[18]
end
end
######################
#
# Html Menu
#
######################
# @Wall_length_ft = @Wall_length/12.0
# @Wall_length_m = @Wall_length_ft * @ft_m
# @BuildingLength_ft = 10
# @BuildingLength_m = @BuildingLength_ft * @ft_m
if @Wallfamily == "Rectangular"
if @Licensemode == "trial"
if defined?(UI::HtmlDialog)
dlg00 = UI::HtmlDialog.new(
{
:dialog_title => "Edit Window Assembly - Version #{@Pluginversion} (trial version)",
:preferences_key => 'editoptions_MEDEEK_WINDOW',
:scrollable => true,
:resizable => true,
:width => 400,
:height => 1000,
:left => 1200,
:top => 100,
:min_width => 50,
:min_height => 50,
:max_width =>1000,
:max_height => 1200,
:style => UI::HtmlDialog::STYLE_DIALOG
})
else
dlg00 = UI::WebDialog.new("Edit Window Assembly - Version #{@Pluginversion}", true, "editoptions_MEDEEK_WINDOW", 1000, 750, 450, 200, true)
end
else
if defined?(UI::HtmlDialog)
dlg00 = UI::HtmlDialog.new(
{
:dialog_title => "Edit Window Assembly - Version #{@Pluginversion}",
:preferences_key => 'editoptions_MEDEEK_WINDOW',
:scrollable => true,
:resizable => true,
:width => 400,
:height => 1000,
:left => 1200,
:top => 100,
:min_width => 50,
:min_height => 50,
:max_width =>1000,
:max_height => 1200,
:style => UI::HtmlDialog::STYLE_DIALOG
})
else
dlg00 = UI::WebDialog.new("Edit Window Assembly - Version #{@Pluginversion}", true, "editoptions_MEDEEK_WINDOW", 1000, 750, 450, 200, true)
end
end
#############################################
dlg00.add_action_callback("PUSHTOHTML_WINDOW_EDIT") {|action_context, params|
if @Unitstemplate == "metric"
@Win_loc_ftin = @Win_loc.to_l
@Win_width_m = (@Win_width*@in_mm).round(3)
@Win_height_m = (@Win_height*@in_mm).round(3)
@Win_headerhgt_m = (@Win_headerhgt*@in_mm).round(3)
@Win_ro_offset_m = (@Win_ro_offset*@in_mm).round(3)
js_command = 'pushdata( "' + opening_group_name.to_s + '|' + @Winfamily.to_s + '|' + @Win_geom.to_s + '|' + @Win_loc_ftin.to_s + '|' + @Win_width_m.to_s + '|' + @Win_height_m.to_s + '|' + @Win_header.to_s + '|' + @Win_headerhgt_m.to_s + '|' + @Win_sill_num.to_s + '|' + @Win_king_num.to_s + '|' + @Win_trimmer_num.to_s + '|' + @Win_sill_trimmers.to_s + '|' + @Win_ro_offset_m.to_s + '|' + @Advwinoptions.to_s + '|' + @Templateunits.to_s + '|' + @Language_db.to_s + '|' + @Licensemode.to_s + '" );'
else
@Win_loc_ftin = @Win_loc.to_l
@Win_loc_ftin = @Win_loc_ftin.to_s
@Win_loc_ftin_fixed = @Win_loc_ftin.gsub(/"/, '\"')
js_command = 'pushdata( "' + opening_group_name.to_s + '|' + @Winfamily.to_s + '|' + @Win_geom.to_s + '|' + @Win_loc_ftin_fixed + '|' + @Win_width.to_s + '|' + @Win_height.to_s + '|' + @Win_header.to_s + '|' + @Win_headerhgt.to_s + '|' + @Win_sill_num.to_s + '|' + @Win_king_num.to_s + '|' + @Win_trimmer_num.to_s + '|' + @Win_sill_trimmers.to_s + '|' + @Win_ro_offset.to_s + '|' + @Advwinoptions.to_s + '|' + @Templateunits.to_s + '|' + @Language_db.to_s + '|' + @Licensemode.to_s + '" );'
end
dlg00.execute_script(js_command)
}
dlg00.add_action_callback("PUSHTOHTML_WINDOW_EDIT_ADV") {|action_context, params|
if @Unitstemplate == "metric"
js_command = 'pushdata_adv( "' + @Win_installoption.to_s + '|' + @Win_trimoption.to_s + '|' + @Win_casingoption.to_s + '" );'
else
js_command = 'pushdata_adv( "' + @Win_installoption.to_s + '|' + @Win_trimoption.to_s + '|' + @Win_casingoption.to_s + '" );'
end
dlg00.execute_script(js_command)
}
dlg00.add_action_callback("PUSHTOHTML_WINDOW_EDIT_INS") {|action_context, params|
if @Unitstemplate == "metric"
@Win_framewidth_install_m = (@Win_framewidth_install*@in_mm).round(3)
@Win_framedepth_install_m = (@Win_framedepth_install*@in_mm).round(3)
@Win_sashwidth_install_m = (@Win_sashwidth_install*@in_mm).round(3)
@Win_sashdepth_install_m = (@Win_sashdepth_install*@in_mm).round(3)
@Win_glassthk_install_m = (@Win_glassthk_install*@in_mm).round(3)
@Win_outset_install_m = (@Win_outset_install*@in_mm).round(3)
@Win_mulliondepth_m = (@Win_mulliondepth*@in_mm).round(3)
@Win_mullionwidth_m = (@Win_mullionwidth*@in_mm).round(3)
js_command = 'pushdata_ins( "' + @Win_installstyle.to_s + '|' + @Win_installloc.to_s + '|' + @Win_framewidth_install_m.to_s + '|' + @Win_framedepth_m_install.to_s + '|' + @Win_sashwidth_install_m.to_s + '|' + @Win_sashdepth_m_install.to_s + '|' + @Win_glassthk_m_install.to_s + '|' + @Win_outset_install_m.to_s + '|' + @Win_mullions_install.to_s + '|' + @Wininstallmat.to_s + '|' + @Winframematname.to_s + '|' + @Win_mulliondepth_m.to_s + '|' + @Win_mullionwidth_m.to_s + '|' + @Win_installmode.to_s + '|' + @Win_file.to_s + '|' + @Win_insertion.to_s + '|' + @Window_library_string.to_s + '" );'
else
js_command = 'pushdata_ins( "' + @Win_installstyle.to_s + '|' + @Win_installloc.to_s + '|' + @Win_framewidth_install.to_s + '|' + @Win_framedepth_install.to_s + '|' + @Win_sashwidth_install.to_s + '|' + @Win_sashdepth_install.to_s + '|' + @Win_glassthk_install.to_s + '|' + @Win_outset_install.to_s + '|' + @Win_mullions_install.to_s + '|' + @Wininstallmat.to_s + '|' + @Winframematname.to_s + '|' + @Win_mulliondepth.to_s + '|' + @Win_mullionwidth.to_s + '|' + @Win_installmode.to_s + '|' + @Win_file.to_s + '|' + @Win_insertion.to_s + '|' + @Window_library_string.to_s + '" );'
end
dlg00.execute_script(js_command)
}
dlg00.add_action_callback("PUSHTOHTML_WINDOW_EDIT_TRM") {|action_context, params|
if @Unitstemplate == "metric"
@Win_headerwidth_m = (@Win_headerwidth*@in_mm).round(3)
@Win_jambwidth_m = (@Win_jambwidth*@in_mm).round(3)
@Win_sillwidth_m = (@Win_sillwidth*@in_mm).round(3)
@Win_headerthk_m = (@Win_headerthk*@in_mm).round(3)
@Win_jambthk_m = (@Win_jambthk*@in_mm).round(3)
@Win_sillthk_m = (@Win_sillthk*@in_mm).round(3)
@Win_headerext_m = (@Win_headerext*@in_mm).round(3)
@Win_sillext_m = (@Win_sillext*@in_mm).round(3)
js_command = 'pushdata_trm( "' + @Win_trimstyle.to_s + '|' + @Win_trimloc.to_s + '|' + @Win_headerwidth_m.to_s + '|' + @Win_jambwidth_m.to_s + '|' + @Win_sillwidth_m.to_s + '|' + @Win_headerthk_m.to_s + '|' + @Win_jambthk_m.to_s + '|' + @Win_sillthk_m.to_s + '|' + @Win_headerext_m.to_s + '|' + @Win_sillext_m.to_s + '|' + @Wintrimmat.to_s + '|' + @Wintrimmatname.to_s + '" );'
else
js_command = 'pushdata_trm( "' + @Win_trimstyle.to_s + '|' + @Win_trimloc.to_s + '|' + @Win_headerwidth.to_s + '|' + @Win_jambwidth.to_s + '|' + @Win_sillwidth.to_s + '|' + @Win_headerthk.to_s + '|' + @Win_jambthk.to_s + '|' + @Win_sillthk.to_s + '|' + @Win_headerext.to_s + '|' + @Win_sillext.to_s + '|' + @Wintrimmat.to_s + '|' + @Wintrimmatname.to_s + '" );'
end
dlg00.execute_script(js_command)
}
dlg00.add_action_callback("PUSHTOHTML_WINDOW_EDIT_CAS") {|action_context, params|
if @Unitstemplate == "metric"
@Win_headerwidth_casing_m = (@Win_headerwidth_casing*@in_mm).round(3)
@Win_jambwidth_casing_m = (@Win_jambwidth_casing*@in_mm).round(3)
@Win_apronwidth_casing_m = (@Win_apronwidth_casing*@in_mm).round(3)
@Win_jambextdepth_casing_m = (@Win_jambextdepth_casing*@in_mm).round(3)
@Win_headerthk_casing_m = (@Win_headerthk_casing*@in_mm).round(3)
@Win_jambthk_casing_m = (@Win_jambthk_casing*@in_mm).round(3)
@Win_stoolthk_casing_m = (@Win_stoolthk_casing*@in_mm).round(3)
@Win_apronthk_casing_m = (@Win_apronthk_casing*@in_mm).round(3)
@Win_jambextthk_casing_m = (@Win_jambextthk_casing*@in_mm).round(3)
@Win_headerext_casing_m = (@Win_headerext_casing*@in_mm).round(3)
@Win_stoolext_casing_m = (@Win_stoolext_casing*@in_mm).round(3)
@Win_apronext_casing_m = (@Win_apronext_casing*@in_mm).round(3)
@Win_stoolproj_casing_m = (@Win_stoolproj_casing*@in_mm).round(3)
@Win_reveal_casing_m = (@Win_reveal_casing*@in_mm).round(3)
@Win_shim_casing_m = (@Win_shim_casing*@in_mm).round(3)
js_command = 'pushdata_cas( "' + @Win_casingstyle.to_s + '|' + @Win_casingloc.to_s + '|' + @Win_headerwidth_casing_m.to_s + '|' + @Win_jambwidth_casing_m.to_s + '|' + @Win_apronwidth_casing_m.to_s + '|' + @Win_jambextdepth_casing_m.to_s + '|' + @Win_headerthk_casing_m.to_s + '|' + @Win_jambthk_casing_m.to_s + '|' + @Win_stoolthk_casing_m.to_s + '|' + @Win_apronthk_casing_m.to_s + '|' + @Win_jambextthk_casing_m.to_s + '|' + @Win_headerext_casing_m.to_s + '|' + @Win_stoolext_casing_m.to_s + '|' + @Win_apronext_casing_m.to_s + '|' + @Win_stoolproj_casing_m.to_s + '|' + @Win_reveal_casing_m.to_s + '|' + @Win_shim_casing_m.to_s + '|' + @Wincasingmat.to_s + '|' + @Wincasingmatname.to_s + '" );'
else
js_command = 'pushdata_cas( "' + @Win_casingstyle.to_s + '|' + @Win_casingloc.to_s + '|' + @Win_headerwidth_casing.to_s + '|' + @Win_jambwidth_casing.to_s + '|' + @Win_apronwidth_casing.to_s + '|' + @Win_jambextdepth_casing.to_s + '|' + @Win_headerthk_casing.to_s + '|' + @Win_jambthk_casing.to_s + '|' + @Win_stoolthk_casing.to_s + '|' + @Win_apronthk_casing.to_s + '|' + @Win_jambextthk_casing.to_s + '|' + @Win_headerext_casing.to_s + '|' + @Win_stoolext_casing.to_s + '|' + @Win_apronext_casing.to_s + '|' + @Win_stoolproj_casing.to_s + '|' + @Win_reveal_casing.to_s + '|' + @Win_shim_casing.to_s + '|' + @Wincasingmat.to_s + '|' + @Wincasingmatname.to_s + '" );'
end
dlg00.execute_script(js_command)
}
#############################################
dlg00.add_action_callback("EXEC_WINDOW_EDIT") {|action_context, params|
if params
@Winfamily = "Rectangle"
@Edit_menu_window = 1
@Edit_menu = 1
@Model_operation = 'Edit Window'
@Windowgroupname = opening_group_name
@Wall_group = wall_group
@maingroup = @Wall_group
@maingroup_name = @maingroup.name
this_dir=File.dirname(__FILE__)
# Fix for ruby 2.0
if this_dir.respond_to?(:force_encoding)
this_dir=this_dir.dup.force_encoding("UTF-8")
end
# Global Settings and Parameters
Sketchup.load(File.join(this_dir,"MEDEEK_WALL_GLOBALS.rbs"))
MedeekMethods.check_template_units
MedeekMethods.check_global_settings
MedeekMethods.check_layers
MedeekMethods.check_materials
Sketchup.load(File.join(this_dir,"MEDEEK_RECT_WALL_DICTIONARY.rbs"))
# Read Dictionary Attributes
MedeekMethods.read_dictionary @maingroup
# Execute Main Menu
corner1 = [0,0,0]
corner2 = [1,0,0]
corner3 = [1,1,0]
corner4 = [0,1,0]
@Wall_length_ft = @Wall_length/12.0
@Wall_length_m = @Wall_length_ft * @ft_m
@BuildingLength_ft = 10
@BuildingLength_m = @BuildingLength_ft * @ft_m
Sketchup.load(File.join(this_dir,"MEDEEK_RECTANGULAR_WALL.rbs"))
MedeekMethods.get_rect_wall_parameters
if @Advwalloptions == "YES"
Sketchup.load(File.join(this_dir,"MEDEEK_ADVOPTIONS_WALL.rbs"))
MedeekMethods.get_rect_wall_adv_options
if @Holdownoption == "YES"
Sketchup.load(File.join(this_dir,"MEDEEK_WALL_HOLDOWNS.rbs"))
MedeekMethods.get_holdown_options
end
if @Trimoption == "YES"
MedeekMethods.get_trim_options
end
end
MedeekMethods.check_user_materials
MedeekMethods.main_menu @BuildingLength_ft, @Wall_length_ft, @BuildingLength_m, @Wall_length_m, corner1, corner2, corner3, corner4
# Final Routines and Methods
@Winfamilylast = @Winfamily
# Data Logging
# Sketchup.load(File.join(this_dir,"MEDEEK_WINDOW_LOG.rbs"))
# MedeekMethods.write_window_log
end
}
dlg00.add_action_callback("GET_WINDOW_EDIT") {|action_context, params|
if params
params = params.to_s
plist = []
plist = params.split("|")
# puts "Basic List: #{plist}"
@Win_geom = plist[0]
@Win_loc_ftin = plist[1].to_l
# puts @Win_loc_ftin
@Win_loc = @Win_loc_ftin.to_f
@Win_width = plist[2].to_f
@Win_height = plist[3].to_f
@Win_header = plist[4]
@Win_headerhgt = plist[5].to_f
@Win_sill_num = plist[6].to_i
@Win_king_num = plist[7].to_i
@Win_trimmer_num = plist[8].to_i
@Win_sill_trimmers = plist[9]
@Win_ro_offset = plist[10].to_f
@Advwinoptions = plist[11]
if @Unitstemplate == "metric"
@Win_loc = @Win_loc * @mm_in
@Win_width = @Win_width * @mm_in
@Win_height = @Win_height * @mm_in
@Win_headerhgt = @Win_headerhgt * @mm_in
@Win_ro_offset = @Win_ro_offset * @mm_in
end
# UI.messagebox("Get Window Edit Fired: #{@Win_loc_ftin}")
else
# Basic Options Input Cancelled
exit 0
end
}
dlg00.add_action_callback("GET_WINDOW_EDIT_ADV") {|action_context, params|
if params
params = params.to_s
plist = []
plist = params.split("|")
# puts "Adv. List: #{plist}"
@Win_installoption = plist[0]
@Win_trimoption = plist[1]
@Win_casingoption = plist[2]
if @Unitstemplate == "metric"
# Nothing here yet
end
else
# Adv. Options Input Cancelled
exit 0
end
}
dlg00.add_action_callback("GET_WINDOW_EDIT_INS") {|action_context, params|
if params
params = params.to_s
plist = []
plist = params.split("|")
# puts "Install List: #{plist}"
@Win_installstyle = plist[0]
@Win_installloc = plist[1]
@Win_framewidth_install = plist[2].to_f
@Win_framedepth_install = plist[3].to_f
@Win_sashwidth_install = plist[4].to_f
@Win_sashdepth_install = plist[5].to_f
@Win_glassthk_install = plist[6].to_f
@Win_outset_install = plist[7].to_f
@Win_mullions_install = plist[8]
@Wininstallmat = plist[9]
@Winframematname = plist[10]
@Win_mulliondepth = plist[11].to_f
@Win_mullionwidth = plist[12].to_f
# Library Options
@Win_installmode = plist[13]
@Win_file = plist[14]
@Win_insertion = plist[15]
if @Unitstemplate == "metric"
@Win_framewidth_install = @Win_framewidth_install * @mm_in
@Win_framedepth_install = @Win_framedepth_install * @mm_in
@Win_sashwidth_install = @Win_sashwidth_install * @mm_in
@Win_sashdepth_install = @Win_sashdepth_install * @mm_in
@Win_glassthk_install = @Win_glassthk_install * @mm_in
@Win_outset_install = @Win_outset_install * @mm_in
@Win_mulliondepth = @Win_mulliondepth * @mm_in
@Win_mullionwidth = @Win_mullionwidth * @mm_in
end
else
# Install Options Input Cancelled
exit 0
end
}
dlg00.add_action_callback("GET_WINDOW_EDIT_TRM") {|action_context, params|
if params
params = params.to_s
plist = []
plist = params.split("|")
# puts "Trim List: #{plist}"
@Win_trimstyle = plist[0]
@Win_trimloc = plist[1]
@Win_headerwidth = plist[2].to_f
@Win_jambwidth = plist[3].to_f
@Win_sillwidth = plist[4].to_f
@Win_headerthk = plist[5].to_f
@Win_jambthk = plist[6].to_f
@Win_sillthk = plist[7].to_f
@Win_headerext = plist[8].to_f
@Win_sillext = plist[9].to_f
@Wintrimmat = plist[10]
@Wintrimmatname = plist[11]
if @Unitstemplate == "metric"
@Win_headerwidth = @Win_headerwidth * @mm_in
@Win_jambwidth = @Win_jambwidth * @mm_in
@Win_sillwidth = @Win_sillwidth * @mm_in
@Win_headerthk = @Win_headerthk * @mm_in
@Win_jambthk = @Win_jambthk * @mm_in
@Win_sillthk = @Win_sillthk * @mm_in
@Win_headerext = @Win_headerext * @mm_in
@Win_sillext = @Win_sillext * @mm_in
end
else
# Trim Options Input Cancelled
exit 0
end
}
dlg00.add_action_callback("GET_WINDOW_EDIT_CAS") {|action_context, params|
if params
params = params.to_s
plist = []
plist = params.split("|")
# puts "Casing List: #{plist}"
@Win_casingstyle = plist[0]
@Win_casingloc = plist[1]
@Win_headerwidth_casing = plist[2].to_f
@Win_jambwidth_casing = plist[3].to_f
@Win_apronwidth_casing = plist[4].to_f
@Win_jambextdepth_casing = plist[5].to_f
@Win_headerthk_casing = plist[6].to_f
@Win_jambthk_casing = plist[7].to_f
@Win_stoolthk_casing = plist[8].to_f
@Win_apronthk_casing = plist[9].to_f
@Win_jambextthk_casing = plist[10].to_f
@Win_headerext_casing = plist[11].to_f
@Win_stoolext_casing = plist[12].to_f
@Win_apronext_casing = plist[13].to_f
@Win_stoolproj_casing = plist[14].to_f
@Win_reveal_casing = plist[15].to_f
@Win_shim_casing = plist[16].to_f
@Wincasingmat = plist[17]
@Wincasingmatname = plist[18]
if @Unitstemplate == "metric"
@Win_headerwidth_casing = @Win_headerwidth_casing * @mm_in
@Win_jambwidth_casing = @Win_jambwidth_casing * @mm_in
@Win_apronwidth_casing = @Win_apronwidth_casing * @mm_in
@Win_jambextdepth_casing = @Win_jambextdepth_casing * @mm_in
@Win_headerthk_casing = @Win_headerthk_casing * @mm_in
@Win_jambthk_casing = @Win_jambthk_casing * @mm_in
@Win_stoolthk_casing = @Win_stoolthk_casing * @mm_in
@Win_apronthk_casing = @Win_apronthk_casing * @mm_in
@Win_jambextthk_casing = @Win_jambextthk_casing * @mm_in
@Win_headerext_casing = @Win_headerext_casing * @mm_in
@Win_stoolext_casing = @Win_stoolext_casing * @mm_in
@Win_apronext_casing = @Win_apronext_casing * @mm_in
@Win_stoolproj_casing = @Win_stoolproj_casing * @mm_in
@Win_reveal_casing = @Win_reveal_casing * @mm_in
@Win_shim_casing = @Win_shim_casing * @mm_in
end
else
# Roof Return Options Input Cancelled
exit 0
end
}
##########################################
dlg00.add_action_callback("CLOSE_DIALOG") {|action_context, params|
dlg00.close
}
# Find and show our html file
dlg00.set_file File.dirname(__FILE__) + "/html/web_dialog_editwindow.html"
dlg00.show
elsif @Wallfamily == "Gable"
else
UI.messagebox "Invalid wall type selected, action aborted."
return
end
##################
end
def get_window_library_files
this_dir=File.dirname(__FILE__)
# Fix for ruby 2.0
if this_dir.respond_to?(:force_encoding)
this_dir=this_dir.dup.force_encoding("UTF-8")
end
skpfiles = File.join(this_dir, "library/windows/*.skp")
@Window_library_list = Dir.glob(skpfiles)
if @Window_library_list.length > 0
@Window_library_string = 'NONE'
regex1 = /\/(?<onlyname>\w+)\.skp/i
for filename in @Window_library_list do
if matches = filename.match(regex1)
cleanfilename = matches[:onlyname]
@Window_library_string << ",#{cleanfilename}"
end
end
else
# No Custom Window Components in Library
end
end
end # << self
end # MedeekMethods Class
###########################
#
# Main Entry into Program
#
###########################
end # Wall
end # MedeekWallPlugin
end # Medeek Module