ConnectorManager.Connectors
sometimes returns connectors in random orders
#1374
Labels
type:bug
Error or unexpected behaviour
Description:
We discovered during beta testing that the call to
mepCurve.ConnectorManager.Connectors
didn't always return connectors in the same order. This needs a fix to allow comparing objects for equality in unit tests.Steps to reproduce:
Debugging the below will show the start and end point of the line switch positions randomly:
Revit_Toolkit/Revit_Core_Engine/Query/LocationCurve.cs
Lines 174 to 177 in f22d01a
Another problem due to this bug is in calculating the orientation angle of an MEP curve:
Revit_Toolkit/Revit_Core_Engine/Query/OrientationAngle.cs
Lines 79 to 85 in f22d01a
The same curve can report an angle of 360 or 0 degree, depending on which End connector Revit randomly sees first.
Expected behaviour:
We need to sort connectors consistently so that pulling the same object always produces:
Test file(s):
The text was updated successfully, but these errors were encountered: