mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-01 17:36:27 +00:00
You can now manage actor assignments to products
This commit is contained in:
@@ -277,3 +277,30 @@ Scenario: Edit actor
|
||||
And I press "bim.enable_editing_actor(actor={actor})"
|
||||
When I press "bim.edit_actor"
|
||||
Then "scene.BIMOwnerProperties.active_actor_id" is "0"
|
||||
|
||||
Scenario: Assign actor
|
||||
Given an empty IFC project
|
||||
And I press "bim.add_person"
|
||||
And I press "bim.add_actor"
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
And the variable "actor" is "{ifc}.by_type('IfcActor')[0].id()"
|
||||
And the object "IfcWall/Cube" is selected
|
||||
When I press "bim.assign_actor(actor={actor})"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Unassign actor
|
||||
Given an empty IFC project
|
||||
And I press "bim.add_person"
|
||||
And I press "bim.add_actor"
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
And the variable "actor" is "{ifc}.by_type('IfcActor')[0].id()"
|
||||
And the object "IfcWall/Cube" is selected
|
||||
And I press "bim.assign_actor(actor={actor})"
|
||||
When I press "bim.unassign_actor(actor={actor})"
|
||||
Then nothing happens
|
||||
|
||||
@@ -259,3 +259,15 @@ class TestEditActor:
|
||||
ifc.run("owner.edit_actor", actor="actor", attributes="attributes").should_be_called()
|
||||
owner.clear_actor().should_be_called()
|
||||
subject.edit_actor(ifc, owner)
|
||||
|
||||
|
||||
class TestAssignActor:
|
||||
def test_run(self, ifc, owner):
|
||||
ifc.run("owner.assign_actor", relating_actor="actor", related_object="element").should_be_called()
|
||||
subject.assign_actor(ifc, actor="actor", element="element")
|
||||
|
||||
|
||||
class TestUnassignActor:
|
||||
def test_run(self, ifc, owner):
|
||||
ifc.run("owner.unassign_actor", relating_actor="actor", related_object="element").should_be_called()
|
||||
subject.unassign_actor(ifc, actor="actor", element="element")
|
||||
|
||||
Reference in New Issue
Block a user