Instance Macro used witn Custom Object Field Tied to Schedule


 Share

Recommended Posts

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.
 
462141260_3772577789676904_5874869335928301874_n.thumb.jpg.d30c9f91c601f5aa951e7df0886f7ce0.jpg
 
@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)},
]
 
No photo description available.
 
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

 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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share