mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 07:09:22 +00:00
Importing 2D elements of any arbitrary element is now supported
This commit is contained in:
@@ -208,7 +208,7 @@ class IfcImporter:
|
|||||||
self.profile_code("Create native products")
|
self.profile_code("Create native products")
|
||||||
self.create_products()
|
self.create_products()
|
||||||
self.profile_code("Create products")
|
self.profile_code("Create products")
|
||||||
self.create_empty_products()
|
self.create_empty_and_2d_elements()
|
||||||
self.profile_code("Create empty products")
|
self.profile_code("Create empty products")
|
||||||
self.create_type_products()
|
self.create_type_products()
|
||||||
self.profile_code("Create type products")
|
self.profile_code("Create type products")
|
||||||
@@ -589,14 +589,19 @@ class IfcImporter:
|
|||||||
break
|
break
|
||||||
print("Done creating geometry")
|
print("Done creating geometry")
|
||||||
|
|
||||||
def create_empty_products(self):
|
def create_empty_and_2d_elements(self):
|
||||||
for element in self.file.by_type("IfcProduct"):
|
curve_products = []
|
||||||
|
for element in self.file.by_type("IfcElement"):
|
||||||
if element.id() in self.added_data:
|
if element.id() in self.added_data:
|
||||||
continue
|
continue
|
||||||
if element.is_a("IfcPort"):
|
if element.is_a("IfcPort"):
|
||||||
continue
|
continue
|
||||||
if not element.Representation:
|
if not element.Representation:
|
||||||
self.create_product(element)
|
self.create_product(element)
|
||||||
|
else:
|
||||||
|
curve_products.append(element)
|
||||||
|
if curve_products:
|
||||||
|
self.create_curve_products(curve_products)
|
||||||
|
|
||||||
def create_annotation(self):
|
def create_annotation(self):
|
||||||
self.create_curve_products(self.file.by_type("IfcAnnotation"))
|
self.create_curve_products(self.file.by_type("IfcAnnotation"))
|
||||||
|
|||||||
Reference in New Issue
Block a user