Beispiel #1
0
        /// <summary>
        /// Processes IfcObject handle.
        /// </summary>
        /// <param name="ifcObject">The IfcObject handle.</param>
        /// <returns>The IfcObject object.</returns>
        public static IFCObject ProcessIFCObject(IFCAnyHandle ifcObject)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcObject))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcObject);
                return(null);
            }

            IFCEntity cachedObject;

            if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcObject.StepId, out cachedObject))
            {
                return(cachedObject as IFCObject);
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcObject, IFCEntityType.IfcProduct))
            {
                return(IFCProduct.ProcessIFCProduct(ifcObject));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcObject, IFCEntityType.IfcProject))
            {
                return(IFCProject.ProcessIFCProject(ifcObject));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcObject, IFCEntityType.IfcGroup))
            {
                return(IFCGroup.ProcessIFCGroup(ifcObject));
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcObject, IFCEntityType.IfcObject, true);
            return(null);
        }
        /// <summary>
        /// Finds contained systems.
        /// </summary>
        /// <param name="ifcRelHandle">The relation handle.</param>
        void ProcessIFCRelServicesBuildings(IFCAnyHandle ifcRelHandle)
        {
            IFCAnyHandle relatingSystem = IFCAnyHandleUtil.GetInstanceAttribute(ifcRelHandle, "RelatingSystem");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(relatingSystem))
            {
                IFCImportFile.TheLog.LogMissingRequiredAttributeError(ifcRelHandle, "RelatingSystem", false);
                return;
            }

            IFCGroup system = IFCGroup.ProcessIFCGroup(relatingSystem);

            if (system != null)
            {
                m_IFCSystems.Add(system);
            }
        }