/// <summary>
        /// Gets IFCSlabType from slab type name.
        /// </summary>
        /// <param name="ifcEnumType">The slab type name.</param>
        /// <returns>The IFCSlabType.</returns>
        public static IFCSlabType GetIFCSlabType(string ifcEnumType)
        {
            if (String.IsNullOrEmpty(ifcEnumType))
            {
                return(IFCSlabType.Floor);
            }

            string ifcEnumTypeWithoutSpaces = NamingUtil.RemoveSpacesAndUnderscores(ifcEnumType);

            if (String.Compare(ifcEnumTypeWithoutSpaces, "USERDEFINED", true) == 0)
            {
                return(IFCSlabType.UserDefined);
            }
            if (String.Compare(ifcEnumTypeWithoutSpaces, "FLOOR", true) == 0)
            {
                return(IFCSlabType.Floor);
            }
            if (String.Compare(ifcEnumTypeWithoutSpaces, "ROOF", true) == 0)
            {
                return(IFCSlabType.Roof);
            }
            if (String.Compare(ifcEnumTypeWithoutSpaces, "LANDING", true) == 0)
            {
                return(IFCSlabType.Landing);
            }
            if (String.Compare(ifcEnumTypeWithoutSpaces, "BASESLAB", true) == 0)
            {
                return(IFCSlabType.BaseSlab);
            }

            return(IFCSlabType.Floor);
        }
Beispiel #2
0
        /// <summary>
        /// Gets IFC footing type from a string.
        /// </summary>
        /// <param name="value">The type name.</param>
        /// <returns>The IFCFootingType.</returns>
        public static Toolkit.IFCFootingType GetIFCFootingType(string value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return(Toolkit.IFCFootingType.NotDefined);
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            if (String.Compare(newValue, "USERDEFINED", true) == 0)
            {
                return(Toolkit.IFCFootingType.UserDefined);
            }
            if (String.Compare(newValue, "FOOTINGBEAM", true) == 0)
            {
                return(Toolkit.IFCFootingType.Footing_Beam);
            }
            if (String.Compare(newValue, "PADFOOTING", true) == 0)
            {
                return(Toolkit.IFCFootingType.Pad_Footing);
            }
            if (String.Compare(newValue, "PILECAP", true) == 0)
            {
                return(Toolkit.IFCFootingType.Pile_Cap);
            }
            if (String.Compare(newValue, "STRIPFOOTING", true) == 0)
            {
                return(Toolkit.IFCFootingType.Strip_Footing);
            }

            return(Toolkit.IFCFootingType.UserDefined);
        }
        private static IFCAssemblyPlace GetAssemblyPlace(Element element, string ifcEnumType)
        {
            string value = null;

            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, "IfcType", out value) == null)
            {
                value = ifcEnumType;
            }

            if (String.IsNullOrEmpty(value))
            {
                return(IFCAssemblyPlace.NotDefined);
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            if (String.Compare(newValue, "SITE", true) == 0)
            {
                return(IFCAssemblyPlace.Site);
            }
            if (String.Compare(newValue, "FACTORY", true) == 0)
            {
                return(IFCAssemblyPlace.Factory);
            }

            return(IFCAssemblyPlace.NotDefined);
        }
        private static IFCPileType GetPileType(Element element, string ifcEnumType)
        {
            string value = null;

            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, "IfcType", out value) == null)
            {
                value = ifcEnumType;
            }

            if (String.IsNullOrEmpty(value))
            {
                return(IFCPileType.NotDefined);
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            if (String.Compare(newValue, "COHESION", true) == 0)
            {
                return(IFCPileType.Cohesion);
            }
            if (String.Compare(newValue, "FRICTION", true) == 0)
            {
                return(IFCPileType.Friction);
            }
            if (String.Compare(newValue, "SUPPORT", true) == 0)
            {
                return(IFCPileType.Support);
            }

            return(IFCPileType.UserDefined);
        }
Beispiel #5
0
        /// <summary>
        /// Gets IFC covering type for an element.
        /// </summary>
        /// <param name="element">
        /// The element.
        /// </param>
        /// <param name="typeName">
        /// The type name.
        /// </param>
        public static Toolkit.IFCCoveringType GetIFCCoveringType(Element element, string typeName)
        {
            string value = null;

            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, "IfcType", out value) == null)
            {
                value = typeName;
            }

            if (String.IsNullOrEmpty(value))
            {
                return(Toolkit.IFCCoveringType.NotDefined);
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            if (String.Compare(newValue, "USERDEFINED", true) == 0)
            {
                return(Toolkit.IFCCoveringType.UserDefined);
            }
            if (String.Compare(newValue, "CEILING", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Ceiling);
            }
            if (String.Compare(newValue, "FLOORING", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Flooring);
            }
            if (String.Compare(newValue, "CLADDING", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Cladding);
            }
            if (String.Compare(newValue, "ROOFING", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Roofing);
            }
            if (String.Compare(newValue, "INSULATION", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Insulation);
            }
            if (String.Compare(newValue, "MEMBRANE", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Membrane);
            }
            if (String.Compare(newValue, "SLEEVING", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Sleeving);
            }
            if (String.Compare(newValue, "WRAPPING", true) == 0)
            {
                return(Toolkit.IFCCoveringType.Wrapping);
            }

            return(Toolkit.IFCCoveringType.NotDefined);
        }
Beispiel #6
0
        /// <summary>
        /// Gets IFC railing type for an element.
        /// </summary>
        /// <param name="element">
        /// The element.
        /// </param>
        /// <param name="typeName">
        /// The type name.
        /// </param>
        private static Toolkit.IFCRailingType GetIFCRailingType(Element element, string typeName)
        {
            string value = null;

            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, "IfcType", out value) == null)
            {
                value = typeName;
            }

            if (String.IsNullOrEmpty(value))
            {
                return(Toolkit.IFCRailingType.NotDefined);
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            return(GetIFCRailingTypeFromString(newValue));
        }
Beispiel #7
0
        /// <summary>
        /// Gets IFCRampType from ramp type name.
        /// </summary>
        /// <param name="rampTypeName">The ramp type name.</param>
        /// <returns>The IFCRampType.</returns>
        public static string GetIFCRampType(string rampTypeName)
        {
            string typeName = NamingUtil.RemoveSpacesAndUnderscores(rampTypeName);

            if (String.Compare(typeName, "StraightRun", true) == 0 ||
                String.Compare(typeName, "StraightRunRamp", true) == 0)
            {
                return("Straight_Run_Ramp");
            }
            if (String.Compare(typeName, "TwoStraightRun", true) == 0 ||
                String.Compare(typeName, "TwoStraightRunRamp", true) == 0)
            {
                return("Two_Straight_Run_Ramp");
            }
            if (String.Compare(typeName, "QuarterTurn", true) == 0 ||
                String.Compare(typeName, "QuarterTurnRamp", true) == 0)
            {
                return("Quarter_Turn_Ramp");
            }
            if (String.Compare(typeName, "TwoQuarterTurn", true) == 0 ||
                String.Compare(typeName, "TwoQuarterTurnRamp", true) == 0)
            {
                return("Two_Quarter_Turn_Ramp");
            }
            if (String.Compare(typeName, "HalfTurn", true) == 0 ||
                String.Compare(typeName, "HalfTurnRamp", true) == 0)
            {
                return("Half_Turn_Ramp");
            }
            if (String.Compare(typeName, "Spiral", true) == 0 ||
                String.Compare(typeName, "SpiralRamp", true) == 0)
            {
                return("Spiral_Ramp");
            }
            if (String.Compare(typeName, "UserDefined", true) == 0)
            {
                return("UserDefined");
            }

            return("NotDefined");
        }
Beispiel #8
0
        /// <summary>
        /// Gets IFC footing type from a string.
        /// </summary>
        /// <param name="value">The type name.</param>
        /// <returns>The IFCFootingType.</returns>
        public static string GetIFCFootingType(string value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return("NOTDEFINED");
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            if (String.Compare(newValue, "USERDEFINED", true) == 0)
            {
                return("USERDEFINED");
            }
            if (String.Compare(newValue, "FOOTINGBEAM", true) == 0)
            {
                return("FOOTING_BEAM");
            }
            if (String.Compare(newValue, "PADFOOTING", true) == 0)
            {
                return("PAD_FOOTING");
            }
            if (String.Compare(newValue, "PILECAP", true) == 0)
            {
                return("PILE_CAP");
            }
            if (String.Compare(newValue, "STRIPFOOTING", true) == 0)
            {
                return("STRIP_FOOTING");
            }

            if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
            {
                if (String.Compare(newValue, "CAISSONFOUNDATION", true) == 0)
                {
                    return("CAISSON_FOUNDATION");
                }
            }

            return("NOTDEFINED");
        }
Beispiel #9
0
        static IFCBeamType GetBeamType(Element element, string beamType)
        {
            string value = null;

            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, "IfcType", out value) == null)
            {
                value = beamType;
            }

            if (String.IsNullOrEmpty(value))
            {
                return(IFCBeamType.Beam);
            }

            string newValue = NamingUtil.RemoveSpacesAndUnderscores(value);

            if (String.Compare(newValue, "USERDEFINED", true) == 0)
            {
                return(IFCBeamType.UserDefined);
            }

            return(IFCBeamType.Beam);
        }
Beispiel #10
0
        /// <summary>
        /// Gets IFCRoofType from roof type name.
        /// </summary>
        /// <param name="roofTypeName">The roof type name.</param>
        /// <returns>The IFCRoofType.</returns>
        public static string GetIFCRoofType(string roofTypeName)
        {
            string typeName = NamingUtil.RemoveSpacesAndUnderscores(roofTypeName);

            if (String.Compare(typeName, "ROOFTYPEENUM", true) == 0 ||
                String.Compare(typeName, "ROOFTYPEENUMFREEFORM", true) == 0)
            {
                return("FREEFORM");
            }
            if (String.Compare(typeName, "FLAT", true) == 0 ||
                String.Compare(typeName, "FLATROOF", true) == 0)
            {
                return("FLAT_ROOF");
            }
            if (String.Compare(typeName, "SHED", true) == 0 ||
                String.Compare(typeName, "SHEDROOF", true) == 0)
            {
                return("SHED_ROOF");
            }
            if (String.Compare(typeName, "GABLE", true) == 0 ||
                String.Compare(typeName, "GABLEROOF", true) == 0)
            {
                return("GABLE_ROOF");
            }
            if (String.Compare(typeName, "HIP", true) == 0 ||
                String.Compare(typeName, "HIPROOF", true) == 0)
            {
                return("HIP_ROOF");
            }
            if (String.Compare(typeName, "HIPPED_GABLE", true) == 0 ||
                String.Compare(typeName, "HIPPED_GABLEROOF", true) == 0)
            {
                return("HIPPED_GABLE_ROOF");
            }
            if (String.Compare(typeName, "MANSARD", true) == 0 ||
                String.Compare(typeName, "MANSARDROOF", true) == 0)
            {
                return("MANSARD_ROOF");
            }
            if (String.Compare(typeName, "BARREL", true) == 0 ||
                String.Compare(typeName, "BARRELROOF", true) == 0)
            {
                return("BARREL_ROOF");
            }
            if (String.Compare(typeName, "BUTTERFLY", true) == 0 ||
                String.Compare(typeName, "BUTTERFLYROOF", true) == 0)
            {
                return("BUTTERFLY_ROOF");
            }
            if (String.Compare(typeName, "PAVILION", true) == 0 ||
                String.Compare(typeName, "PAVILIONROOF", true) == 0)
            {
                return("PAVILION_ROOF");
            }
            if (String.Compare(typeName, "DOME", true) == 0 ||
                String.Compare(typeName, "DOMEROOF", true) == 0)
            {
                return("DOME_ROOF");
            }

            return(typeName);    //return unchanged. Validation for ENUM will be done later specific to schema version
        }
Beispiel #11
0
        /// <summary>
        /// Gets IFCRoofType from roof type name.
        /// </summary>
        /// <param name="roofTypeName">The roof type name.</param>
        /// <returns>The IFCRoofType.</returns>
        public static IFCRoofType GetIFCRoofType(string roofTypeName)
        {
            string typeName = NamingUtil.RemoveSpacesAndUnderscores(roofTypeName);

            if (String.Compare(typeName, "ROOFTYPEENUM", true) == 0 ||
                String.Compare(typeName, "ROOFTYPEENUMFREEFORM", true) == 0)
            {
                return(Toolkit.IFCRoofType.FreeForm);
            }
            if (String.Compare(typeName, "FLAT", true) == 0 ||
                String.Compare(typeName, "FLATROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Flat_Roof);
            }
            if (String.Compare(typeName, "SHED", true) == 0 ||
                String.Compare(typeName, "SHEDROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Shed_Roof);
            }
            if (String.Compare(typeName, "GABLE", true) == 0 ||
                String.Compare(typeName, "GABLEROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Gable_Roof);
            }
            if (String.Compare(typeName, "HIP", true) == 0 ||
                String.Compare(typeName, "HIPROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Hip_Roof);
            }
            if (String.Compare(typeName, "HIPPED_GABLE", true) == 0 ||
                String.Compare(typeName, "HIPPED_GABLEROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Hipped_Gable_Roof);
            }
            if (String.Compare(typeName, "MANSARD", true) == 0 ||
                String.Compare(typeName, "MANSARDROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Mansard_Roof);
            }
            if (String.Compare(typeName, "BARREL", true) == 0 ||
                String.Compare(typeName, "BARRELROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Barrel_Roof);
            }
            if (String.Compare(typeName, "BUTTERFLY", true) == 0 ||
                String.Compare(typeName, "BUTTERFLYROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Butterfly_Roof);
            }
            if (String.Compare(typeName, "PAVILION", true) == 0 ||
                String.Compare(typeName, "PAVILIONROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Pavilion_Roof);
            }
            if (String.Compare(typeName, "DOME", true) == 0 ||
                String.Compare(typeName, "DOMEROOF", true) == 0)
            {
                return(Toolkit.IFCRoofType.Dome_Roof);
            }

            return(Toolkit.IFCRoofType.NotDefined);
        }