aggregate.assign_object - support batching #4474

This commit is contained in:
Andrej730
2024-04-08 16:23:48 +05:00
parent b106d6a4d1
commit 833f67cf45
34 changed files with 187 additions and 143 deletions
+3 -3
View File
@@ -179,7 +179,7 @@ class IFC_Sv_write_file(bpy.types.Operator):
if not (spatial.is_a("IfcSite") or spatial.is_a("IfcBuilding")) and (spatial not in elements_in_buildings):
elements = ifcopenshell.util.element.get_decomposition(spatial)
ifcopenshell.api.run(
"aggregate.assign_object", file, product=spatial, relating_object=file.by_type("IfcBuilding")[0]
"aggregate.assign_object", file, products=[spatial], relating_object=file.by_type("IfcBuilding")[0]
)
for building in file.by_type("IfcBuilding"):
@@ -202,7 +202,7 @@ class IFC_Sv_write_file(bpy.types.Operator):
if len(file.by_type("IfcSite")) == 0:
ifcopenshell.api.run("root.create_entity", file, ifc_class="IfcSite", name="My Site")
ifcopenshell.api.run(
"aggregate.assign_object", file, product=building, relating_object=file.by_type("IfcSite")[0]
"aggregate.assign_object", file, products=[building], relating_object=file.by_type("IfcSite")[0]
)
try:
if file.by_type("IfcSite")[0].Decomposes[0].RelatingObject.is_a("IfcProject"):
@@ -212,7 +212,7 @@ class IFC_Sv_write_file(bpy.types.Operator):
ifcopenshell.api.run(
"aggregate.assign_object",
file,
product=file.by_type("IfcSite")[0],
products=[file.by_type("IfcSite")[0]],
relating_object=file.by_type("IfcProject")[0],
)
self.file = file
@@ -135,7 +135,7 @@ class SvIfcAddSpatialElement(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.h
ifcopenshell.api.run(
"aggregate.assign_object",
self.file,
product=items,
products=[items],
relating_object=result,
)
else:
@@ -188,7 +188,7 @@ class SvIfcAddSpatialElement(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.h
ifcopenshell.api.run(
"aggregate.assign_object",
self.file,
product=added_element,
products=[added_element],
relating_object=result,
)
else:
+3 -3
View File
@@ -93,7 +93,7 @@ class SvIfcWriteFile(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.Sv
ifcopenshell.api.run(
"aggregate.assign_object",
file,
product=spatial,
products=[spatial],
relating_object=file.by_type("IfcBuilding")[0],
)
@@ -120,7 +120,7 @@ class SvIfcWriteFile(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.Sv
ifcopenshell.api.run(
"aggregate.assign_object",
file,
product=building,
products=[building],
relating_object=file.by_type("IfcSite")[0],
)
try:
@@ -131,7 +131,7 @@ class SvIfcWriteFile(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper.Sv
ifcopenshell.api.run(
"aggregate.assign_object",
file,
product=file.by_type("IfcSite")[0],
products=[file.by_type("IfcSite")[0]],
relating_object=file.by_type("IfcProject")[0],
)
self.file = file