Empty list of quantity sets in IFC-file (Ifcopenshell) #2914
Unanswered
elisemunche
asked this question in
Q&A
Replies: 2 comments 10 replies
-
Quantities (and property sets) are not guaranteed to populated in a model (or generated consistently for that matter). Luckily ifcopenshell provides the tooling to generate a lot of quantities from the geometry. https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/util/shape.py |
Beta Was this translation helpful? Give feedback.
2 replies
-
I see, thank you!
I have been playing around with the code for a while now but cant seem to understand how to extract the cross section areas and the length of the elements using the library. May I ask if you have any ideas?
From: Thomas Krijnen ***@***.***>
Sent: Tuesday, March 28, 2023 1:58 PM
To: IfcOpenShell/IfcOpenShell ***@***.***>
Cc: Elise Munch-Ellingsen ***@***.***>; Author ***@***.***>
Subject: Re: [IfcOpenShell/IfcOpenShell] Empty list of quantity sets in IFC-file (Ifcopenshell) (Discussion #2914)
The result of geom.create_shape() / geom.iterator.get (with USE_PYTHON_OPENCASCADE to false, which is the default).
>> import ifcopenshell.geom
>> import ifcopenshell.util.shape
>> f = ifcopenshell.open('acad2010_walls.ifc')
>> elem = ifcopenshell.geom.create_shape(ifcopenshell.geom.settings(), f.by_type('IfcElement')[0])
>> ifcopenshell.util.shape.get_volume(elem.geometry)
0.9425983811263173
—
Reply to this email directly, view it on GitHub<#2914 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A5TC3P26RALODHBZ34MYAA3W6LG53ANCNFSM6AAAAAAWKK6Z3Y>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I am trying to write a code that extracts the quantity sets from an IFC-file for IfcBeam and IfcColumn.
I have this code that works perfectly for most of the IFC files I have tried:
import ifcopenshell
from ifcopenshell import util
ifc_path = r"C:\Users\elisemun\Documents\GitHub\vsc_test\test_ifc_revit.ifc"
ifc_file = ifcopenshell.open(ifc_path)
all_elements=ifc_file.by_type("IfcBuildingElement")
#Wanted element types
LB_elements = []
for element_type in ['IfcBeam', 'IfcColumn']:
LB_elements.extend(ifc_file.by_type(element_type))
#Qtos (Quantity set)
info_elements= [ifcopenshell.util.element.get_psets(element,qtos_only=True) for element in LB_elements]
However, I have some IFC files that give me the result info_elements=[ {},{},{}.....{}]. I assume this means that there is no value here with the method I am using. When looking in the IFC files that do not work with my code, I cant seem to find the entities (amongst others): IfcQuantityArea and IfcQuantityLength, like I can in the files that do work.
So my question is, does anyone know how I can reach the quantities in such a file by using Ifcopenshell?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions