Watch out!
Another one of those "gotcha's" by Tekla.
I got bitten. I couldn't work out why this was failing. And then I realised. They're mutating. Watch out!
[Test]
public void TestMutationOfPointsWhenApplyingMoveOperations()
{
Model model = new Model();
if (model.GetConnectionStatus())
{
CoordinateSystem cs1 = getCoordinateSystem1();
CoordinateSystem cs2 = getCoordinateSystem2();
// move by operation
Point startPoint = new Point(300, 0, 0);
Point endPoint = new Point(400, 0, 0);
Beam beam = beamFactory(startPoint, endPoint, "1"); // we need factory methods because the same points mutate
beam.Insert();
Operation.MoveObject(beam, cs1, cs2);
beam.Select(); // gray
model.CommitChanges();
Assert.That(startPoint, Is.EqualTo(new Point(300, 0, 0))); // it fails when it should be equal
Assert.That(endPoint, Is.EqualTo(new Point(400, 0, 0))); // it fails when it should be equal
}
}For more visit: Tek1's Tekla API blogs
To visit the Github Project - Checkout Tekla Extension Methods.