mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 19:27:10 +00:00
Fix failing tests
This commit is contained in:
@@ -975,6 +975,14 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def execute_ifc_duplicate_operator(self, context, linked=False):
|
def execute_ifc_duplicate_operator(self, context, linked=False):
|
||||||
|
for obj in context.selected_objects:
|
||||||
|
if element := tool.Ifc.get_entity(obj):
|
||||||
|
if element.is_a("IfcAnnotation") and element.ObjectType == "DRAWING":
|
||||||
|
tool.Blender.deselect_object(obj)
|
||||||
|
self.report({"ERROR"}, "Drawing not duplicated.")
|
||||||
|
elif tool.Geometry.is_locked(element):
|
||||||
|
tool.Blender.deselect_object(obj)
|
||||||
|
self.report({"ERROR"}, lock_error_message(obj.name))
|
||||||
old_to_new, new_active_obj = tool.Geometry.duplicate_ifc_objects(
|
old_to_new, new_active_obj = tool.Geometry.duplicate_ifc_objects(
|
||||||
set(context.selected_objects), linked=linked, active_object=context.active_object
|
set(context.selected_objects), linked=linked, active_object=context.active_object
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1738,11 +1738,6 @@ class Geometry(bonsai.core.tool.Geometry):
|
|||||||
new_m = np.array(new_m)
|
new_m = np.array(new_m)
|
||||||
surface.Position = builder.create_axis2_placement_3d_from_matrix(new_m)
|
surface.Position = builder.create_axis2_placement_3d_from_matrix(new_m)
|
||||||
ifcopenshell.util.element.remove_deep2(tool.Ifc.get(), position)
|
ifcopenshell.util.element.remove_deep2(tool.Ifc.get(), position)
|
||||||
else:
|
|
||||||
self.report(
|
|
||||||
{"INFO"},
|
|
||||||
f"Editing boolean using non-IfcPlane IfcSurface ({surface.is_a()}) is not supported.",
|
|
||||||
)
|
|
||||||
|
|
||||||
if has_changed:
|
if has_changed:
|
||||||
cls.reload_representation(rep_obj)
|
cls.reload_representation(rep_obj)
|
||||||
@@ -2037,14 +2032,10 @@ class Geometry(bonsai.core.tool.Geometry):
|
|||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if element:
|
if element:
|
||||||
if element.is_a("IfcAnnotation") and element.ObjectType == "DRAWING":
|
if element.is_a("IfcAnnotation") and element.ObjectType == "DRAWING":
|
||||||
self.report(
|
tool.Blender.deselect_object(obj)
|
||||||
{"INFO"}, "Did not duplicate. Duplicate drawings through the Drawings and Documents UI."
|
|
||||||
)
|
|
||||||
obj.select_set(False)
|
|
||||||
continue # For now, don't copy drawings until we stabilise a bit more. It's tricky.
|
continue # For now, don't copy drawings until we stabilise a bit more. It's tricky.
|
||||||
elif tool.Geometry.is_locked(element):
|
elif tool.Geometry.is_locked(element):
|
||||||
tool.Blender.deselect_object(obj, ensure_active_object=True)
|
tool.Blender.deselect_object(obj)
|
||||||
self.report({"ERROR"}, lock_error_message(obj.name))
|
|
||||||
continue
|
continue
|
||||||
elif tool.Geometry.is_representation_item(obj):
|
elif tool.Geometry.is_representation_item(obj):
|
||||||
cls.duplicate_ifc_item(obj)
|
cls.duplicate_ifc_item(obj)
|
||||||
@@ -2218,11 +2209,11 @@ class Geometry(bonsai.core.tool.Geometry):
|
|||||||
for connection in new[0].ConnectedTo:
|
for connection in new[0].ConnectedTo:
|
||||||
entity = connection.RelatedElement
|
entity = connection.RelatedElement
|
||||||
if entity in old_to_new.keys() or single_obj:
|
if entity in old_to_new.keys() or single_obj:
|
||||||
core.remove_connection(tool.Geometry, connection=connection)
|
cls.remove_connection(connection)
|
||||||
for connection in new[0].ConnectedFrom:
|
for connection in new[0].ConnectedFrom:
|
||||||
entity = connection.RelatingElement
|
entity = connection.RelatingElement
|
||||||
if entity in old_to_new.keys() or single_obj:
|
if entity in old_to_new.keys() or single_obj:
|
||||||
core.remove_connection(tool.Geometry, connection=connection)
|
cls.remove_connection(connection)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def remove_linked_aggregate_data(cls, old_to_new):
|
def remove_linked_aggregate_data(cls, old_to_new):
|
||||||
|
|||||||
Reference in New Issue
Block a user