public bool Equals(Support s) { if ((object)s == null) return false; return this.ID == s.ID; }
/// <summary> /// Initialise a new support at the node with the specified ID /// </summary> /// <param name="NodeID">The ID of the node at which the support applies</param> /// <returns></returns> private Support GetSupport(int NodeID) { Support newSupport; SUPPORTTYPE type; dynamic supportID = 0; dynamic supportType = 0; dynamic releases = new int[6]; dynamic springs = new double[6]; // Get support information this.Staad.Supports.GetSupportInformationEx(NodeID, ref supportID, ref supportType, ref releases, ref springs); if (this.Supports.Any(s => s.ID == supportID)) return this.Supports.Single(s => s.ID == supportID); else { newSupport = new Support(supportID); this.Supports.Add(newSupport); } // Assign support type type = SUPPORTTYPE.UNSPECIFIED; if (Enum.TryParse<SUPPORTTYPE>(supportType.ToString(), out type)) newSupport.Type = type; // Assign release conditions newSupport.Releases = new Releases() { Fx = releases[0] > 0, Fy = releases[1] > 0, Fz = releases[2] > 0, Mx = releases[3] > 0, My = releases[4] > 0, Mz = releases[5] > 0 }; return newSupport; }