This commit is contained in:
Andrej730
2025-07-09 13:47:32 +05:00
parent 40f92d15c3
commit 5a4ad69bf7
30 changed files with 362 additions and 301 deletions
@@ -25,8 +25,8 @@ import ifcopenshell.api.cogo
def test_edit_survey_point():
file = ifcopenshell.file(schema="IFC4X3_ADD2")
project = file.createIfcProject(Name="Test")
site = file.createIfcSite(GlobalId=ifcopenshell.guid.new(),Name="MySite")
ifcopenshell.api.aggregate.assign_object(file,relating_object=project,products=[site])
site = file.createIfcSite(GlobalId=ifcopenshell.guid.new(), Name="MySite")
ifcopenshell.api.aggregate.assign_object(file, relating_object=project, products=[site])
geometric_representation_context = ifcopenshell.api.context.add_context(file, context_type="Model")
axis_model_representation_subcontext = ifcopenshell.api.context.add_context(
file,
@@ -36,13 +36,12 @@ def test_edit_survey_point():
parent=geometric_representation_context,
)
annotation = ifcopenshell.api.cogo.add_survey_point(file,file.createIfcCartesianPoint((50.0,10.0)))
annotation = ifcopenshell.api.cogo.add_survey_point(file, file.createIfcCartesianPoint((50.0, 10.0)))
assert annotation
assert annotation.PredefinedType == "SURVEY"
assert annotation.Representation.Representations[0].RepresentationIdentifier == "Annotation"
assert annotation.Representation.Representations[0].RepresentationType == "Point"
assert annotation.Representation.Representations[0].Items[0].Coordinates == pytest.approx((50.0,10.0))
ifcopenshell.api.cogo.edit_survey_point(annotation,20.0,30.0)
assert annotation.Representation.Representations[0].Items[0].Coordinates == pytest.approx((20.0,30.0))
assert annotation.Representation.Representations[0].Items[0].Coordinates == pytest.approx((50.0, 10.0))
ifcopenshell.api.cogo.edit_survey_point(annotation, 20.0, 30.0)
assert annotation.Representation.Representations[0].Items[0].Coordinates == pytest.approx((20.0, 30.0))