Service alert: BIMcloud SaaS disruption in the US Read more

Archicad Python API
About automating tasks in Archicad using the Python API.

[PYTHON] Sum area script

Hi everybody!

 

I developped a python script that sum the zone area  with the help of Poco.

 

The script sum all zone of the same zone number and put the result in a custom property. You just have to retrieve the value with a label (example file in the zip).

 

The custom property has to be to string type.

The scrip uses the measured area.

 

SCHEMA.png

 

Capture d’écran 2023-02-27 à 13.52.21.png 

Archicad 27 - GDL - PYTHON
19 REPLIES 19

Glad it worked!

 

There's nothing wrong with using a calculated property to be honest, if you're keeping track of all the created Properties when working with multiple files regarding one project. It can be a nightmare... That's why I tend to minimize the number of Custom Properties and try to find a way to use built-in solutions.

 

I'm still waiting for Graphisoft to address the need to have a centralized file for Attributes, Properties etc. across multiple files. Ability to create Company Standard Files is something I'm really hoping to get resolved soon.

Łukasz Pietraszko
ArchiCAD 26 PL, since AC20 | WIN 10 Home
Intel Core i7-7700HQ 2.8 GHz | 16 GB RAM | NVIDIA GeForce GTX 1060 6 GB | 500 GB SSD

Well as long as Graphisoft continues to add new features that barely make it to 80% done in the first place and

never updates the old features and removes any bugs I just lost hope at this point.

Thats what brought me here in the first place because the zone stamp tool is a real nightmare.

Archicad 28 | Mac Studio | OS 14.6
magdak
Booster

I really hoped Archicad 28 could count % of areas with new update! 😅 Without need of learning to code in Python 😓

I think that even if graphisoft offer a new tool, it won't be able to answer 100% of our worflow on the matter, it is so diverse!

Archicad 27 - GDL - PYTHON

Hello everyone,

 

New version of the script!

I updated my sum area script (it puts the sum of all area with the same identifier in a custom property in each of the affected zones).

 

I also made a "translation" system : the script will check the language code (FRA for the french version for example) and will verify if there is a corresponding file in the parameters folder. For example, translations_FRA for the french version, and will use this file to change the script language.

 

I strongly advise you to install the opensource/free Tapir plugin for archicad, which provides a palette to launch the script, here: https://github.com/ENZYME-APD/tapir-archicad-automation?tab=readme-ov-file#archicad-add-on 

 

New in V3:

-New option: only takes into account zones with a certain custom property value.
-New interface that automatically loads previously used parameters.

 

Capture d’écran 2025-06-04 à 09.24.34.png

 


New option: three script launch modes: silent, light pop-up (number of zones updated), full report (for debugging/verification) but slow.

Capture d’écran 2025-06-04 à 09.24.15.png

 

Here is a little video presentation: 

 

 

Archicad 27 - GDL - PYTHON
magdak
Booster

Hi, thank you a lot for providing the updated script 😍

 

I run into a problem, probably you could explain to me what I am missing... I created a custom property for Zones with the name Total and string data type

but after running a script, I don't get the sum value automatically added to that property... what could be the problem? The classification is attached to zones.

Is it because of no translation for my language?

 

2025-06-05 162204.png

 

2025-06-05 163754.png

 

These are the results I expected to see in the Total property:

 

magdak_1-1749134681725.png

 

Another thing, do you think is it possible and not so hard to exchange these 2 parameters? 

So the script sums up all zones according to the zone category code doing so for all zone numbers... so i.e. all categories 02 with number 1 give the sum

 

magdak_0-1749134396469.png

 

Thank you in advance for help🙏

 

 

I don't intend to add this precise workflow to the script, but you probably could use  custom properties to achieve the same result:

-Custom property for the apartment number, retrieving category code 

-Selecting all layers or categories in the zone/layer part

-Use a custom property in the "additional Zone selection Parameter(Advanced Parameters). This custom property could be True False : If Category code is 01,02 or 03 then true; if not, then false. 

 

Do you have an error in the archicad report window after clicking on the apply changes button? Can you share the report?

Archicad 27 - GDL - PYTHON

After I click on apply changes I get: 

 

magdak_0-1749194487570.png

 

And the number appears in the total property now, but I don't know how to attach it onto the label for each zone...

How do you get for each zone type different amount of Total on the label? 

 

 


@magdak wrote:

And the number appears in the total property now but I don't know how to attach it onto label for each zone...

How do you get for each zone type different amount of Total on the label? 


I don't really understand. How do I display the total in plan? I'm using a classic text/autotext label that retrieve the custom property. 

You can use the script with different settings and tell the script to put the result in 2 or more different custom properties. Then, you juste have to update your label to retrieve those 2+ custom properties.

Archicad 27 - GDL - PYTHON

Ohh, I forgot I have basic zone stamp that didn't offer this label property. When I change it to the complex zone stamp then it works well... 

but is it possible to get these each stamps onto the layout? To make a Table there with all Totals listed together.