mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-29 16:22:53 +00:00
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:
@@ -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")
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user