mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-15 18:14:08 +00:00
Aggregate metadata is now imported (attributes / psets / types / etc)
This commit is contained in:
@@ -224,16 +224,16 @@ class IfcImporter():
|
|||||||
self.calculate_unit_scale()
|
self.calculate_unit_scale()
|
||||||
self.create_project()
|
self.create_project()
|
||||||
self.create_spatial_hierarchy()
|
self.create_spatial_hierarchy()
|
||||||
|
self.purge_diff()
|
||||||
|
self.create_type_products()
|
||||||
if self.ifc_import_settings.should_import_aggregates:
|
if self.ifc_import_settings.should_import_aggregates:
|
||||||
self.create_aggregates()
|
self.create_aggregates()
|
||||||
if self.ifc_import_settings.should_import_opening_elements:
|
if self.ifc_import_settings.should_import_opening_elements:
|
||||||
self.create_openings_collection()
|
self.create_openings_collection()
|
||||||
self.purge_diff()
|
|
||||||
self.parse_native_products()
|
self.parse_native_products()
|
||||||
self.filter_ifc()
|
self.filter_ifc()
|
||||||
self.patch_ifc()
|
self.patch_ifc()
|
||||||
self.create_groups()
|
self.create_groups()
|
||||||
self.create_type_products()
|
|
||||||
self.create_grids()
|
self.create_grids()
|
||||||
# TODO: Deprecate after bug #682 is fixed and the new importer is stable
|
# TODO: Deprecate after bug #682 is fixed and the new importer is stable
|
||||||
if self.ifc_import_settings.should_use_legacy:
|
if self.ifc_import_settings.should_use_legacy:
|
||||||
@@ -773,15 +773,17 @@ class IfcImporter():
|
|||||||
collection = bpy.data.collections.new(f'IfcRelAggregates/{rel_aggregate.id()}')
|
collection = bpy.data.collections.new(f'IfcRelAggregates/{rel_aggregate.id()}')
|
||||||
bpy.context.scene.collection.children.link(collection)
|
bpy.context.scene.collection.children.link(collection)
|
||||||
bpy.context.view_layer.layer_collection.children[collection.name].hide_viewport = True
|
bpy.context.view_layer.layer_collection.children[collection.name].hide_viewport = True
|
||||||
|
element = rel_aggregate.RelatingObject
|
||||||
|
|
||||||
instance = bpy.data.objects.new('{}/{}'.format(
|
obj = bpy.data.objects.new('{}/{}'.format(element.is_a(), element.Name), None)
|
||||||
rel_aggregate.RelatingObject.is_a(),
|
obj.instance_type = 'COLLECTION'
|
||||||
rel_aggregate.RelatingObject.Name),
|
obj.instance_collection = collection
|
||||||
None)
|
self.place_object_in_spatial_tree(element, obj)
|
||||||
instance.instance_type = 'COLLECTION'
|
self.add_element_attributes(element, obj)
|
||||||
instance.instance_collection = collection
|
self.add_element_document_relations(element, obj)
|
||||||
self.place_object_in_spatial_tree(rel_aggregate.RelatingObject, instance)
|
self.add_defines_by_type_relation(element, obj)
|
||||||
self.aggregates[rel_aggregate.RelatingObject.GlobalId] = instance
|
self.add_product_definitions(element, obj)
|
||||||
|
self.aggregates[element.GlobalId] = obj
|
||||||
|
|
||||||
def create_openings_collection(self):
|
def create_openings_collection(self):
|
||||||
collection = bpy.data.collections.new('IfcOpeningElements')
|
collection = bpy.data.collections.new('IfcOpeningElements')
|
||||||
|
|||||||
Reference in New Issue
Block a user