Create section and elevation contexts on new projects. See #1153.

This commit is contained in:
Dion Moult
2022-03-09 21:44:19 +11:00
parent 96902bf38a
commit 578ab140cc
2 changed files with 25 additions and 1 deletions
+7 -1
View File
@@ -45,9 +45,15 @@ def create_project(ifc, project, schema=None, template=None):
context_type="Model", context_identifier="Box", target_view="MODEL_VIEW", parent=model
)
plan = project.run_context_add_context(context_type="Plan", context_identifier="", target_view="", parent=0)
annotation = project.run_context_add_context(
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent=plan
)
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent=plan
)
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent=plan
)
project.run_root_assign_class(obj=site, ifc_class="IfcSite", context=body)
project.run_root_assign_class(obj=building, ifc_class="IfcBuilding", context=body)
+18
View File
@@ -53,6 +53,12 @@ class TestCreateProject:
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="plan"
).should_be_called()
project.run_root_assign_class(obj="site", ifc_class="IfcSite", context="body").should_be_called()
project.run_root_assign_class(obj="building", ifc_class="IfcBuilding", context="body").should_be_called()
@@ -94,6 +100,12 @@ class TestCreateProject:
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="plan"
).should_be_called()
project.run_root_assign_class(obj="site", ifc_class="IfcSite", context="body").should_be_called()
project.run_root_assign_class(obj="building", ifc_class="IfcBuilding", context="body").should_be_called()
@@ -144,6 +156,12 @@ class TestCreateProject:
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="plan"
).should_be_called()
project.run_root_assign_class(obj="site", ifc_class="IfcSite", context="body").should_be_called()
project.run_root_assign_class(obj="building", ifc_class="IfcBuilding", context="body").should_be_called()