CedarCreek Posted September 29, 2023 Share Posted September 29, 2023 How do you access the Cabinet door width and height attributes that are used in size? We need to calculate the (door.width * door height) / 144 * sqPrice Link to comment Share on other sites More sharing options...
Chopsaw Posted September 29, 2023 Share Posted September 29, 2023 Something like this perhaps ? Link to comment Share on other sites More sharing options...
CedarCreek Posted September 29, 2023 Author Share Posted September 29, 2023 We're looking for the Cabinet door component attributes. Link to comment Share on other sites More sharing options...
Renerabbitt Posted September 29, 2023 Share Posted September 29, 2023 1 hour ago, CedarCreek said: We're looking for the Cabinet door component attributes. thats a bit more difficult. Panels are a collection. You'd have to know which panel you are referencing, say panel 0 for instance, then panels[0].formatted_size reports a string value of both width by height such as "23 7/8"x24 5/16"" for which you would need to split or index and convert to create your calcs. I have a system that prices out cabinets on the fly very accurately but its expensive...takes number of plywood sheets into account, panel sq ft, finish options, variables and a bunch more...can get pretty complex. You could write this macro and input it into your count. It totals all panels but has no conditional statements for false panels or slab vs shaker etc. # Copyright Rabbitt Design 2023 # INITIALIZE TOTAL SQUARE FOOTAGE VARIABLE total_sq_ft = 0.0 panels.each do |panel| # EXTRACT WIDTH AND HEIGHT FROM FORMATTED SIZE w, h = panel.formatted_size.split("x").map { |dim| dim.to_i } # CONVERT DIMENSIONS TO SQUARE FEET AND CALCULATE SQUARE FOOTAGE FOR EACH PANEL sq_ft = (w * h) / 144.0 # ACCUMULATE TOTAL SQUARE FOOTAGE total_sq_ft += sq_ft end # REPORT TOTAL SQUARE FOOTAGE total_sq_ft 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