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

BuildingMaterial

plastotronic
Participant

Hello there,

 

in order to automatically retrieve the ThermalResistance in various elements, i wonder how to deploy the value from ThermalConductivity, found in BuildingMaterials for calculating the Value by the Thickness of the material.

 

Since i am completely new to python in Archicad, i guess using "act.BuildingMaterialAttribute" would be a proper way. So i ask for a way to read the needed value and put it into the elements.

6 REPLIES 6
poco2013
Mentor

@plastotronic wrote:

 i guess using "act.BuildingMaterialAttribute" would be a proper way. So i ask for a way to read the needed value and put it into the elements.


That would get you the Building Material Type. but your wanting to get a attribute for a particular Building Material - Thermal Conductivity. Unfortunately , you can not presently do that in Python scripts right now. This is because Python can only retrieve properties from elements and a building material is a attribute not a element.

 

However, This can be done via the C++ Add-Ons. I have created such a add-On which will return all the attributes of any defined building material to a Python script via the CommandHandler function. But the Add-On is currently written for the 26 release and therefore will not be available until the release of 26 -- due shortly. It can not be re-compiled for 25 since changes have been made between the 25 &26 API's.

 

One Note -- the C++ API always returns values in metric units (Watt/meter C), so if your are using imperial units, you'll have to convert.

 

I have also created the Python script which does exact;y as you described, if your interested, I'll release the add-on and the the script after 26 is released??

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Thank you very much, this would be great!

 

Best regards - Reinhard

Hi Gerry,

 

Now I got my Archicad 26 and want to ask, if you would send me the add-on and Python-Script as mentioned?

 

Best regards - Reinhard

poco2013
Mentor

The Add-On and script are posted on my GitHub site:

GitHub Site 

 

The Add-On is data_access and the example script is GetBM.py. The script just displays the Material in a dialog. -- You will need to modify the data as needed. Compiled only fot Archicad 26.

 

 

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Dear Gerry,

thank you so much for access to your ressources, unfortunately my Archicad version is German, so i cannot load the apx into it since ist seems to be compiled in EN.

so, what to do?

 

Best Regards - Reinhard

 

Hi Gerry,

 

I just figured out, that it is now possible in Archicad 26 to assign the Value of ThermalTransmission of the BuildingMaterial direct to the PSet_Parameter, which was not possible in the previous versions. But if there was a way for accessing it via Python in the German Version, it would be a good extension in the whole Pipeline.

 

Best Regards - Reinhard