==================================================================== COPY AND PASTE TEXT BELOW THE ===== INTO THE TMM EDITOR AFTER HITTING THE NEW BUTTON and Name it Roof_Plane_Label , I have it Evaluated > ref. Object currently ==================================================================== ############################################################## # # MACRO CODE BY FORUM MEMBER --- BROWN TIGER --- Many Thanks # # EDITED BY MICK AKA KBIRD1 ON CA FORUMS # ##https://chieftalk.chiefarchitect.com/topic/20097-ruby-enumerating-objects-list-of-rooms-areas-or-sq-ft/ #or #https://chieftalk.chiefarchitect.com/topic/24014-q-how-do-i-get-control-over-the-macro-generated-text-on-a-roof-plane/ # # Place this "Collector" Macro into the Roof Plane's Label and then use the # roof_Sqft_Area Macro in a Text Box or Rich Text Box with Leader Line # or in a 3 Column Schedule converted to Text. (best looking) # ############################################################## referenced ? obj = referenced : obj = owner if $tree.nil? $tree = Hash.new { |hash, key| hash[key] = {} } end id="p" + obj.object_id.to_s pitch = obj.automatic_label area = (obj.surface_area).ceil areasq = ( obj.framing_area / 100.0 ).ceil slope = obj.angle.round(2) #slope = (Math.atan2(obj.pitch,12.0)*180.0/Math::PI).round(2) ALT Slope Formula #unless $tree['roofplanes'].has_value?(id) items = Hash.new() items['roof_plane']=id items['pitch']=pitch items['area']=area items['areasq']=areasq $tree['roofplanes'][id]=items #end indx = $tree['roofplanes'].keys.find_index(id) result = "Roof Plane No# : " + (indx+1).to_s + "\n" result += "Roof Area Sqft : " + area.to_s + " sqft" + "\n" result += "Roof Area Total Sqs : " + areasq.to_s + " sq" + "\n" result += "Roof Pitch : " + pitch + "\n" result += "Slope Angle : " + slope.to_s + "°\n" result