Joao Matias
Equal values but if return false [Answered]
public static List<ElementId> checkPositionElements(Pipe p, List<Pipe> pipes)
{
LocationCurve pLocation = p.Location as LocationCurve;
XYZ p1_Start = pLocation.Curve.Evaluate(0, true);
XYZ p1_End = pLocation.Curve.Evaluate(1, true);
List<ElementId> returnList = new List<ElementId>();
foreach (Pipe pipe in pipes)
{
if (pipe == null)
continue;
if (pipe.Id == p.Id)
continue;
LocationCurve p2_Location = pipe.Location as LocationCurve;
XYZ p2_Start = p2_Location.Curve.Evaluate(0, true);
XYZ p2_End = p2_Location.Curve.Evaluate(1, true);
if (Equals(p1_Start.X,p2_Start) || Equals(p1_Start, p2_End))
{
if (Equals(p1_End, p2_Start) || Equals(p1_End,p2_End))
{
returnList.Add(pipe.Id);
}
}
}
return returnList;
}
25 replies