Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

Bypass Calculation Units in Expressions

RandyC
Advocate
Is there a way to bypass calculation units in expressions ?

I am trying to find a way to make an expressions that calculates both Acres and Hectares
but calculation units defeat me and only one or the other works. Is there a way ?
ArchiCAD 4.5 --- 27 , Win 10 , dual monitors, 64 gb ram,Nvidia GeforceRTX 2080 TI, I-9
10 REPLIES 10
Minh Nguyen
Graphisoft Alumni
Graphisoft Alumni
Hi Randy,

Thank you for your question!

Could you elaborate a bit more on what do you want to achieve here? Are you setting up just one expression that will convert the zone area to hectare and acre, or these are 2 different expressions? If I may ask, why won't you set up different expressions for different purposes (ie: convert square meter to hectare or acre if calculation rule is square meter/square feet?), as in the screenshot below?

Thank you for your help! Looking forward to hearing from you soon!

Best regards,
Minh

Minh Nguyen
Technical Support Engineer
GRAPHISOFT

RandyC
Advocate
i Want a zone stamp that shows both Acres and Hectares
I am creating two different expressions one for hectares and one for acres
however Expressions will not show both correctly when calculation units are set to sq.ft.

I do not want to have any formula that can create two different answers.

I suppose I need to find an expression that converts measured area to metric only ?
ArchiCAD 4.5 --- 27 , Win 10 , dual monitors, 64 gb ram,Nvidia GeforceRTX 2080 TI, I-9
poco2013
Mentor
FYI:

Respectfully: I believe your not getting a answer because you are not submitting enough information as to your configuration.

For example: are you returning a number in your expression and canceling units OR are you using areas?

You should be aware that Archicad uses Meters for all internal calculations, However, if imperial is selected, Archicad will convert back and forth to metric from imperial automatically. You can not mix units except by using the conversion notations as this may confuse the system. if number is used for return,the number returned is done in metric which is probably why if metric is used originally there is no confusion.

I say this because I double checked the expressions using your scenario and it works perfectly for me.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
RandyC
Advocate
confusing , I am using Areas --

so I suspect we cannot have a zone stamp that shows two results in different dimensions

I can do this if I use GDL as per attached zone stamp.
I am sure I am missing something obvious with expressions .

Were you able then to make a zone stamp that shows both areas metric and imperial at the same time ?
ArchiCAD 4.5 --- 27 , Win 10 , dual monitors, 64 gb ram,Nvidia GeforceRTX 2080 TI, I-9
poco2013
Mentor
Using Cal Units set to sq ft for all expressions:

(expression) Areas for sq ft and acres are as normal with return type of area

(expression) Area for hectares -- set return type to number and cancel out units then convert to hectares from sq ft.

((Measured Area/ 1 ft2) * 0.092903)/10000

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Minh Nguyen
Graphisoft Alumni
Graphisoft Alumni
Hi Randy,

I think the answer here is that: the expression calculation is based on the units set in Calculation Units & Rules. It is not possible to set up an expression that will work correctly regardless of unit setting.

In this case, if the area is set to use square meter:
- HA: Measured area/10000
- Acre: Measured area/4046.85

if the area is set to use square feet (thanks to Gerry's suggestion!)
- Acre: Measured area/43560
- HA: ((Measured Area/ 1 ft2) * 0.092903)/10000 (set return type to number and cancel out units then convert to hectares from sq ft.)

Let me know if this is the answer that you're looking for!

Best regards,
Minh

Minh Nguyen
Technical Support Engineer
GRAPHISOFT

RandyC
Advocate
Thank you mnguyen and poco2013

I was able to make it work by converting all Areas to numbers that was what I needed
( sorry I was slow on the uptake ) with this I should also be able to get FSR working as well.
Thanks, again.

Works despite of calculation settings.
ArchiCAD 4.5 --- 27 , Win 10 , dual monitors, 64 gb ram,Nvidia GeforceRTX 2080 TI, I-9
Minh Nguyen
Graphisoft Alumni
Graphisoft Alumni
Hi Randy,

Glad it worked out for you in the end!

Have a nice day, and stay safe!

Best regards,
Minh

Minh Nguyen
Technical Support Engineer
GRAPHISOFT

Laszlo Nagy
Community Admin
Community Admin
Randy,
Would you care to make screenshots of the exact Property Expressions you used?
This way anyone reading this thread would see them. It would make a great example for future reference.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28