예제 #1
0
        /// <summary>
        /// Identifies if the input handle matches the predefined type only to which this description applies.
        /// </summary>
        /// <param name="handle">The handle.</param>
        /// <param name="predefinedType">Optional predefined type.  Will be set if null.</param>
        /// <returns>True if it matches, false otherwise. </returns>
        /// <remarks>Currently only works with types that have "PredefinedType", not "ShapeType".</remarks>
        public bool IsAppropriatePredefinedType(IFCAnyHandle handle, string predefinedType)
        {
            if (handle == null)
            {
                return(false);
            }
            if (PredefinedType == "")
            {
                return(true);
            }

            if (string.IsNullOrEmpty(predefinedType))
            {
                try
                {
                    predefinedType = IFCAnyHandleUtil.GetEnumerationAttribute(handle, "PredefinedType");
                }
                catch
                {
                    return(false);
                }
            }

            return(NamingUtil.IsEqualIgnoringCaseAndSpaces(PredefinedType, predefinedType));
        }
예제 #2
0
        /// <summary>
        /// Identifies if the input handle matches the type of element, and optionally the object type,
        /// to which this description applies.
        /// </summary>
        /// <param name="handle">The handle.</param>
        /// <returns>True if it matches, false otherwise.</returns>
        public bool IsAppropriateType(IFCAnyHandle handle)
        {
            if (handle == null || !IsSubTypeOfEntityTypes(handle))
            {
                return(false);
            }
            if (ObjectType == "")
            {
                return(true);
            }

            string objectType = IFCAnyHandleUtil.GetEntityType(handle).ToString();

            return(NamingUtil.IsEqualIgnoringCaseAndSpaces(ObjectType, objectType));
        }
예제 #3
0
        /// <summary>
        /// Identifies if the input handle matches the object type only to which this description applies.
        /// </summary>
        /// <param name="handle">
        /// The handle.
        /// </param>
        /// <returns>
        /// True if it matches, false otherwise.
        /// </returns>
        public bool IsAppropriateObjectType(IFCAnyHandle handle)
        {
            if (handle == null)
            {
                return(false);
            }
            if (ObjectType == "")
            {
                return(true);
            }

            string objectType = IFCAnyHandleUtil.GetObjectType(handle);

            return(NamingUtil.IsEqualIgnoringCaseAndSpaces(ObjectType, objectType));
        }