mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 00:07:53 +00:00
Only parse selected types, not all types in the type collection
This commit is contained in:
@@ -101,8 +101,7 @@ class IfcParser():
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
def get_type_products(self):
|
def get_type_products(self):
|
||||||
types_collection = self.get_types_collection()
|
if not self.selected_types:
|
||||||
if not types_collection:
|
|
||||||
return []
|
return []
|
||||||
return [{
|
return [{
|
||||||
'ifc': None,
|
'ifc': None,
|
||||||
@@ -110,12 +109,7 @@ class IfcParser():
|
|||||||
'class': self.get_ifc_class(object.name),
|
'class': self.get_ifc_class(object.name),
|
||||||
'representation': self.get_representation_reference(object.data.name),
|
'representation': self.get_representation_reference(object.data.name),
|
||||||
'attributes': self.get_object_attributes(object)
|
'attributes': self.get_object_attributes(object)
|
||||||
} for object in types_collection.objects ]
|
} for object in self.selected_types ]
|
||||||
|
|
||||||
def get_types_collection(self):
|
|
||||||
for collection in bpy.data.collections:
|
|
||||||
if self.is_a_types_collection(self.get_ifc_class(collection.name)):
|
|
||||||
return collection
|
|
||||||
|
|
||||||
def get_representation_reference(self, name):
|
def get_representation_reference(self, name):
|
||||||
return [ r['attributes']['Name'] for r in self.representations ].index(name)
|
return [ r['attributes']['Name'] for r in self.representations ].index(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user