Test module ifc_query from github:DURAARK/pyIfcExtract

This forum section is only for IFC-related issues
Mohamed Safaa
Posts: 5
Joined: Tue Oct 31, 2017 3:07 pm

Re: Test module ifc_query from github:DURAARK/pyIfcExtract

Post by Mohamed Safaa »

this is a sample file that i want to extract its properties
Attachments
2x3Mohamed.ifc
(12.65 KiB) Downloaded 43 times
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: Test module ifc_query from github:DURAARK/pyIfcExtract

Post by chakkree »

wall = 40.5, 0.666667, 20

I'm not sure, This extract's data is correct.
unit in this IFC file is 'FOOT'


Code: Select all

import ifcopenshell

testFile = 'D:\\temp\\2x3Mohamed.ifc'
ifc_file = ifcopenshell.open(testFile)

products = ifc_file.by_type("IfcWall")
wall1 = products[0]
# wall1.attribute_name(1)
shape = getattr(wall1,'Representation')
repr = getattr(shape,'Representations')
ExtrudedSolids=getattr(repr[1],'Items')
solid1 = ExtrudedSolids[0]
Area = getattr(solid1,'SweptArea')
XDim = getattr(Area,'XDim')
YDim = getattr(Area,'YDim')
Depth = getattr(solid1,'Depth') 
Msg('%g,  %g,  %g\n'%(XDim , YDim ,Depth ))
"""
40.5,  0.666667,  20
"""
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Test module ifc_query from github:DURAARK/pyIfcExtract

Post by bernd »

chakkree wrote: Thu Nov 02, 2017 3:07 pm
Mohamed Safaa wrote: Thu Nov 02, 2017 9:54 am Hello, i want to know how to get the attributes like height, width and length using pyIfcExtract ?
I' think ifcOpenShell can be used instead.

Can you upload IFC sample file that you want to get attributes?
+1 IfcOpenShell should be used.

on an multilayered wall this might not what one really would like to have ...

Allplan--mulitlayer_Wall--no_Window.ifc
(8.7 KiB) Downloaded 40 times

BTW: Mohamend, a tip for further questions on the forum.Iif your question is not related to the topic it is better to open a new topic.
Post Reply