Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Revit_Core_Engine/Query/Connectors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ private static List<Connector> SortedConnectors(this MEPCurve mepCurve)
foreach (Connector conn in connSet)
connList.Add(conn);

connList = connList.OrderBy(x => x.Origin.DistanceTo(startPoint)).ToList();
// Order by distance from the start point. Logical connectors have no Origin, so they are sorted to the end rather than crashing the query.
connList = connList.OrderBy(x =>
{
try { return x.Origin.DistanceTo(startPoint); }
catch { return double.MaxValue; }
}).ToList();

return connList;
}
Expand Down
Loading