If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

[Python & IfcOpenShell] To get the area of a wall

edited February 2023 in General

Hi, I am trying to get the total area (gross side area) of the walls like this:

for wall in model.by_type("IfcWall"):

... wall_type_qtos = ifcopenshell.util.element.get_psets(wall)
... wall_type_qtos
...
{'Analytical Properties': {'Absorptance': 0.7, 'Roughness': 3, 'id': 1519}, 'Construction': {'Function': 'Exterior', 'Width': 200.0, 'Wrapping at Ends': 'None', 'Wrapping at Inserts': 'Do not wrap', 'id': 1523}, 'Graphics': {'Coarse Scale Fill Color': 0, 'id': 1529}, 'Identity Data': {'Assembly Code': '', 'Assembly Description': '', 'Type Name': 'Generic - 200mm', 'id': 1532}, 'Other': {'Category': 'Walls', 'Family Name': 'Basic Wall', 'id': 1495, 'Family': 'Basic Wall: Generic - 200mm', 'Family and Type': 'Basic Wall: Generic - 200mm', 'Type': 'Basic Wall: Generic - 200mm', 'Type Id': 'Basic Wall: Generic - 200mm'}, 'Pset_WallCommon': {'IsExternal': True, 'id': 1561, 'Reference': 'Generic - 200mm', 'LoadBearing': False, 'ExtendToStructure': False}, 'Qto_WallBaseQuantities': {'Height': 6999.99999999998, 'Length': 9999.99999999998, 'Width': 200.0, 'GrossFootprintArea': 2.0, 'GrossVolume': 13999.9999999999, 'GrossSideArea': 69.9999999999997, 'NetSideArea': 59.6049999999997, 'NetVolume': 11.921, 'id': 1405}, 'Constraints': {'Base Offset': 0.0, 'Base Constraint': 'Level: Level 1', 'Base Extension Distance': 0.0, 'Base is Attached': False, 'Cross-Section': 'Vertical', 'Location Line': 'Wall Centerline', 'Related to Mass': False, 'Room Bounding': True, 'Top Constraint': 'Level: Level 3', 'Top Extension Distance': 0.0, 'Top is Attached': False, 'Top Offset': 0.0, 'Unconnected Height': 6999.99999999998, 'id': 1470}, 'Dimensions': {'Area': 59.6049999999997, 'Length': 9800.0, 'Volume': 11.921, 'id': 1487}, 'Phasing': {'Phase Created': 'New Construction', 'id': 1505}, 'Structural': {'Enable Analytical Model': False, 'Structural': False, 'Structural Usage': 'Non-bearing', 'id': 1511}, 'Pset_EnvironmentalImpactIndicators': {'Reference': 'Generic - 200mm', 'id': 1552}, 'Pset_ReinforcementBarPitchOfWall': {'Reference': 'Generic - 200mm', 'id': 1556}}

I have a list of propriety sets but I only need one value. I dont know how to get that value from the list. Any ideas?

Comments

  • This seems to be a basic Python question rather than anything specific to IFC / IfcOpenShell. Perhaps these types of Python dictionary tutorials can help? https://www.tutorialspoint.com/python/python_dictionary.htm

    Also note that you are not just getting back qtos, you're getting both qtos and psets. Try the qtos_only=True argument to limit your results to just qtos.

  • Added [Python & IfcOpenShell] prefix and categories to keep the forum useful and searchable.

Sign In or Register to comment.