@@ -77,10 +77,11 @@ def __init__(self):
7777 self .geometry = GeometryIO ()
7878 self .configuration ()
7979
80- def configuration (self , file_destination = "output.ifc" , name_attribute = None , split = True ):
80+ def configuration (self , file_destination = "output.ifc" , name_attribute = None , split = True , lod = None ):
8181 self .properties ["file_destination" ], self .properties ["file_extension" ] = os .path .splitext (file_destination )
8282 self .properties ["name_attribute" ] = name_attribute
8383 self .properties ["split" ] = split
84+ self .properties ["lod" ] = lod
8485
8586 def convert (self , city_model ):
8687 self .city_model = city_model
@@ -92,7 +93,9 @@ def convert(self, city_model):
9293 # scale=self.properties["local_scale"])
9394 # self.build_vertices()
9495 self .create_IFC_classes ()
95- if self .properties ["split" ]:
96+ if self .properties ["lod" ]:
97+ self .write_file ()
98+ elif self .properties ["split" ]:
9699 self .write_files ()
97100 else :
98101 self .write_file ()
@@ -190,7 +193,6 @@ def write_files(self):
190193 IFC_copied_model = ifcopenshell .open (file )
191194 IFC_copied_model_sub_contexts = IFC_copied_model .by_type ('IfcGeometricRepresentationSubContext' )
192195 for sub_context in IFC_copied_model_sub_contexts :
193- print (sub_context )
194196 if sub_context .id () == sub_context_id :
195197 continue
196198
@@ -230,7 +232,7 @@ def create_IFC_classes(self):
230232 IFC_shape_representations = []
231233 for geometry in obj .geometry :
232234 lod = geometry .lod
233- if str (lod ) != '1.3' : # TODO: split LODS
235+ if self . properties [ "lod" ] is not None and str (lod ) != self . properties [ "lod" ]:
234236 continue
235237 if str (lod ) not in self .IFC_representation_sub_contexts :
236238 self .IFC_representation_sub_contexts [str (lod )] = self .create_representation_sub_context (lod )
0 commit comments