2023-02-27 02:15 PM
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
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.