mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
Fix #2520. You can now duplicate drawings with or without annotations.
This commit is contained in:
@@ -248,7 +248,7 @@ class TestDuplicateDrawing:
|
||||
drawing.get_name("drawing").should_be_called().will_return("name")
|
||||
drawing.ensure_unique_drawing_name("name").should_be_called().will_return("unique_name")
|
||||
ifc.run("root.copy_class", product="drawing").should_be_called().will_return("new_drawing")
|
||||
drawing.copy_drawing_representation("drawing", "new_drawing").should_be_called()
|
||||
drawing.copy_representation("drawing", "new_drawing").should_be_called()
|
||||
drawing.set_name("new_drawing", "unique_name").should_be_called()
|
||||
drawing.get_drawing_group("new_drawing").should_be_called().will_return("group")
|
||||
ifc.run("group.unassign_group", group="group", product="new_drawing").should_be_called()
|
||||
@@ -257,8 +257,13 @@ class TestDuplicateDrawing:
|
||||
"group.edit_group", group="new_group", attributes={"Name": "unique_name", "ObjectType": "DRAWING"}
|
||||
).should_be_called()
|
||||
ifc.run("group.assign_group", group="new_group", products=["new_drawing"]).should_be_called()
|
||||
drawing.get_group_elements("group").should_be_called().will_return(["drawing", "annotation"])
|
||||
ifc.run("root.copy_class", product="annotation").should_be_called().will_return("new_annotation")
|
||||
drawing.copy_representation("annotation", "new_annotation").should_be_called()
|
||||
ifc.run("group.unassign_group", group="group", product="new_annotation").should_be_called()
|
||||
ifc.run("group.assign_group", group="new_group", products=["new_annotation"]).should_be_called()
|
||||
drawing.import_drawings().should_be_called()
|
||||
subject.duplicate_drawing(ifc, drawing, drawing="drawing")
|
||||
subject.duplicate_drawing(ifc, drawing, drawing="drawing", should_duplicate_annotations=True)
|
||||
|
||||
|
||||
class TestRemoveDrawing:
|
||||
|
||||
Reference in New Issue
Block a user