Пример #1
0
        /// <summary>
        /// Processes an IfcProduct object.
        /// </summary>
        /// <param name="ifcProduct">The IfcProduct handle.</param>
        /// <returns>The IFCProduct object.</returns>
        public static IFCProduct ProcessIFCProduct(IFCAnyHandle ifcProduct)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcProduct))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcProduct);
                return(null);
            }

            try
            {
                IFCEntity cachedProduct;
                if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcProduct.StepId, out cachedProduct))
                {
                    return(cachedProduct as IFCProduct);
                }

                if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcProduct, IFCEntityType.IfcSpatialStructureElement))
                {
                    return(IFCSpatialStructureElement.ProcessIFCSpatialStructureElement(ifcProduct));
                }

                if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcProduct, IFCEntityType.IfcElement))
                {
                    return(IFCElement.ProcessIFCElement(ifcProduct));
                }

                if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcProduct, IFCEntityType.IfcGrid))
                {
                    return(IFCGrid.ProcessIFCGrid(ifcProduct));
                }

                if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcProduct, IFCEntityType.IfcProxy))
                {
                    return(IFCProxy.ProcessIFCProxy(ifcProduct));
                }

                if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcProduct, IFCEntityType.IfcDistributionPort))
                {
                    return(IFCDistributionPort.ProcessIFCDistributionPort(ifcProduct));
                }
            }
            catch (Exception ex)
            {
                HandleError(ex.Message, ifcProduct, true);
                return(null);
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcProduct, IFCEntityType.IfcProduct, false);
            return(null);
        }
Пример #2
0
        /// <summary>
        /// Processes an IfcGrid object.
        /// </summary>
        /// <param name="ifcGrid">The IfcGrid handle.</param>
        /// <returns>The IFCGrid object.</returns>
        public static IFCGrid ProcessIFCGrid(IFCAnyHandle ifcGrid)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcGrid))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcGrid);
                return(null);
            }

            IFCEntity grid;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcGrid.StepId, out grid))
            {
                grid = new IFCGrid(ifcGrid);
            }
            return(grid as IFCGrid);
        }
Пример #3
0
      /// <summary>
      /// Processes an IfcGrid object.
      /// </summary>
      /// <param name="ifcGrid">The IfcGrid handle.</param>
      /// <returns>The IFCGrid object.</returns>
      public static IFCGrid ProcessIFCGrid(IFCAnyHandle ifcGrid)
      {
         if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcGrid))
         {
            Importer.TheLog.LogNullError(IFCEntityType.IfcGrid);
            return null;
         }

         IFCEntity grid;
         if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcGrid.StepId, out grid))
            grid = new IFCGrid(ifcGrid);
         return (grid as IFCGrid);
      }