Floor area macro without needing a polyline


Recommended Posts

This macro uses the "living Area" label to calculate area. To use this you must have the "living area" label shown (there are quite a few posts on how to show it, and get it back if you delete it)

 

couple things. If you want outside wall square footage, you must ensure all rooms are included in the calculation, including stairwells. do this in the room specification dialog->General->Living Area

 

CA by default excludes "open to below rooms" which are also stairwells.

This also assumes you put basements on floor zero, main floor on floor 1, second on floor 2. if you do more stories or do not follow this convention, you will need to alter the macro

 

In this neck of the woods, 99% of house have basements, and square footage is calculated to outside wall (counts stairs twice). However here, basement square footage is usually "living space"

 

Step 1: create a macro titled "floorarea"  (Context: Owner Object, Evaluate: Checked) with the following:

 

if owner.function=="Living Area" and owner.floor_number==1 then

$firstfloorarea=owner.standard_area.round(0).to_s

 

elsif owner.function=="Living Area" and owner.floor_number==0 then

 

$basementfloorarea=owner.standard_area.round(0).to_s

 

elsif owner.function=="Living Area" and owner.floor_number==2 then

 

$secondfloorarea=owner.standard_area.round(0).to_s

 

else

""

end

""

 

Click Edit->Default Settings->Floors and Rooms->Room Label

In "text" select from the macro select "floorarea" from user defined list

 

Then create a macro called allarea and put in the following:

$totalliving=$firstfloorarea.to_i + $secondfloorarea.to_i + $basementfloorarea.to_i

 

if $secondfloorarea.to_i ==0

printstring="Main Floor Area: " + $firstfloorarea + "\nLower Level Finished Area: " + $basementfloorarea + "\nTotal Area: " + $totalliving.to_s + " sq ft"

else

printstring="Main Floor Area: " + $firstfloorarea + "\tSecond Level Area: " + $secondfloorarea + "\nLower Level Finished Area: " + $basementfloorarea + "\nTotal Area: " + $totalliving.to_s + " sq ft"

 

end

 

 

 

Then put %allarea% into a text box. result is

 

image.png.4a7b50b60fa42f0bcba3aa50119bf3c1.png

The above assumes you always have a basement. If not adjust the logic, or simply do the formatting in the text box

 

the typical macro limitations apply, where, , if you change the outside walls,  you will have to click through on the floor plan levels in order to update the global variables i.e. the macro for each floor does not fire until you view that floor with the "living area" label on it.

 

 

Probably not a solution for all, but at least there are no polylines, and no need to modify polylines (or do the footprint function) after a wall is changed

 

I did notice one time I deleted the "living area" label and could not get it back using any of the techniques documented. But it only happened once.

 

I actually extended this macro to write the areas to a file in the plan directory, to guarantee the global variable is not picked up or overwritten by another open plan. The allarea macro then reads it back from the file. Probably overkill.

 

But if you ever want to test global variable behaviour, open up two plans and have the above text box on a CAD detail for each. move the wall on one plan, and then go directly to the text box on the other plan. you will notice the other plan's text box will update with the the first plan's area. You can lessen the impacts by putting the text box on the floor plan instead. but if you adjust the basement on one plan and then goto the main floor on the other, and if this text box is there, it will update with the first one's basement value.

 

For the polyline option others do, I believe some people put the polyline for all levels on the same level or CAD detail to avoid this problem

 

 

 

 

 

  • Upvote 1
Link to post
Share on other sites
2 hours ago, jasonN said:

the typical macro limitations apply, where, , if you change the outside walls,  you will have to click through on the floor plan levels in order to update the global variables i.e. the macro for each floor does not fire until you view that floor with the "living area" label on it.

 

You can avoid this problem by simply creating a unique Saved Plan View where all other relevant floors are displayed as Reference Floors.  Place your area tabulation macro in that view and you won't need to toggle through floors.

 

As a side note, I should warn you that this particular approach you're talking about can work just fine but only as long as you are very careful to follow your own rules.  For example, if you add a second floor you'll have to adjust your macro definition.  If you add a third floor you'll have to adjust your macro definition.  If you remove a floor you'll have to adjust your macro definition.  If you break the room giving your current floor no area, your tabulation macro will still display the old value even though the area should be zero.  If any of your floors has multiple independent floor areas your tabulation macro will only use the most recently defined.  If you decide you want to display deck areas or garage areas, your coding requirements just got a lot more complicated, and again...you have to redefine your macros.

 

Anyway, you can get all sorts of areas automatically tabulated using the same general approach you've spelled out....all using actual room information and no polylines.  BUT BUT BUT, the more advanced your system, the more complex the macros are to write, and the more you have to make sure you're following all the rules as defined by your specific system.  This is what leads most of us to just use polylines.  They're far more easily customizable, super flexible, and don't require nearly as much coding complexity making them really easy for almost anyone to learn how to use.  Yes you have to adjust the polylines with any changes to the plan but using the other alternatives you're really just shifting the maintenance from the polyline shapes themselves to the aforementioned macros and specific operational procedures.  At least with polylines you can get some quick and easy visual feedback so you know exactly where your various areas are coming from. 

 

 

pic5.png

pic4.png

pic3.jpg

pic2.jpg

pic1.jpg

Link to post
Share on other sites

Just taking a quick look at this, I'd consider accumulating values in an array making the macro self adjusting for number of floors.

 

$sf[owner.floor_number.to_i]=owner.standard_area.to_s

 

 

Then (and I know puts won't work in Chief) to print the array starting with index of 1 (floor 1) to the end of the array.

 

$sf[1..-1].each { |s| puts s }

  • Upvote 1
Link to post
Share on other sites
8 hours ago, Alaskan_Son said:

You can avoid this problem by simply creating a unique Saved Plan View where all other relevant floors are displayed as Reference Floors.  Place your area tabulation macro in that view and you won't need to toggle through floors.

so it's interesting. I did a little test. I have the autobuild foundation on, so I can change the basement without looking at it to see the behaviour. I put the label on the floor plan, and put this on layout. I then change a wall on the main floor. The main floor area in the label will change, but not the basement. As is expected. I then went to layout on the main page (where I have the main floor plan, cropped to just the label) The label still shows the basement with the old value. I then click print and select the pages, which includes the basement and main floor. The box then gets updated. So it looks like the action of printing (or probably more likely the review that happens in the print dialog), the values get updated. Thats quite good. I think then 99.9% of the time it would get updated, just put the label on the floor plan view (instead of the CAD detail) and then send this to the first page of layout for the square footage summary. 

 

I do need to play around with the presaved reference floors. Today I just use the toolbar button. If the reference displays guaranteed it, that would be the best approach

 

but for this:

9 hours ago, Alaskan_Son said:

As a side note, I should warn you that this particular approach you're talking about can work just fine but only as long as you are very careful to follow your own rules.  For example, if you add a second floor you'll have to adjust your macro definition.  If you add a third floor you'll have to adjust your macro definition.  If you remove a floor you'll have to adjust your macro definition

I dont understand, the macro has three levels built in and checks to see if there is a second level before summarizing, so if you have a second level you automatically get:

image.png.c0b8334f034138a6dfa74efdbd16de8a.png

 

 

If I remove, for instance,the second level AFTER I created it. then the global variable for the second floor does not get set to zero, and then still shows the second level. So a bit of a problem. I added a "resetareas" which just sets them back to zero. So if I ever design a house with three floors and then move back to 2, then I will have to do this. But that might be 1% of the time. The other 99% would seem to work.

 

But it I add it back in it is correct. This means for the 99% of the time that the number of floors is known, it will work

9 hours ago, Alaskan_Son said:

If you break the room giving your current floor no area, your tabulation macro will still display the old value even though the area should be zero.

 

I tried this:

I broke the exterior wall, and the living area label went to 64 sq ft (stairwell probably), my text box mimicked it. I then built it out

image.thumb.png.74f3349d5107e546088e5dec4be38fc0.png

 

the living area went back up, and so did my label. Essentially if the LIVING AREA is "correct", the text box will be correct

 

I did the same for the second floor and it went to zero (as I do not yet have a stairwell), but I suppose a question would be, why would you ever have a broken exterior wall?

 

So the next thing is of course parcel coverage, which you have layed out above

 

For us, building coverage excludes decks, patios. There is no requirement here to stipulate patios, decks, covered decks, etc outside of the dimensions on the plan. i.e. there is no calculation of summation of area required. only individual areas and setbacks.

 

As the living area does not include garage, and there is the whole double count the wall problem, then I think the CA footprint function (or draw your own polyline) would need to be done. I need to experiment with it to see how it does main floor cantilevers, as here those are including in parcel coverage

 

 

 

 

 

Link to post
Share on other sites
3 hours ago, solver said:

Just taking a quick look at this, I'd consider accumulating values in an array making the macro self adjusting for number of floors.

 

$sf[owner.floor_number.to_i]=owner.standard_area.to_s

I think that would be a less typo prone way and would be better. which btw I had a typo in the post in the macro and had to go edit the post

Link to post
Share on other sites
11 minutes ago, jasonN said:

The main floor area in the label will change, but not the basement.

It just needs a screen redraw.  Like I mentioned in one of your other threads....

 

  

On 5/9/2021 at 12:20 PM, Alaskan_Son said:

as a general rule, there needs to be a screen redraw/refresh of some sort  in order for macros to update.  This could be panning/zooming, but it also happens when you print.

 

Link to post
Share on other sites
2 hours ago, Alaskan_Son said:
3 hours ago, jasonN said:

The main floor area in the label will change, but not the basement.

It just needs a screen redraw.  Like I mentioned in one of your other threads....

 

in this case it does not update because the lower level "living Area" presumably has not updated as I had not gone down to that floor (and I dont have the reference display setup as you suggested), this is why I thought it was "expected". I can zoom in, move walls on that main floor level, the lower level sq footage in my text box will not change. If I go down a level and back up, it changes the basement sq footage accordingly. Presumably the go down to the basement fires the macro in the  "living area" label, at which point the logic in the macro sees it is level 0 and updates the basement area to the living area

 

What was interesting on the print, is that it executed the macro in the plan, where in that other post  I was trying to get the layout macro to execute on Layout. So I think in the print preview, when it shows the basement plan, this little redraw in the print preview window fires the living area macro. It's interesting because the little windows in the print preview does not show the updated areas, but the printed copy does

 

It's good news as it guarantees whenever you print (as long as you include the floor plans for all levels), the area in the text box will be correct. It's a nice failsafe, as I would expect that 99.9% of the time, I would actually be reviewing the basement level (after any outside wall changes) and the label would update anyway. So I think, other than the design 3 storeys and then delete a storey use case, the normal use case would be correct 99.99% of the time 

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Member Statistics

    29634
    Total Members
    9156
    Most Online
    Q34BD-D7J3T-EDLD
    Newest Member
    Q34BD-D7J3T-EDLD
    Joined