cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
davidevianello
Participant

Python Get Building Materials

Hi all,

I'm tring to do my first Python programm running in Archicad.

Everything stops at the beginning with this command:

 

building_materials = acc.GetBuildingMaterials()
 

it aswer "AttributeError: 'Commands' object has no attribute 'GetBuildingMaterials'"

 

I need it to retrive the material index with the floowing commands:

 

BUILDING_MATERIAL_NAME = "Estrich + Parkett 15 cm"
for bm in building_materials:
    if bm.name == BUILDING_MATERIAL_NAME:
        bm_index = bm.index
        break
 

Thank you in advance

1 Reply 1
runxel
Moderator

Hi Davide, welcome to the forum!

 

There is no command "GetBuildingMaterials", only "GetBuildingMaterialAttributes". Maybe that solves this already.

Let me also recommend you Tapir; which is not a replacement but enhances the capabilities of the Python connection drastically.

Lucas Becker | AC 29 on Mac (Sequoia) | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | 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»

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!