License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

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

Python and Morph

Joze Marinko
Booster

I want pull out areas from morph.

code is:

from Archicad import ACConnection

conn = ACConnection.connect()
assert conn

acc = conn.commands
act = conn.types
acu = conn.utilities

 

klasifikacijaGP = acu.FindClassificationItemInSystem('Urbanizem','Gradbena parcela')
elementiGP = acc.GetElementsByClassification(klasifikacijaGP.classificationItemId)
obmocjeGP = acu.GetUserDefinedPropertyId('Gradbena parcela','Območje')

povrsinaGP = acu.GetBuiltInPropertyId('Morph_FloorPlanAreaByStory')

obmocjeSeznamGP = [(acc.GetPropertyValuesOfElements(elementiGP,[obmocjeGP])[i].propertyValues[0].propertyValue.value) for i in range(len(elementiGP))]
povrsinaSeznamGP = [(acc.GetPropertyValuesOfElements(elementiGP,[povrsinaGP])[i].propertyValues[0].propertyValue.value) for i in range(len(elementiGP))]


In variable "povrsinaSeznamGP" I expect list of areas 😞 But I got error message. What is wrong? 

2 REPLIES 2
poco2013
Mentor

FYI:

Graphisoft reported this issue as a bug. You can not obtain the area for all stories with this function. It will be fixed in a future release -- if they get to it (IMHO)?

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Gerry, thanks for replay.