Пример #1
0
        /// <summary>
        /// Processes an IFC property.
        /// </summary>
        /// <param name="ifcProperty">The property.</param>
        /// <returns>The IFCProperty object.</returns>
        public static IFCProperty ProcessIFCProperty(IFCAnyHandle ifcProperty)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcProperty))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcProperty);
                return(null);
            }

            try
            {
                IFCEntity property;
                if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcProperty.StepId, out property))
                {
                    return(property as IFCProperty);
                }

                if (IFCAnyHandleUtil.IsSubTypeOf(ifcProperty, IFCEntityType.IfcComplexProperty))
                {
                    return(IFCComplexProperty.ProcessIFCComplexProperty(ifcProperty));
                }

                if (IFCAnyHandleUtil.IsSubTypeOf(ifcProperty, IFCEntityType.IfcSimpleProperty))
                {
                    return(IFCSimpleProperty.ProcessIFCSimpleProperty(ifcProperty));
                }
            }
            catch (Exception ex)
            {
                Importer.TheLog.LogError(ifcProperty.StepId, ex.Message, false);
                return(null);
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcProperty, IFCEntityType.IfcProperty, false);
            return(null);
        }
Пример #2
0
        /// <summary>
        /// Processes an IFC complex property.
        /// </summary>
        /// <param name="complexProperty">The IfcComplexProperty object.</param>
        /// <returns>The IFCComplexProperty object.</returns>
        public static IFCComplexProperty ProcessIFCComplexProperty(IFCAnyHandle ifcComplexProperty)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcComplexProperty))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcComplexProperty);
                return(null);
            }

            if (!IFCAnyHandleUtil.IsValidSubTypeOf(ifcComplexProperty, IFCEntityType.IfcComplexProperty))
            {
                //LOG: ERROR: Not an IfcComplexProperty.
                return(null);
            }

            IFCEntity complexProperty;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcComplexProperty.StepId, out complexProperty))
            {
                complexProperty = new IFCComplexProperty(ifcComplexProperty);
            }
            return(complexProperty as IFCComplexProperty);
        }
        /// <summary>
        /// Processes an IFC complex property.
        /// </summary>
        /// <param name="complexProperty">The IfcComplexProperty object.</param>
        /// <returns>The IFCComplexProperty object.</returns>
        public static IFCComplexProperty ProcessIFCComplexProperty(IFCAnyHandle ifcComplexProperty)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcComplexProperty))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcComplexProperty);
                return null;
            }

            if (!IFCAnyHandleUtil.IsSubTypeOf(ifcComplexProperty, IFCEntityType.IfcComplexProperty))
            {
                //LOG: ERROR: Not an IfcComplexProperty.
                return null;
            }

            IFCEntity complexProperty;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcComplexProperty.StepId, out complexProperty))
                complexProperty = new IFCComplexProperty(ifcComplexProperty);
            return (complexProperty as IFCComplexProperty); 
        }