mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
Fix bug where copying a type also copied its type relations which is invalid.
This commit is contained in:
@@ -79,6 +79,22 @@ class Collector(blenderbim.core.tool.Collector):
|
||||
|
||||
@classmethod
|
||||
def _get_collection(cls, element, obj):
|
||||
if element.is_a("IfcTypeObject"):
|
||||
collection = bpy.data.collections.get("Types")
|
||||
if not collection:
|
||||
collection = bpy.data.collections.new("Types")
|
||||
project_obj = tool.Ifc.get_object(tool.Ifc.get().by_type("IfcProject")[0])
|
||||
project_obj.users_collection[0].children.link(collection)
|
||||
return collection
|
||||
|
||||
if element.is_a("IfcOpeningElement"):
|
||||
collection = bpy.data.collections.get("IfcOpeningElements")
|
||||
if not collection:
|
||||
collection = bpy.data.collections.new("IfcOpeningElements")
|
||||
project_obj = tool.Ifc.get_object(tool.Ifc.get().by_type("IfcProject")[0])
|
||||
project_obj.users_collection[0].children.link(collection)
|
||||
return collection
|
||||
|
||||
aggregate = ifcopenshell.util.element.get_aggregate(element)
|
||||
if aggregate:
|
||||
aggregate_obj = tool.Ifc.get_object(aggregate)
|
||||
|
||||
Reference in New Issue
Block a user