Archicad Python API
About automating tasks in Archicad using the Python API.

Python question

Mats_Knutsson
Advisor
Hi,
No python forum yet so I post here instead.
I had a look at the example script "Excel File Exporter" and would like to add some building material properties but I don't understand the syntax. The property is for example:

UserDefinedPropertyUserId {'localizedName': ['GENERELLA (Byggmaterial)', 'Densitet'], 'type': 'UserDefined'}

I don't know how to get this one to work.

I look at the example with builtin property and as an example:

act.BuiltInPropertyUserId("General_Thickness")

Obviously, I need to add a bit more for the user-defined property but I don't know the syntax? I basically want to export the density and CO2 of the BM's used in the model.
Br,
Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
7 REPLIES 7
runxel
Legend
There seems currently no way to get that information?!

If you see at the list of all available properties: the Bmat ain't one of it.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Mats_Knutsson
Advisor
runxel wrote:
There seems currently no way to get that information?!

If you see at the list of all available properties: the Bmat ain't one of it.
So what does this mean?
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
runxel
Legend
Mats_Knutsson wrote:

So what does this mean?
That are the user defined PROPERTIES. They are (of course) localized and you can access them directly by the name you have set.
This means, you could do a new property and set the bmat there, again. Seems like this is the only way at the moment. Not a nice one, tho.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Mats_Knutsson
Advisor
runxel wrote:
Mats_Knutsson wrote:

So what does this mean?
That are the user defined PROPERTIES. They are (of course) localized and you can access them directly by the name you have set.
This means, you could do a new property and set the bmat there, again. Seems like this is the only way at the moment. Not a nice one, tho.
I want to export BM properties to excel.
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
runxel
Legend
Mats_Knutsson wrote:

I want to export BM properties to excel.
Yeah I think you can't do that with Python at the moment.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Mats_Knutsson
Advisor
runxel wrote:
Mats_Knutsson wrote:

I want to export BM properties to excel.
Yeah I think you can't do that with Python at the moment.
"#&%¤"#""#&¤"/#&... crap. Thanks anyways!
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
Boling1
Contributor
I have tried excel export.py, it works well, but I need to export more attributes like story number,building material :
propertyUserIds = [
    act.BuiltInPropertyUserId("General_ElementID"),  #通过types对象的BuiltInPropertyUserId方法,获取梁和墙的元素ID
    act.BuiltInPropertyUserId("General_Height"),         #original
    act.BuiltInPropertyUserId("General_Width"),          #original
    act.BuiltInPropertyUserId("General_Thickness"),  #original
    act.BuiltInPropertyUserId("Story_number"),            #wrong code,I add----------------------------
    act.BuiltInPropertyUserId("Building_Material")       #wrong code,I add----------------------------
]
I want get the element's story number,building material,but this code can't work,how can I get these info?
ArchiCAD 25