Example #1
0
        /// <summary>
        /// Create an IFCCurve object from a handle of type IfcCurve.
        /// </summary>
        /// <param name="ifcCurve">The IFC handle.</param>
        /// <returns>The IFCCurve object.</returns>
        public static IFCCurve ProcessIFCCurve(IFCAnyHandle ifcCurve)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcCurve))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcCurve);
                return(null);
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcCurve, IFCEntityType.IfcBoundedCurve))
            {
                return(IFCBoundedCurve.ProcessIFCBoundedCurve(ifcCurve));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcCurve, IFCEntityType.IfcConic))
            {
                return(IFCConic.ProcessIFCConic(ifcCurve));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcCurve, IFCEntityType.IfcLine))
            {
                return(IFCLine.ProcessIFCLine(ifcCurve));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcCurve, IFCEntityType.IfcOffsetCurve2D))
            {
                return(IFCOffsetCurve2D.ProcessIFCOffsetCurve2D(ifcCurve));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcCurve, IFCEntityType.IfcOffsetCurve3D))
            {
                return(IFCOffsetCurve3D.ProcessIFCOffsetCurve3D(ifcCurve));
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcCurve, IFCEntityType.IfcCurve, true);
            return(null);
        }
Example #2
0
        /// <summary>
        /// Create an IFCOffsetCurve3D object from a handle of type IfcOffsetCurve3D
        /// </summary>
        /// <param name="ifcOffsetCurve3D">The IFC handle</param>
        /// <returns>The IFCOffsetCurve3D object</returns>
        public static IFCOffsetCurve3D ProcessIFCOffsetCurve3D(IFCAnyHandle ifcOffsetCurve3D)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOffsetCurve3D))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcOffsetCurve3D);
                return(null);
            }

            IFCEntity offsetCurve3D = null;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOffsetCurve3D.StepId, out offsetCurve3D))
            {
                offsetCurve3D = new IFCOffsetCurve3D(ifcOffsetCurve3D);
            }

            return(offsetCurve3D as IFCOffsetCurve3D);
        }
        /// <summary>
        /// Create an IFCOffsetCurve3D object from a handle of type IfcOffsetCurve3D
        /// </summary>
        /// <param name="ifcOffsetCurve3D">The IFC handle</param>
        /// <returns>The IFCOffsetCurve3D object</returns>
        public static IFCOffsetCurve3D ProcessIFCOffsetCurve3D(IFCAnyHandle ifcOffsetCurve3D)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOffsetCurve3D))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcOffsetCurve3D);
                return null;
            }

            IFCEntity offsetCurve3D = null;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOffsetCurve3D.StepId, out offsetCurve3D))
                offsetCurve3D = new IFCOffsetCurve3D(ifcOffsetCurve3D);

            return (offsetCurve3D as IFCOffsetCurve3D);
        }