mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 23:00:53 +00:00
removed the pset and added group to all elements
This commit is contained in:
@@ -907,30 +907,7 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator):
|
|||||||
self.group_name = "Linked Aggregate"
|
self.group_name = "Linked Aggregate"
|
||||||
old_to_new = {}
|
old_to_new = {}
|
||||||
|
|
||||||
# TODO Maybe this will be unnecessary after Refresh refactor
|
|
||||||
def add_assembly_data(element):
|
|
||||||
|
|
||||||
data_to_add = {
|
|
||||||
"instance_of": [element.GlobalId],
|
|
||||||
}
|
|
||||||
data = [data_to_add]
|
|
||||||
|
|
||||||
pset = ifcopenshell.api.run(
|
|
||||||
"pset.add_pset", tool.Ifc.get(), product=element, name="BBIM_Linked_Aggregate_Data"
|
|
||||||
)
|
|
||||||
|
|
||||||
ifcopenshell.api.run(
|
|
||||||
"pset.edit_pset",
|
|
||||||
tool.Ifc.get(),
|
|
||||||
pset=pset,
|
|
||||||
properties={"Data": json.dumps(data)},
|
|
||||||
)
|
|
||||||
|
|
||||||
def select_objects_and_add_data(element):
|
def select_objects_and_add_data(element):
|
||||||
pset = ifcopenshell.util.element.get_pset(selected_element, "BBIM_Linked_Aggregate_Data")
|
|
||||||
if not pset: # TODO Is this still necessary?
|
|
||||||
add_assembly_data(element)
|
|
||||||
|
|
||||||
add_linked_aggregate_group(element)
|
add_linked_aggregate_group(element)
|
||||||
obj = tool.Ifc.get_object(element)
|
obj = tool.Ifc.get_object(element)
|
||||||
obj.select_set(True)
|
obj.select_set(True)
|
||||||
@@ -939,6 +916,7 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator):
|
|||||||
for part in parts:
|
for part in parts:
|
||||||
if part.is_a("IfcElementAssembly"):
|
if part.is_a("IfcElementAssembly"):
|
||||||
select_objects_and_add_data(part)
|
select_objects_and_add_data(part)
|
||||||
|
add_linked_aggregate_group(part)
|
||||||
obj = tool.Ifc.get_object(part)
|
obj = tool.Ifc.get_object(part)
|
||||||
obj.select_set(True)
|
obj.select_set(True)
|
||||||
|
|
||||||
@@ -1090,9 +1068,6 @@ class RefreshLinkedAggregate(bpy.types.Operator):
|
|||||||
|
|
||||||
if element_aggregate and new[0].is_a("IfcElementAssembly"):
|
if element_aggregate and new[0].is_a("IfcElementAssembly"):
|
||||||
new_aggregate = ifcopenshell.util.element.get_aggregate(new[0])
|
new_aggregate = ifcopenshell.util.element.get_aggregate(new[0])
|
||||||
print("E-", element_aggregate)
|
|
||||||
print("A-", new_aggregate)
|
|
||||||
print("N-", new[0])
|
|
||||||
if not new_aggregate:
|
if not new_aggregate:
|
||||||
blenderbim.core.aggregate.assign_object(
|
blenderbim.core.aggregate.assign_object(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
@@ -1105,7 +1080,7 @@ class RefreshLinkedAggregate(bpy.types.Operator):
|
|||||||
|
|
||||||
# TODO Add a "Mirror" option that treats the matrix differently
|
# TODO Add a "Mirror" option that treats the matrix differently
|
||||||
|
|
||||||
# TODO think of more edge cases and issues already reported
|
# TODO Think of more edge cases and issues already reported
|
||||||
|
|
||||||
blenderbim.bim.handler.refresh_ui_data()
|
blenderbim.bim.handler.refresh_ui_data()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user