enter image description here This is a part of my ifcfile. In this file, I want to extract the 'ifcpolyline' attribute to get a slab's coordinates in 'Ifccartesianpoint'.
import ifcopenshell
# IFC 파일 열기
ifc_file = ifcopenshell.open("C:/Users/Juyoung Lee/Documents/카카오톡 받은 파일/ifc_file.ifc")
# IfcSlab 객체 추출
slabs = [elem for elem in ifc_file.by_type("IfcSlab") if 'S' in elem.ObjectType]
for slab in slabs:
rep = slab.Representation
if rep is not None:
for item in rep.Representations:
if item.is_a("IFC2X3.IfcShapeRepresentation") and item.RepresentationType == "SweptSolid":
print(f"SweptArea: {item.Items}")
shape = item.Items[0] # 첫번째 아이템을 가져옴
if shape.is_a("IFC2X3.IfcExtrudedAreaSolid") and shape.SweptArea.is_a("IFC2X3.IfcPolyline"):
print(f"IfcPolyline: {shape.SweptArea}")
polyline = shape.SweptArea
points = polyline.Points
for point in points:
x = point.Coordinates[0]
y = point.Coordinates[1]
z = point.Coordinates[2]
print(f"({x}, {y}, {z})")
And this is my code. There's no result. What's the problem and how can I extract below information using python? enter image description here
I want to extract some slab's coordinates. In that case, I want to extract 6coordinates that is written in 'IFCCARTESIANPOINT.