3d annotations for FALL, SECTION_LEVEL, PLAN_LEVEL #3145

Before that commit if you created those types of annotations and then reopened .ifc file (without .blend) then you would lose their z coordinate and therefore would lose their value (because they were created previously as 2d annotations).

Now those annotations created as 3d to avoid that problem. I've also added temporary fallback that will turn your existing annotations to 3d next time you edit them.
This commit is contained in:
Andrej730
2023-05-18 14:07:48 +05:00
parent 9c9b8b265c
commit 2d67950503
7 changed files with 26 additions and 8 deletions
+2 -2
View File
@@ -429,7 +429,7 @@ class TestAddAnnotation:
def test_run(self, ifc, collector, drawing):
drawing.show_decorations().should_be_called()
drawing.get_drawing_target_view("drawing").should_be_called().will_return("target_view")
drawing.get_annotation_context("target_view").should_be_called().will_return("context")
drawing.get_annotation_context("target_view", "object_type").should_be_called().will_return("context")
drawing.create_annotation_object("drawing", "object_type").should_be_called().will_return("obj")
ifc.get_entity("obj").should_be_called().will_return(None)
drawing.get_ifc_representation_class("object_type").should_be_called().will_return("ifc_representation_class")
@@ -449,5 +449,5 @@ class TestAddAnnotation:
def test_do_not_add_without_an_annotation_context(self, ifc, collector, drawing):
drawing.get_drawing_target_view("drawing").should_be_called().will_return("target_view")
drawing.get_annotation_context("target_view").should_be_called().will_return(None)
drawing.get_annotation_context("target_view", "object_type").should_be_called().will_return(None)
subject.add_annotation(ifc, collector, drawing, drawing="drawing", object_type="object_type")
+4
View File
@@ -235,9 +235,13 @@ class TestGetAnnotationContext(NewFile):
context2 = ifc.createIfcGeometricRepresentationSubContext(
ContextType="Model", ContextIdentifier="Annotation", TargetView="ELEVATION_VIEW"
)
context3 = ifc.createIfcGeometricRepresentationSubContext(
ContextType="Model", ContextIdentifier="Annotation", TargetView="PLAN_VIEW"
)
tool.Ifc.set(ifc)
assert subject.get_annotation_context("PLAN_VIEW") == context
assert subject.get_annotation_context("ELEVATION_VIEW") == context2
assert subject.get_annotation_context("PLAN_VIEW", "FALL") == context3
class TestGetBodyContext(NewFile):