ChiefuserMathews Posted October 12, 2021 Share Posted October 12, 2021 Hello again, could some experts help me with this ruby macro. What I am trying to achieve is I need to find out the glazing (glass) area of a window. My formula is opening width minus 6 inch x opening height minus 6 inch to get the glazing area which I can add to my label. Your help is much appreciated. Link to comment Share on other sites More sharing options...
ChiefuserMathews Posted October 12, 2021 Author Share Posted October 12, 2021 ENLARGED WINDOW %FormattedWidthNearestInch%x%FormattedHeightNearestInch%x%bottom_elevation%A.F.FL. GLAZING AREA PROVIDED %(height*width).round(2)% This is what I have now in my label for a window which is wrong Link to comment Share on other sites More sharing options...
Doug_N Posted October 12, 2021 Share Posted October 12, 2021 If I am understanding your question you are trying to remove the window frame and sash from the window width and height to get unobstructed glass area. %((width-6.in)*(height-6.in)).round(1)% will give you the result in sq ft rounded to 1/10th of a sq ft. If you are using a window schedule, be sure to turn off using a call out for the window schedule dialog box. In that case you should add something like [%schedule_number%] %width% x %height% Glazing Area %((width-6.in)*(height-6.in)).round(1)% And that would give you Link to comment Share on other sites More sharing options...
ChiefuserMathews Posted October 12, 2021 Author Share Posted October 12, 2021 13 minutes ago, Doug_N said: If I am understanding your question you are trying to remove the window frame and sash from the window width and height to get unobstructed glass area. Thank Doug, that's exactly what I am trying to achieve. You are awesome. Thank you so much. Link to comment Share on other sites More sharing options...
Doug_N Posted October 12, 2021 Share Posted October 12, 2021 Hey Wilson, you're welcome. Link to comment Share on other sites More sharing options...
JacobB Posted October 13, 2021 Share Posted October 13, 2021 The macro %(width-6.in)*(height-6.in)% will only work if you never change the frame or sash parameters. If you want it to work for even if the frame or sash is changed use the following macro: %(width-2*frame_side_width-2*sash_side_width-2*sash_depth/8)*(height-frame_top_width-frame_bottom_width-sash_top_width-sash_bottom_width-2*sash_depth/8)% If you want it to subtract the middle sash you'll have to set up the following user defined macro: # currently gets the area where light can pass through the window # remove sash_edging_width from this macro to get the total glass area # currently doesn't account for: # - pass through windows do not have a sash # - louvered and glass louvered windows do not have shash edging # - shaped windows, corner windows, etc. obj = owner obj = referenced unless referenced.nil? is_sliding_wind = (obj.type_code == "SH" or obj.type_code == "DH" or obj.type_code == "LS" or obj.type_code == "RS" or obj.type_code == "TS") is_wind_components_vertical = (obj.type_code == "SH" or obj.type_code == "DH" or obj.type_code == "AW" or obj.type_code == "FA" or obj.type_code == "TA" or obj.type_code == "HO" or obj.type_code == "FH" or obj.type_code == "TH") num_wind_components = 1 if obj.type_code == "SH" or obj.type_code == "DH" or obj.type_code == "LS" or obj.type_code == "RS" or obj.type_code == "DC" or obj.type_code == "FA" or obj.type_code == "FH" num_wind_components = 2 elsif obj.type_code == "TS" or obj.type_code == "TC" or obj.type_code == "TA" or obj.type_code == "TH" num_wind_components = 3 end num_sash_middle_components = num_wind_components - 1 sash_edging_width = obj.sash_depth / 8 #this is how far the glass is inset into the sash (angled section of the sash) actual_sash_side_width = obj.sash_side_width + sash_edging_width actual_sash_top_width = obj.sash_top_width + sash_edging_width actual_sash_bottom_width = obj.sash_bottom_width + sash_edging_width actual_sash_middle_width = obj.sash_middle_width * (is_sliding_wind ? 1 : 2) + 2 * sash_edging_width total_sash_h_width = 2 * actual_sash_side_width + (is_wind_components_vertical ? 0.in : actual_sash_middle_width * num_sash_middle_components) total_sash_v_width = actual_sash_top_width + actual_sash_bottom_width + (is_wind_components_vertical ? actual_sash_middle_width * num_sash_middle_components : 0.in) result = (obj.width - 2*obj.frame_side_width - total_sash_h_width) * (obj.height - obj.frame_top_width - obj.frame_bottom_width - total_sash_v_width) result 3 Link to comment Share on other sites More sharing options...
Doug_N Posted October 13, 2021 Share Posted October 13, 2021 Jacob Great macro! Thanks for the lesson! Doug Link to comment Share on other sites More sharing options...
winterdd Posted October 13, 2021 Share Posted October 13, 2021 Yeah, all of this info is WAY above my pay grade lol. That's some Good Will Hunting type shiznit. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now