Got a minute? We appreciate your feedback:

Graphisoft Learn survey
Archicad Python API
About automating tasks in Archicad using the Python API.

Getting all property values of type 'Door' from Archicad 26 project (python)

noriksaroyan
Booster

Hi everyone! I'm new to both python and archicad API and I'm having troubles with retrieving property values of certain elements(doors, in this case). I would appreciate a little help.

I'm using archicad26 with python 3.8.9. The code I'm using is attached below

 

P.S. By saying properties i mean height, width, type(single-leaf, double-leaf, sliding, and revolving doors), thickness, material(leaf and frame: for example, wood, glass, metal), оperation(swing direction, pivot point  and rotation angle), Hardware(placement of glazing). 

 

Thanks in advance! 

11 REPLIES 11

Hi, I guess that's because those are properties defines by me. Please use the 

act.BuiltInPropertyUserId and delete lines 23 to 26 (or use your own properties).

Solution

In reference to including properties in a Json file: I have included an example for anyone interested. It is really just a couple of lines. i did not brother to include all the properties mentioned, I'll leave that to you, as I think there are enough examples out there. I just picked a few from the previous examples. Note that Graphisoft's data availability is so 'screwy' that finding all of the properties is always a chore.

 

Basically one creates a Python dictionary and then converts that to a Json file which is just a one line function. Note that only the standard units can be converted (strings,int,float,arrays,bools, etc.). See the documentation.

This bring up a problem in that, some properties in Archicad return a object not a standard unit. One would have to iterate to the standard unit in those cases. That is why I just converted all the responses to a string-- see the example. If this would not be acceptable, then you would have to dig deeper.

BTW  -- a better route might be to just create a schedule and then dump it to a excel file in Archicad

 

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 26

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!