Python - Handling Zone information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-03-15 06:10 AM - edited 2022-03-15 06:42 AM
I've been starting to dive into the Python integration in order to put up a few routines regarding zone information in our firm. I'm a little bit familiar with the programming language itself, but I'm clueless on how to get the info from the elements.
I'm starting out with this, to get a list of all Zones in the project. Then there's a few things I need to be able to access in each of those zones. Which are:
- Zone name
- Layer to which they belong
- Calculated area
- Zone category
- Home Story index
- Home Story name
I'm not even sure if such information is available through the Python integration, though, in case they are, it would be good if I could, inside that 'element' loop assign them to variables so I can handle them across the code.
I hope there's a way to do such. Thanks in advance! 🙂
Archicad 27 / Windows 11 64
Solved! Go to Solution.
- Labels:
-
Automation (Python or JSON)
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-03-16 11:09 AM - edited 2022-03-16 11:10 AM
Hi Pedro,
There was a discussion about this a few months ago which I think is relevant for what you want to do: https://community.graphisoft.com/t5/Developer-forum/Home-Story-Name-in-Python/m-p/31298
It boils down to 2 solutions:
- Make expression properties which return the home story name and/or home story index
- Make a C++ add-on which exposes additional API commands to Python (see for example https://github.com/tlorantfy/Archicad-additional-json-commands)
The first option is easier to realize but needs extra steps in each project. The second option needs additional expertise with C++ Add-Ons.
Best, Bernd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-03-16 04:47 AM
Updates on my own thread 😅
Apparently all those worked:
They were put out correctly at the listener:
Although, as it seems, there is no Built-in property available to get the Home Story Index. I think I'll handle that by doing a comparison between the elevation to Project Zero and the Project's Story elevation
Anyone has directions on how to obtain those Home Story info?
Archicad 27 / Windows 11 64
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-03-16 11:09 AM - edited 2022-03-16 11:10 AM
Hi Pedro,
There was a discussion about this a few months ago which I think is relevant for what you want to do: https://community.graphisoft.com/t5/Developer-forum/Home-Story-Name-in-Python/m-p/31298
It boils down to 2 solutions:
- Make expression properties which return the home story name and/or home story index
- Make a C++ add-on which exposes additional API commands to Python (see for example https://github.com/tlorantfy/Archicad-additional-json-commands)
The first option is easier to realize but needs extra steps in each project. The second option needs additional expertise with C++ Add-Ons.
Best, Bernd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-03-16 11:35 PM
Indeed, I'm for now going through this direction. Since the routines I mentioned are meant to be used only inside our firm, I think having the need to configure custom properties won't be an issue.
Thanks for the response 🙂
Archicad 27 / Windows 11 64