We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-02-27 02:15 PM
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.
2023-03-20 04:04 PM
Hi everybody.
Here is an update of the script:
-Add the possibility to choose more than one layer
-Add the possibility to choose zone category codes instead of layers
-Add parameters for the use of calculated area or measured area, shown or real values.
2023-03-20 05:53 PM
So many good things about your script, beyond your giving it to the Archicad community. I'm very impressed with your clear, readable code with meaningful variable names and ample use of comments throughout to explain what is happening - in both English and French. Even for someone who may not need this script for their work, I really think it serves as an excellent advanced Python-in-Archicad tutorial because of the clarity of your code.
I will say that, not having used Python in Archicad and having only looked at the 'baby' samples, the length of your script (800 lines) was at first surprising until I read the code.
Thank you for sharing this!
2023-03-21 01:34 PM
Thanks for the nice message Karl.
I started learning and coding in python to modify this script originally written by Poco (whom I would like to thank by the way!).
I didn't know anything about Python at the time, and had only coded small objects in GDL until now.
There have been many iterations on this script, and it has been heavily reviewed by Poco who proposed many corrections to make the code cleaner.
The script part allowing to do the calculations is in itself quite short.
What makes it heavy are the comments as you pointed out, but especially the interface with Tkinter.
I was impressed by the possibilities of the python-archicad connection, even if it is still quite limited.
We can easily imagine functions coded by experienced users but used by users not initiated to code (thanks to the GUI), which makes the thing very interesting
I think that I will continue my tutorials on the archicad-python so that anybody can code this kind of script.
2023-11-17 07:47 AM
Great job!
2024-06-06 01:38 PM - last edited on 2024-06-10 03:05 PM by Laszlo Nagy
Hi, I don't know programming but I would like to learn how I could combine this script with another python script or use them both,
- 1st one is to sum up areas by zone number like shown in this post
- 2nd to measure % of areas with exact zone number according to a zone sum that will be taken as 100%
Here is better explanation what I mean:
And get something in table like this:
I am doing it in archicad but here I cannot set zone number property to get 100% into table, so I thought one can achieve it with Python.
Better explanation of the problem I run into - various 100% plots in a project:
I would need to define each plot area in Python as 100% for its zone number and then execute calculation of %, I thought it would be easy operation but I am having problem applying this in python script.
Would be grateful for any help! Thank you
2024-06-07 02:10 PM - edited 2024-06-07 02:30 PM
@magdak It seems possible, and the sum area script seems to be a good start. You'll have to study the code that is heavily commented
@Everybody: I updated the script in order to give feedback to the user: why the script didn't work, how to help correct it. All the feedback will appear ine the python console , like this :
If you used or like this script, please vote for any Python wish on the forum!
We need more development on it!
2024-08-28 11:46 AM
Hello Mathias!
Very big thank you for providing this script for free. I was struggling with a solution and with the archicad zone stamp tool for years. This solves nearly everything I could hope for.
If I may add one small wish if you still work on updating the script:
Could you add the option to select a custom property for the type of area to be used for calculation?
We sometimes need to use a reducing factor for certain room areas and we can only do this by using a custom property for calculating.
Would be very much appreciated!
2024-08-28 12:17 PM - last edited on 2024-08-28 11:41 PM by Laszlo Nagy
Hi pr3,
If the factor you're talking about is a percent value then you can do that directly in the Zone Tool.
Just use the "Reduce by:" field in Zone settings. (Keep in mind that you have to Update Zone for the reduction to take effect!).
Then just select Calculated Area in that marvelous tool that Mathias has created.
Below you can find the location of that setting:
2024-08-28 01:06 PM
I know you could do it this way but for some reason we abandoned this a few years ago and did id with a calculated property.
I just tired it now and it works just fine...
Thank you 😉