public static Fitting SetGeometry(this Fitting fittingObj, Point location, List <Point> connectionLocations) { if (fittingObj == null || location == null || connectionLocations == null) { return(null); } if (connectionLocations.Count < 2) { Engine.Reflection.Compute.RecordError("A fitting requires at least 2 physical connections, e.g. an elbow fitting has 2, please input at least two Points in connectionLocations."); return(null); } Fitting clone = fittingObj.ShallowClone(); clone.Location = location; clone.ConnectionsLocation = connectionLocations; return(clone); }