mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
black .
This commit is contained in:
@@ -1272,7 +1272,11 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator):
|
|||||||
if pset:
|
if pset:
|
||||||
new_pset = ifcopenshell.api.pset.add_pset(ifc_file, product=new[0], name=self.pset_name)
|
new_pset = ifcopenshell.api.pset.add_pset(ifc_file, product=new[0], name=self.pset_name)
|
||||||
if pset["Index"] == 0:
|
if pset["Index"] == 0:
|
||||||
properties = {"Index": pset["Index"], "Name": pset["Name"], "Aggregate_Index": len(group_elements) - 1}
|
properties = {
|
||||||
|
"Index": pset["Index"],
|
||||||
|
"Name": pset["Name"],
|
||||||
|
"Aggregate_Index": len(group_elements) - 1,
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
properties = {"Index": pset["Index"]}
|
properties = {"Index": pset["Index"]}
|
||||||
|
|
||||||
@@ -1282,7 +1286,6 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator):
|
|||||||
properties=properties,
|
properties=properties,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_location_from_3d_cursor(old_to_new, aggregate):
|
def get_location_from_3d_cursor(old_to_new, aggregate):
|
||||||
base_obj = tool.Ifc.get_object(aggregate)
|
base_obj = tool.Ifc.get_object(aggregate)
|
||||||
base_obj_location = base_obj.location.copy()
|
base_obj_location = base_obj.location.copy()
|
||||||
@@ -1400,11 +1403,13 @@ class RefreshLinkedAggregate(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
existing_product = tool.Drawing.get_assigned_product(assignment)
|
existing_product = tool.Drawing.get_assigned_product(assignment)
|
||||||
if existing_product != product:
|
if existing_product != product:
|
||||||
if existing_product:
|
if existing_product:
|
||||||
tool.Ifc.run("drawing.unassign_product", relating_product=existing_product, related_object=assignment)
|
tool.Ifc.run(
|
||||||
|
"drawing.unassign_product", relating_product=existing_product, related_object=assignment
|
||||||
|
)
|
||||||
if product:
|
if product:
|
||||||
tool.Ifc.run("drawing.assign_product", relating_product=product, related_object=assignment)
|
tool.Ifc.run("drawing.assign_product", relating_product=product, related_object=assignment)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
def get_original_data(element: ifcopenshell.entity_instance) -> dict[int, dict[int, str]]:
|
def get_original_data(element: ifcopenshell.entity_instance) -> dict[int, dict[int, str]]:
|
||||||
group = next(
|
group = next(
|
||||||
r.RelatingGroup
|
r.RelatingGroup
|
||||||
@@ -1432,7 +1437,10 @@ class RefreshLinkedAggregate(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
if pset:
|
if pset:
|
||||||
index = pset["Index"]
|
index = pset["Index"]
|
||||||
annotations = get_assignments(part)
|
annotations = get_assignments(part)
|
||||||
original_data[group][index] = {"Name": tool.Ifc.get_object(part).name, "Assignment": annotations}
|
original_data[group][index] = {
|
||||||
|
"Name": tool.Ifc.get_object(part).name,
|
||||||
|
"Assignment": annotations,
|
||||||
|
}
|
||||||
|
|
||||||
return original_data
|
return original_data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user