The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussion of non-graphical data: Properties, Property Expressions, Classifications, Interactive Schedules

Moderators: Barry Kelly, Karl Ottenstein, LaszloNagy, ejrolon, gkmethy

By Jeffrey Shan
#285058
Hi,
I tried to use AC22 expression function to do a zone area calculation but I didn't success. Hoping someone can solve my question.

If I have zone A (50m2) and zone B (100m2), zone A need to be divided by zone B like this (50/100 x 100=50%). So how can I get this done?

Many Thanks.
User avatar
By Barry Kelly
#285060
Unfortunately zone A has no idea about zone B so can't compare sizes.

There is a similar post here ... viewtopic.php?f=34&t=61912

Barry.
User avatar
By poco2013
#285063
You may be under a misunderstanding:

expressions can only address properties for one element at a time. You can not introduce areas for two different zones in one expression since the error control feature will detect that for any area in which the expression is being evaluate, that one of the areas will not be valid for that element so the whole expression will be invalid. This is because properties contain a GUID which prevents name collisions between similar names of different elements.

There is a workaround but too cumbersome - IMNOHO.
Basically you need three expressions one each to return the area of each zone. This solves the problem of having more than one element property type in one expression. Then a third expression to do the calculation.

Zone cal for each zone to return its area;

IF ( {Property:General Parameters/Element ID} = "ZONE-01", {Property:Zone/Calculated Area}, 0 ft2 )
IF ( {Property:General Parameters/Element ID} = "ZONE-02", {Property:Zone/Calculated Area}, 0 ft2 )
returns area - data type

Final cal:

CONCAT ( STR ( ( {Property:expressions/Zone02} / {Property:expressions/Zone01} * 100 ), 0 ), "%" )
returns string

The expression classifications must match the elements. This only works if the expression are only applicable (limited) to zones 1 &2 which you can do via custom classifications.

As I said somewhat unreasonable limitation. better to just get out your calculator and pencil?
By Jeffrey Shan
#285086
Hi poco2013, thanks for providing me with the expression. I will test them later.
I agree with what you said, it is too cumbersome. I'll continue to use Excel to do my area schedule.
By DavorP
#285133
I was initially very happy to hear that users will be able to do math operations is ArchiCAD. First blow was finding out that it does not work like Excel formulas. Second blow was finding out that you can't calculate between different elements, as described above. So even though it is a move in a good direction, it is not fully useful.

However, there is a workaround for calculations involving site area. Enter the site area in project info. Then create an expression where you use string to number conversion because ArchiCAD does not treat site area in project info as number, but as text. Since the site area should not change, you should only have to enter it once.

https://helpcenter.graphisoft.com/guide ... /strtonum/
User avatar
By Barry Kelly
#285137
DavorP wrote:
Wed Aug 15, 2018 6:53 am
However, there is a workaround for calculations involving site area. Enter the site area in project info. Then create an expression where you use string to number conversion because ArchiCAD does not treat site area in project info as number, but as text. Since the site area should not change, you should only have to enter it once.
You can do the same to compare zone areas to an overall building area.
Or for any element value that you want to compare to a 'master' value.

An alternative to using the project info (and having to convert to a numeric value) is to create a 'value' property with the master figure you want.
Then associate that property with the element type you are trying to calculate.
If you want to change the master figure you just change it in the Property Manager.
Unfortunately the master property can be changed in each element - it can't be locked - we have asked for this option.
If it is changed you will see the symbol changes to a custom value and it is easy to change it back to default.

property_custom_value.jpg
property_custom_value.jpg (11.14 KiB) Viewed 752 times

I think this is a better option, especially when we can get Graphisoft to allow us to lock a property.
I don't think there will be too much danger in users changing the default in each zone (or other elements) though, so it should be fairly safe if unlocked.
When you are amending the 'master' value in the property manager, you will know if an element has been changed from default.

property_custom_value_2.jpg

Remember, you can't lock the project info either.

Barry.
By JSN
#293065
Thx for providing this workaround - however, I could not get this to work - I can inherit the Areas of Zone 1 and 2, but only if I am establishing 2 new Properties and then expression nr. 3 is not working as I cannot access the values from zones from another element - but maybe I just don't get the essential trick so maybe you can provide more information (maybe screens?) on the following part of expression nr- 3

>>> ( {Property:expressions/Zone02} / {Property:expressions/Zone01}

In my created schedule other element's values are always 0 (because that's what expressions 1 and 2 are returning if the zone ID is not matching)

Appreciate any support - thx
(Actually I don't want the ratio of my zones but an auto-sum of specific zones which belong together to one department and it would be great to have this "DepartmentArea" beside the individual "Calculated Area, Measured Area ..." as a Property in all of those zones - so if there is another (easier) solution on that I am open to any support - btw, using the International Version which does not have the TOP stamp feature.

Best,

poco2013 wrote:
Tue Aug 14, 2018 5:35 am
You may be under a misunderstanding:

expressions can only address properties for one element at a time. You can not introduce areas for two different zones in one expression since the error control feature will detect that for any area in which the expression is being evaluate, that one of the areas will not be valid for that element so the whole expression will be invalid. This is because properties contain a GUID which prevents name collisions between similar names of different elements.

There is a workaround but too cumbersome - IMNOHO.
Basically you need three expressions one each to return the area of each zone. This solves the problem of having more than one element property type in one expression. Then a third expression to do the calculation.

Zone cal for each zone to return its area;

IF ( {Property:General Parameters/Element ID} = "ZONE-01", {Property:Zone/Calculated Area}, 0 ft2 )
IF ( {Property:General Parameters/Element ID} = "ZONE-02", {Property:Zone/Calculated Area}, 0 ft2 )
returns area - data type

Final cal:

CONCAT ( STR ( ( {Property:expressions/Zone02} / {Property:expressions/Zone01} * 100 ), 0 ), "%" )
returns string

The expression classifications must match the elements. This only works if the expression are only applicable (limited) to zones 1 &2 which you can do via custom classifications.

As I said somewhat unreasonable limitation. better to just get out your calculator and pencil?