コード例 #1
0
ファイル: IFCFaceSurface.cs プロジェクト: zhoyq/revit-ifc
        /// <summary>
        /// Create an IFCFaceSurface object from a handle of type IfcFaceSurface.
        /// </summary>
        /// <param name="ifcFaceSurface">The IFC handle.</param>
        /// <returns>The IFCFace object.</returns>
        public static IFCFaceSurface ProcessIFCFaceSurface(IFCAnyHandle ifcFaceSurface)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcFaceSurface))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcFaceSurface);
                return(null);
            }

            if (IFCImportFile.TheFile.SchemaVersion > IFCSchemaVersion.IFC2x3 && IFCAnyHandleUtil.IsValidSubTypeOf(ifcFaceSurface, IFCEntityType.IfcAdvancedFace))
            {
                return(IFCAdvancedFace.ProcessIFCAdvancedFace(ifcFaceSurface));
            }
            IFCEntity face;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcFaceSurface.StepId, out face))
            {
                face = new IFCFaceSurface(ifcFaceSurface);
            }
            return(face as IFCFaceSurface);
        }
コード例 #2
0
        /// <summary>
        /// Create an IFCFaceSurface object from a handle of type IfcFaceSurface.
        /// </summary>
        /// <param name="ifcFaceSurface">The IFC handle.</param>
        /// <returns>The IFCFace object.</returns>
        public static IFCFaceSurface ProcessIFCFaceSurface(IFCAnyHandle ifcFaceSurface)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcFaceSurface))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcFaceSurface);
                return null;
            }

            if (IFCImportFile.TheFile.SchemaVersion > IFCSchemaVersion.IFC2x3 && IFCAnyHandleUtil.IsSubTypeOf(ifcFaceSurface, IFCEntityType.IfcAdvancedFace))
            {
               Importer.TheLog.LogUnhandledSubTypeError(ifcFaceSurface, IFCEntityType.IfcFaceSurface, false);
               return null;
            }

           IFCEntity face;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcFaceSurface.StepId, out face))
                face = new IFCFaceSurface(ifcFaceSurface);
            return (face as IFCFaceSurface);
        }