Ejemplo n.º 1
0
        /// <summary>
        /// Gets a boolean attribute.
        /// </summary>
        /// <param name="hnd">The handle.</param>
        /// <param name="name">The attribute name.</param>
        /// <returns>The boolean value.</returns>
        public static bool?GetBooleanAttribute(IFCAnyHandle hnd, string name)
        {
            if (hnd == null)
            {
                throw new ArgumentNullException("hnd");
            }

            if (!hnd.HasValue)
            {
                throw new ArgumentException("Invalid handle.");
            }

            IFCData ifcData = hnd.GetAttribute(name);

            if (ifcData.PrimitiveType == IFCDataPrimitiveType.Double)
            {
                return(ifcData.AsBoolean());
            }

            return(null);
        }