Unfortunately the Archicad Python API is very limited. The main limitation is, that you cannot change much in an Archicad model. But one thing you can change are properties! And quite a few different features are actually accessible as so called built-in Properties. Which allow for example to change zone numbers or retrieve the renovation filter set for an element. But how do you know which properties are even available?
One Command to Show Them All
There is already a command in the Python API that can list all the available properties for you. Try this simple script:
from pprint import pprint from archicad import ACConnection conn = ACConnection.connect() pprint(conn.commands.GetAllPropertyNames())
Never miss Add-On updates, special price offers or an article! Sign up for the newsletter and you’ll receive roughly one mail per week from me (occasionally more when there’s a special price upcoming).
Reading the Output
The last step is to interpret the resulting output. As an example, here are all the built-in properties for Zones:
... BuiltInPropertyUserId {'nonLocalizedName': 'Zone_CalculatedArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_MeasuredArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WindowsSurfaceArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_DoorsSurfaceArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WallsSurfaceArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_DoorsWidth', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WindowsWidth', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WallsPerimeter', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_NetPerimeter', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_Perimeter', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_FloorThickness', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_UniformSurface', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ZoneName', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ZoneNumber', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ZoneCategoryCode', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_AreaReducement', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ExtractedColumnArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ExtractedFillArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ExtractedLowArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ExtractedWallArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_NetArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ReducedArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_TotalExtractedArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WallInsetBackSideSurfaceArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WallInsetSideSurfaceArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_WallInsetTopSurfaceArea', 'type': 'BuiltIn'}, BuiltInPropertyUserId {'nonLocalizedName': 'Zone_ExtractedCurtainWallArea', 'type': 'BuiltIn'}, ...
Each row shows one built-in property (indicated by 'type': 'BuiltIn'
)1. And you use the value of the nonLocalizedName
for other API commands to reference that specific property. E.g. use Zone_ZoneName
to access the (you guessed it) name of the zone.
How to Run this Yourself
- Save the above script as e.g.
list-all-available-properties.py
- Open Archicad and the Python Palette (I think the palette also guides you through installing Python in case you don’t have it)
- Navigate to the saved script and execute it
For a more detailed introduction to the Python API see this blog post by Graphisoft.
- There’s also a second type of properties which is not shown here:
UserDefined
. These are the properties you know from the Property Manager. ↩︎
Leave a Reply