mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Add aggregate constraints to import_ifc.py
This commit is contained in:
committed by
Bruno Perdigão
parent
cf9446c4a5
commit
7f838f81b4
@@ -257,6 +257,7 @@ class IfcImporter:
|
||||
self.place_objects_in_collections()
|
||||
self.profile_code("Place objects in collections")
|
||||
self.setup_arrays()
|
||||
self.setup_aggregates()
|
||||
self.profile_code("Setup arrays")
|
||||
tool.Project.load_linked_models_from_ifc()
|
||||
self.profile_code("Load linked models")
|
||||
@@ -1118,6 +1119,16 @@ class IfcImporter:
|
||||
tool.Blender.Modifier.Array.set_children_lock_state(element, i, True)
|
||||
tool.Blender.Modifier.Array.constrain_children_to_parent(element)
|
||||
|
||||
def setup_aggregates(self):
|
||||
elements = set(self.file.by_type("IfcElement"))
|
||||
for element in elements:
|
||||
parts = ifcopenshell.util.element.get_parts(element)
|
||||
if parts:
|
||||
relating_obj = tool.Ifc.get_object(element)
|
||||
if relating_obj:
|
||||
tool.Aggregate.constrain_parts_to_aggregate(relating_obj)
|
||||
|
||||
|
||||
def lock_scales(self) -> None:
|
||||
elements = set(self.file.by_type("IfcProduct"))
|
||||
while elements:
|
||||
|
||||
Reference in New Issue
Block a user