How to List All Available Properties in the Python API

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())

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

  1. Save the above script as e.g. list-all-available-properties.py
  2. Open Archicad and the Python Palette (I think the palette also guides you through installing Python in case you don’t have it)
  3. Navigate to the saved script and execute it

For a more detailed introduction to the Python API see this blog post by Graphisoft.

  1. There’s also a second type of properties which is not shown here: UserDefined. These are the properties you know from the Property Manager. ↩︎

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *