mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 13:36:25 +00:00
Minor fix
This commit is contained in:
@@ -307,11 +307,7 @@ class IfcImporter():
|
|||||||
self.create_aggregate(rel_aggregate)
|
self.create_aggregate(rel_aggregate)
|
||||||
|
|
||||||
def create_aggregate(self, rel_aggregate):
|
def create_aggregate(self, rel_aggregate):
|
||||||
if rel_aggregate.Name:
|
collection = bpy.data.collections.new(f'IfcRelAggregates/{rel_aggregate.id()}')
|
||||||
name = rel_aggregate.Name
|
|
||||||
else:
|
|
||||||
name = rel_aggregate.RelatingObject.Name
|
|
||||||
collection = bpy.data.collections.new(f'IfcRelAggregates/{name}')
|
|
||||||
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
|
||||||
|
|
||||||
@@ -397,11 +393,7 @@ class IfcImporter():
|
|||||||
self.spatial_structure_elements[structure_name]['blender'].objects.link(obj)
|
self.spatial_structure_elements[structure_name]['blender'].objects.link(obj)
|
||||||
elif hasattr(element, 'Decomposes') \
|
elif hasattr(element, 'Decomposes') \
|
||||||
and element.Decomposes:
|
and element.Decomposes:
|
||||||
if element.Decomposes[0].Name:
|
collection = bpy.data.collections.get(f'IfcRelAggregates/{element.Decomposes[0].id()}')
|
||||||
name = element.Decomposes[0].Name
|
|
||||||
else:
|
|
||||||
name = element.Decomposes[0].RelatingObject.Name
|
|
||||||
collection = bpy.data.collections.get(f'IfcRelAggregates/{name}')
|
|
||||||
if collection:
|
if collection:
|
||||||
collection.objects.link(obj)
|
collection.objects.link(obj)
|
||||||
elif hasattr(element, 'HasFillings') \
|
elif hasattr(element, 'HasFillings') \
|
||||||
|
|||||||
Reference in New Issue
Block a user