ComputerMaster86 Posted October 4 Share Posted October 4 With my limited knowledge of ruby I am running into another issue I can't understand. Let's say I have 6 quantity of windows listed as one line item on a window schedule. Currently, it will run the instance macro and do the math formula calculation for the the first window of the line item but, create a second line item and not perform the macro calculation for the remaining 5 windows. In the end, it theoretically should still result in one line item. The result of the macro is going to be the same for all six windows. Very baffling. @rouSil = [ -> (thickA, thickB, height) {owner.bottom_elevation - owner.rough_opening_clearance_gap_bottom.round(1) + thickA.to_f.round(1) + thickB.to_f.round(1) + height.to_f.round(1)}, -> (thickA, thickB, height) {owner.bottom_elevation - owner.rough_opening_clearance_gap_bottom.round(4) + thickA.to_f.round(4) + thickB.to_f.round(4) + height.to_f.round(4)}, ] All 6 instances of the window are at the same rough sill height. My macro just does a simple math calculation where I can manually type in the concrete thickness and it adds that value to the rough sill distance. It spits out a vertical distance from bottom of grade board to top of rough sill. A value the builders can reference for framing the window openings.. For upper story windows, I manually type in three values. The lower floor concrete thickness, the lower level ceiling height and the upper level floor assembly thickness. It will do the same calculation and spit out a value. I just don't know why its creating another line item when the result of the macro is going to be the same for all six windows listed in the original single line item. Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 4 Share Posted October 4 Can you check all 6 windows to make sure there's nothing other than the macro in that field? Link to comment Share on other sites More sharing options...
ComputerMaster86 Posted October 4 Author Share Posted October 4 I revised my code (see below) and got it working to a point. It still is creating a seperate line item and runiing the macro for the first instance. I can open up that line item and then close the dialogue box and will force the macro two run. But I have to do that multiple times. Maybe I can get video footage of that. @sill = owner.bottom_elevation - owner.rough_opening_clearance_gap_bottom @rouSil = [ -> (thickA, thickB, height) { ( owner.bottom_elevation - owner.rough_opening_clearance_gap_bottom).to_f.round(4)}, -> (thickA, thickB, height) { ( owner.bottom_elevation - owner.rough_opening_clearance_gap_bottom).to_f.round(4) + thickA + thickB + height}, ] puts = @rouSil[1][4,0,0] 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