Пример #1
0
        private static string SchemaFileName(IFCVersion ifcFileVersion)
        {
            string schemaFile = string.Empty;

            switch (ifcFileVersion)
            {
            case IFCVersion.IFC2x2:
            case IFCVersion.IFCBCA:
                schemaFile = "IFC2X2_ADD1.xsd";
                break;

            case IFCVersion.IFC2x3:
            case IFCVersion.IFC2x3BFM:
            case IFCVersion.IFC2x3CV2:
            case IFCVersion.IFC2x3FM:
            case IFCVersion.IFCCOBIE:
                schemaFile = "IFC2X3_TC1.xsd";
                break;

            case IFCVersion.IFC4:
            case IFCVersion.IFC4DTV:
            case IFCVersion.IFC4RV:
                schemaFile = "IFC4.xsd";
                break;

            default:
                schemaFile = "IFC4.xsd";
                break;
            }
            return(schemaFile);
        }
Пример #2
0
        /// <summary>
        /// return the standardized IFC schema name based on the various enumeration of IFCVersion
        /// </summary>
        /// <param name="ifcFileVersion">IFCVersion</param>
        /// <returns>the standardized IFC schema name</returns>
        static public string SchemaName(IFCVersion ifcFileVersion)
        {
            string schemaFile = string.Empty;

            switch (ifcFileVersion)
            {
            case IFCVersion.IFC2x2:
                schemaFile = Ifc2x2Schema;
                break;

            case IFCVersion.IFC2x3:
            case IFCVersion.IFC2x3BFM:
            case IFCVersion.IFC2x3CV2:
            case IFCVersion.IFC2x3FM:
            case IFCVersion.IFCCOBIE:
                schemaFile = Ifc2x3Schema;
                break;

            case IFCVersion.IFC4:
            case IFCVersion.IFC4DTV:
            case IFCVersion.IFC4RV:
                schemaFile = Ifc4Schema;
                break;

            default:
                schemaFile = Ifc4Schema;
                break;
            }
            return(schemaFile);
        }
Пример #3
0
        /// <summary>
        /// Creates a builtIn configuration by particular options.
        /// </summary>
        /// <param name="name">The configuration name.</param>
        /// <param name="ifcVersion">The IFCVersion.</param>
        /// <param name="spaceBoundaries">The space boundary level.</param>
        /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
        /// <param name="splitWalls">The SplitWallsAndColumns.</param>
        /// <param name="internalSets">The ExportInternalRevitPropertySets.</param>
        /// <param name="PlanElems2D">The Export2DElements.</param>
        /// <returns>The builtIn configuration.</returns>
        public static IFCExportConfiguration CreateBuiltInConfiguration(string name,
                                                                        IFCVersion ifcVersion,
                                                                        int spaceBoundaries,
                                                                        bool exportBaseQuantities,
                                                                        bool splitWalls,
                                                                        bool internalSets,
                                                                        bool PlanElems2D)
        {
            IFCExportConfiguration configuration = new IFCExportConfiguration();

            configuration.Name                             = name;
            configuration.IFCVersion                       = ifcVersion;
            configuration.IFCFileType                      = IFCFileFormat.Ifc;
            configuration.SpaceBoundaries                  = spaceBoundaries;
            configuration.ExportBaseQuantities             = exportBaseQuantities;
            configuration.SplitWallsAndColumns             = splitWalls;
            configuration.ExportInternalRevitPropertySets  = internalSets;
            configuration.Export2DElements                 = PlanElems2D;
            configuration.VisibleElementsOfCurrentView     = false;
            configuration.Use2DRoomBoundaryForVolume       = false;
            configuration.UseFamilyAndTypeNameForReference = false;
            configuration.ExportPartsAsBuildingElements    = false;
            configuration.m_isBuiltIn                      = true;
            configuration.m_isInSession                    = false;
            return(configuration);
        }
Пример #4
0
        /// <summary>
        /// Check whether an entity (string) is a supertype of another entity
        /// </summary>
        /// <param name="context">the IFC version in context for the check</param>
        /// <param name="superTypeName">the supertype name</param>
        /// <param name="subTypeName">the subtype name</param>
        /// <param name="strict">whether the supertype is strictly supertype. Set to false if it "supertype == subtype" is acceptable</param>
        /// <returns>true if it is supertype</returns>
        static public bool IsSuperTypeOf(IFCVersion context, string superTypeName, string subTypeName, bool strict = true)
        {
            var ifcEntitySchemaTree = IfcSchemaEntityTree.GetEntityDictFor(context);

            if (ifcEntitySchemaTree == null || ifcEntitySchemaTree.Count == 0)
            {
                throw new Exception("Unable to locate IFC Schema xsd file! Make sure the relevant xsd " + context + " exists.");
            }

            IfcSchemaEntityNode theNode = Find(superTypeName);

            if (theNode != null)
            {
                if (strict)
                {
                    return(theNode.IsSuperTypeOf(subTypeName));
                }
                else
                {
                    return(theNode.Name.Equals(subTypeName, StringComparison.InvariantCultureIgnoreCase) || theNode.IsSuperTypeOf(subTypeName));
                }
            }

            return(false);
        }
Пример #5
0
        /// <summary>
        /// Creates a builtIn configuration by particular options.
        /// </summary>
        /// <param name="name">The configuration name.</param>
        /// <param name="ifcVersion">The IFCVersion.</param>
        /// <param name="spaceBoundaries">The space boundary level.</param>
        /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
        /// <param name="splitWalls">The SplitWallsAndColumns option.</param>
        /// <param name="internalSets">The ExportInternalRevitPropertySets option.</param>
        /// <param name="schedulesAsPSets">The ExportSchedulesAsPsets option.</param>
        /// <param name="userDefinedPSets">The ExportUserDefinedPsets option.</param>
        /// <param name="PlanElems2D">The Export2DElements option.</param>
        /// <param name="exportBoundingBox">The exportBoundingBox option.</param>
        /// <param name="exportLinkedFiles">The exportLinkedFiles option.</param>
        /// <returns>The builtIn configuration.</returns>
        public static IFCExportConfiguration CreateBuiltInConfiguration(string name,
                                                                        IFCVersion ifcVersion,
                                                                        int spaceBoundaries,
                                                                        bool exportBaseQuantities,
                                                                        bool splitWalls,
                                                                        bool internalSets,
                                                                        bool schedulesAsPSets,
                                                                        bool userDefinedPSets,
                                                                        bool userDefinedParameterMapping,
                                                                        bool PlanElems2D,
                                                                        bool exportBoundingBox,
                                                                        bool exportLinkedFiles,
                                                                        string excludeFilter      = "",
                                                                        bool includeSteelElements = false)
        {
            IFCExportConfiguration configuration = new IFCExportConfiguration();

            configuration.Name                                      = name;
            configuration.IFCVersion                                = ifcVersion;
            configuration.IFCFileType                               = IFCFileFormat.Ifc;
            configuration.SpaceBoundaries                           = spaceBoundaries;
            configuration.ExportBaseQuantities                      = exportBaseQuantities;
            configuration.SplitWallsAndColumns                      = splitWalls;
            configuration.ExportInternalRevitPropertySets           = internalSets;
            configuration.ExportIFCCommonPropertySets               = true;
            configuration.Export2DElements                          = PlanElems2D;
            configuration.VisibleElementsOfCurrentView              = false;
            configuration.Use2DRoomBoundaryForVolume                = false;
            configuration.UseFamilyAndTypeNameForReference          = false;
            configuration.ExportPartsAsBuildingElements             = false;
            configuration.UseActiveViewGeometry                     = false;
            configuration.ExportSpecificSchedules                   = false;
            configuration.ExportBoundingBox                         = exportBoundingBox;
            configuration.ExportSolidModelRep                       = false;
            configuration.ExportSchedulesAsPsets                    = schedulesAsPSets;
            configuration.ExportUserDefinedPsets                    = userDefinedPSets;
            configuration.ExportUserDefinedPsetsFileName            = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\" + name + @".txt";
            configuration.ExportUserDefinedParameterMapping         = userDefinedParameterMapping;
            configuration.ExportUserDefinedParameterMappingFileName = "";
            configuration.ExportLinkedFiles                         = exportLinkedFiles;
            configuration.IncludeSiteElevation                      = false;
            // The default tesselationLevelOfDetail will be low
            configuration.TessellationLevelOfDetail = 0.5;
            configuration.UseOnlyTriangulation      = false;
            configuration.StoreIFCGUID                    = false;
            configuration.m_isBuiltIn                     = true;
            configuration.m_isInSession                   = false;
            configuration.ActivePhaseId                   = ElementId.InvalidElementId;
            configuration.ExportRoomsInView               = false;
            configuration.ExcludeFilter                   = excludeFilter;
            configuration.COBieCompanyInfo                = "";
            configuration.COBieProjectInfo                = "";
            configuration.IncludeSteelElements            = includeSteelElements;
            configuration.UseTypeNameOnlyForIfcType       = false;
            configuration.UseVisibleRevitNameAsEntityName = false;

            return(configuration);
        }
Пример #6
0
 /// <summary>
 /// Get list of ER names for UI based on the given IFC Version
 /// </summary>
 /// <param name="ifcVers">The IFC Version</param>
 /// <returns>The List of known ER</returns>
 public static IList <string> ExchangeRequirementListForUI(IFCVersion ifcVers)
 {
     Initialize();
     if (KnownExchangeRequirementsLocalized.ContainsKey(ifcVers))
     {
         return(KnownExchangeRequirementsLocalized[ifcVers]);
     }
     return(null);
 }
Пример #7
0
        /// <summary>
        /// Creates a builtIn configuration by particular options.
        /// </summary>
        /// <param name="name">The configuration name.</param>
        /// <param name="ifcVersion">The IFCVersion.</param>
        /// <param name="spaceBoundaries">The space boundary level.</param>
        /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
        /// <param name="splitWalls">The SplitWallsAndColumns option.</param>
        /// <param name="internalSets">The ExportInternalRevitPropertySets option.</param>
        /// <param name="schedulesAsPSets">The ExportSchedulesAsPsets option.</param>
        /// <param name="userDefinedPSets">The ExportUserDefinedPsets option.</param>
        /// <param name="PlanElems2D">The Export2DElements option.</param>
        /// <param name="exportBoundingBox">The exportBoundingBox option.</param>
        /// <param name="exportLinkedFiles">The exportLinkedFiles option.</param>
        /// <returns>The builtIn configuration.</returns>
        public static IFCExportConfiguration CreateBuiltInConfiguration(IFCVersion ifcVersion,
                                                                        int spaceBoundaries,
                                                                        bool exportBaseQuantities,
                                                                        bool splitWalls,
                                                                        bool internalSets,
                                                                        bool schedulesAsPSets,
                                                                        bool userDefinedPSets,
                                                                        bool userDefinedParameterMapping,
                                                                        bool PlanElems2D,
                                                                        bool exportBoundingBox,
                                                                        bool exportLinkedFiles,
                                                                        string excludeFilter             = "",
                                                                        bool includeSteelElements        = false,
                                                                        KnownERNames exchangeRequirement = KnownERNames.NotDefined,
                                                                        string customName = null)
        {
            IFCExportConfiguration configuration = new IFCExportConfiguration();

            // Items from General Tab
            configuration.Name = string.IsNullOrWhiteSpace(customName) ? ifcVersion.ToLabel() : customName;
            if (exchangeRequirement != KnownERNames.NotDefined)
            {
                configuration.Name = $"{configuration.Name} [{exchangeRequirement.ToShortLabel()}]";
            }

            configuration.IFCVersion          = ifcVersion;
            configuration.ExchangeRequirement = exchangeRequirement;
            configuration.IFCFileType         = IFCFileFormat.Ifc;
            configuration.ActivePhaseId       = ElementId.InvalidElementId.IntegerValue;
            configuration.SpaceBoundaries     = spaceBoundaries;

            configuration.SplitWallsAndColumns = splitWalls;
            configuration.IncludeSteelElements = includeSteelElements;

            // Items from Additional Content Tab
            configuration.Export2DElements  = PlanElems2D;
            configuration.ExportLinkedFiles = exportLinkedFiles;

            // Items from Property Sets Tab
            configuration.ExportInternalRevitPropertySets   = internalSets;
            configuration.ExportBaseQuantities              = exportBaseQuantities;
            configuration.ExportSchedulesAsPsets            = schedulesAsPSets;
            configuration.ExportUserDefinedPsets            = userDefinedPSets;
            configuration.ExportUserDefinedPsetsFileName    = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\" + configuration.Name + @".txt";
            configuration.ExportUserDefinedParameterMapping = userDefinedParameterMapping;

            // Items from Advanced Tab
            configuration.ExportBoundingBox = exportBoundingBox;

            // Items from the Entities to Export Tab
            configuration.ExcludeFilter = excludeFilter;

            configuration.m_isBuiltIn   = true;
            configuration.m_isInSession = false;

            return(configuration);
        }
Пример #8
0
 /// <summary>
 /// Constructor for initializing EntityTree
 /// </summary>
 /// <param name="ifcVersion">the selected IFC version. This will "lock" the schema version in the dialog</param>
 /// <param name="excludeFilter">the initial list of the excluded entities. Can be used to initialize the setting</param>
 /// <param name="singleNodeSelection">true if the tree is used for a single node selection</param>
 /// <param name="showTypeNodeOnly">option to show IfcTypeObject tree only</param>
 /// <param name="preSelectItem">preselect an item (works for a single node selection only)</param>
 /// <param name="preSelectPdef">pre-select the predefined type</param>
 public EntityTree(IFCVersion ifcVersion, string excludeFilter, string desc, bool singleNodeSelection = false, bool showTypeNodeOnly = false, string preSelectEntity = null, string preSelectPdef = null)
 {
     m_IfcVersion          = IfcSchemaEntityTree.SchemaName(ifcVersion);
     ExclElementSet        = FillSetFromList(excludeFilter);
     m_SingleNodeSelection = singleNodeSelection;
     TreeSelectionDesc     = desc;
     m_ShowTypeNodeOnly    = showTypeNodeOnly;
     InitializeEntityTree(preSelectEntity, preSelectPdef);
 }
        /// <summary>
        /// Initializes quantities.
        /// </summary>
        /// <param name="fileVersion">The IFC file version.</param>
        /// <param name="exportBaseQuantities">True if export base quantities.</param>
        public static void InitQuantities(ParameterCache cache, IFCVersion fileVersion)
        {
            InitCommonQuantities(cache.Quantities);

            if (fileVersion == IFCVersion.IFCCOBIE)
            {
                InitCOBIEQuantities(cache.Quantities);
            }
        }
        /// <summary>
        /// Initializes property sets.
        /// </summary>
        /// <param name="fileVersion">The IFC file version.</param>
        public static void InitPropertySets(ParameterCache cache, IFCVersion fileVersion)
        {
            InitCommonPropertySets(cache.PropertySets);

            if (fileVersion == IFCVersion.IFCCOBIE)
            {
                InitCOBIEPropertySets(cache.PropertySets);
            }
        }
Пример #11
0
 /// <summary>
 /// Check IFC File Version pre-IFC4
 /// </summary>
 /// <param name="ifcVersion">The IFCVersion</param>
 /// <returns>true if the version is prior to IFC4</returns>
 public static bool PreIFC4Version(IFCVersion ifcVersion)
 {
     return(ifcVersion == IFCVersion.IFC2x2 ||
            ifcVersion == IFCVersion.IFC2x3 ||
            ifcVersion == IFCVersion.IFC2x3BFM ||
            ifcVersion == IFCVersion.IFC2x3CV2 ||
            ifcVersion == IFCVersion.IFC2x3FM ||
            ifcVersion == IFCVersion.IFCBCA ||
            ifcVersion == IFCVersion.IFCCOBIE);
 }
Пример #12
0
        /// <summary>
        /// Initializes property sets.
        /// </summary>
        /// <param name="fileVersion">The IFC file version.</param>
        public static void InitPropertySets(IFCVersion fileVersion)
        {
            ParameterCache cache = ExporterCacheManager.ParameterCache;

            InitCommonPropertySets(cache.PropertySets, fileVersion);

            if (fileVersion == IFCVersion.IFCCOBIE)
            {
                InitCOBIEPropertySets(cache.PropertySets);
            }
        }
Пример #13
0
        /// <summary>
        /// Initializes quantities.
        /// </summary>
        /// <param name="fileVersion">The IFC file version.</param>
        /// <param name="exportBaseQuantities">True if export base quantities.</param>
        public static void InitQuantities(IFCVersion fileVersion, bool exportBaseQuantities)
        {
            ParameterCache cache = ExporterCacheManager.ParameterCache;

            if (exportBaseQuantities)
            {
                InitBaseQuantities(cache.Quantities);
            }

            if (fileVersion == IFCVersion.IFCCOBIE)
            {
                InitCOBIEQuantities(cache.Quantities);
            }
        }
Пример #14
0
        /// <summary>
        /// Get valid IFC entity type by using the official IFC schema (using the XML schema). It checks the non-abstract valid entity.
        /// If it is found to be abstract, it will try to find its supertype until it finds a non-abstract type.
        /// </summary>
        /// <param name="entityType">the IFC entity type (string) to check</param>
        /// <returns>return the appropriate IFCEntityType enumeration or Unknown</returns>
        public static IFCEntityType GetValidIFCEntityType(string entityType)
        {
            IFCVersion    ifcVersion = ExporterCacheManager.ExportOptionsCache.FileVersion;
            IFCEntityType ret        = IFCEntityType.UnKnown;

            var ifcEntitySchemaTree = IfcSchemaEntityTree.GetEntityDictFor(ExporterCacheManager.ExportOptionsCache.FileVersion);

            if (ifcEntitySchemaTree == null || ifcEntitySchemaTree.IfcEntityDict == null || ifcEntitySchemaTree.IfcEntityDict.Count == 0)
            {
                throw new Exception("Unable to locate IFC Schema xsd file! Make sure the relevant xsd " + ExporterCacheManager.ExportOptionsCache.FileVersion + " exists.");
            }

            IfcSchemaEntityNode node    = ifcEntitySchemaTree.Find(entityType);
            IFCEntityType       ifcType = IFCEntityType.UnKnown;

            if (node != null && !node.isAbstract)
            {
                // Only IfcProduct or IfcTypeProduct can be assigned for export type
                //if (!node.IsSubTypeOf("IfcProduct") && !node.IsSubTypeOf("IfcTypeProduct") && !node.Name.Equals("IfcGroup", StringComparison.InvariantCultureIgnoreCase))
                if ((node.IsSubTypeOf("IfcObject") &&
                     (node.IsSubTypeOf("IfcProduct") || node.IsSubTypeOf("IfcGroup") || node.Name.Equals("IfcGroup", StringComparison.InvariantCultureIgnoreCase))) ||
                    node.IsSubTypeOf("IfcProject") || node.Name.Equals("IfcProject", StringComparison.InvariantCultureIgnoreCase) ||
                    node.IsSubTypeOf("IfcTypeObject"))
                {
                    if (IFCEntityType.TryParse(entityType, true, out ifcType))
                    {
                        ret = ifcType;
                    }
                }
                else
                {
                    ret = ifcType;
                }
            }
            else if (node != null && node.isAbstract)
            {
                node = IfcSchemaEntityTree.FindNonAbsSuperType(ifcVersion, entityType, "IfcProduct", "IfcProductType", "IfcGroup", "IfcProject");
                if (node != null)
                {
                    if (Enum.TryParse <IFCEntityType>(node.Name, true, out ifcType))
                    {
                        ret = ifcType;
                    }
                }
            }

            return(ret);
        }
Пример #15
0
        private string GetSchemaString(IFCVersion version)
        {
            string   sourceName = "";
            Assembly assembly   = Assembly.GetExecutingAssembly();

            switch (version)
            {
            case IFCVersion.IFC4:
                sourceName = "IFCLite.Properties.IFC4ADD2.json";
                break;
            }
            using (Stream stream = assembly.GetManifestResourceStream(sourceName))
                using (StreamReader reader = new StreamReader(stream))
                {
                    return(reader.ReadToEnd());
                }
        }
Пример #16
0
        // Properties
        /// <summary>
        /// Initializes common property sets.
        /// </summary>
        /// <param name="propertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitCommonPropertySets(IList<IList<PropertySetDescription>> propertySets, IFCVersion fileVersion)
        {
            IList<PropertySetDescription> commonPropertySets = new List<PropertySetDescription>();

            // Manufacturer type information
            InitPropertySetManufacturerTypeInformation(commonPropertySets);

            // Architectural property sets.
            InitPropertySetBeamCommon(commonPropertySets);
            InitPropertySetRailingCommon(commonPropertySets);
            InitPropertySetRampCommon(commonPropertySets);
            InitPropertySetRampFlightCommon(commonPropertySets);
            InitPropertySetRoofCommon(commonPropertySets, fileVersion);
            InitPropertySetSlabCommon(commonPropertySets);
            InitPropertySetStairCommon(commonPropertySets);
            InitPropertySetStairFlightCommon(commonPropertySets);
            InitPropertySetWallCommon(commonPropertySets);

            // Building property sets.
            InitPropertySetBuildingCommon(commonPropertySets, fileVersion);
            InitPropertySetBuildingWaterStorage(commonPropertySets);

            // Proxy property sets.
            InitPropertySetElementShading(commonPropertySets);

            // Level property sets.
            InitPropertySetLevelCommon(commonPropertySets, fileVersion);

            // Site property sets.
            InitPropertySetSiteCommon(commonPropertySets);

            // Building Element Proxy
            InitPropertySetBuildingElementProxyCommon(commonPropertySets);

            // Space
            InitPropertySetSpaceCommon(commonPropertySets, fileVersion);
            InitPropertySetSpaceFireSafetyRequirements(commonPropertySets);
            InitPropertySetSpaceLightingRequirements(commonPropertySets);
            InitPropertySetSpaceThermalRequirements(commonPropertySets, fileVersion);
            InitPropertySetGSASpaceCategories(commonPropertySets);
            InitPropertySetSpaceOccupant(commonPropertySets);
            InitPropertySetSpaceZones(commonPropertySets, fileVersion);

            propertySets.Add(commonPropertySets);
        }
Пример #17
0
 static void Initialize()
 {
     if (KnownExchangeRequirements.Count == 0)
     {
         // For IFC4RV
         IFCVersion ifcVersion = IFCVersion.IFC4RV;
         KnownExchangeRequirements.Add(ifcVersion, new List <KnownERNames>()
         {
             KnownERNames.Architecture, KnownERNames.BuildingService, KnownERNames.Structural
         });
         List <string> erNameListForUI = new List <string>();
         foreach (KnownERNames erEnum in KnownExchangeRequirements[ifcVersion])
         {
             erNameListForUI.Add(GetERNameForUI(erEnum));
         }
         KnownExchangeRequirementsLocalized.Add(ifcVersion, erNameListForUI);
     }
 }
        /// <summary>
        /// Creates a builtIn configuration by particular options.
        /// </summary>
        /// <param name="name">The configuration name.</param>
        /// <param name="ifcVersion">The IFCVersion.</param>
        /// <param name="spaceBoundaries">The space boundary level.</param>
        /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
        /// <param name="splitWalls">The SplitWallsAndColumns option.</param>
        /// <param name="internalSets">The ExportInternalRevitPropertySets option.</param>
        /// <param name="schedulesAsPSets">The ExportSchedulesAsPsets option.</param>
        /// <param name="userDefinedPSets">The ExportUserDefinedPsets option.</param>
        /// <param name="PlanElems2D">The Export2DElements option.</param>
        /// <param name="exportBoundingBox">The exportBoundingBox option.</param>
        /// <param name="exportLinkedFiles">The exportLinkedFiles option.</param>
        /// <returns>The builtIn configuration.</returns>
        public static IFCExportConfiguration CreateBuiltInConfiguration(string name,
                                                                        IFCVersion ifcVersion,
                                                                        int spaceBoundaries,
                                                                        bool exportBaseQuantities,
                                                                        bool splitWalls,
                                                                        bool internalSets,
                                                                        bool schedulesAsPSets,
                                                                        bool userDefinedPSets,
                                                                        bool PlanElems2D,
                                                                        bool exportBoundingBox,
                                                                        bool exportLinkedFiles)
        {
            IFCExportConfiguration configuration = new IFCExportConfiguration();

            configuration.Name                             = name;
            configuration.IFCVersion                       = ifcVersion;
            configuration.IFCFileType                      = IFCFileFormat.Ifc;
            configuration.SpaceBoundaries                  = spaceBoundaries;
            configuration.ExportBaseQuantities             = exportBaseQuantities;
            configuration.SplitWallsAndColumns             = splitWalls;
            configuration.ExportInternalRevitPropertySets  = internalSets;
            configuration.ExportIFCCommonPropertySets      = true;
            configuration.Export2DElements                 = PlanElems2D;
            configuration.VisibleElementsOfCurrentView     = false;
            configuration.Use2DRoomBoundaryForVolume       = false;
            configuration.UseFamilyAndTypeNameForReference = false;
            configuration.ExportPartsAsBuildingElements    = false;
            configuration.ExportBoundingBox                = exportBoundingBox;
            configuration.ExportSolidModelRep              = false;
            configuration.ExportSchedulesAsPsets           = schedulesAsPSets;
            configuration.ExportUserDefinedPsets           = userDefinedPSets;
            configuration.ExportUserDefinedPsetsFileName   = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\" + name + @".txt";
            configuration.ExportLinkedFiles                = exportLinkedFiles;
            configuration.IncludeSiteElevation             = false;
            configuration.UseCoarseTessellation            = true;
            configuration.TessellationLevelOfDetail        = 0.25;
            configuration.StoreIFCGUID                     = false;
            configuration.m_isBuiltIn                      = true;
            configuration.m_isInSession                    = false;
            configuration.ActivePhaseId                    = ElementId.InvalidElementId;
            configuration.ExportRoomsInView                = false;
            return(configuration);
        }
Пример #19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="handle"></param>
        /// <returns></returns>
        public bool IsSubTypeOfEntityTypes(IFCEntityType ifcEntityType)
        {
            IFCVersion ifcVersion          = ExporterCacheManager.ExportOptionsCache.FileVersion;
            var        ifcEntitySchemaTree = IfcSchemaEntityTree.GetEntityDictFor(ExporterCacheManager.ExportOptionsCache.FileVersion);

            if (ifcEntitySchemaTree == null || ifcEntitySchemaTree.IfcEntityDict == null || ifcEntitySchemaTree.IfcEntityDict.Count == 0)
            {
                return(false);
            }

            // Note that although EntityTypes is represented as a set, we still need to go through each item in the last to check for subtypes.
            foreach (IFCEntityType entityType in EntityTypes)
            {
                if (IfcSchemaEntityTree.IsSubTypeOf(ifcVersion, ifcEntityType.ToString(), entityType.ToString(), strict: false))
                {
                    return(true);
                }
            }
            return(false);
        }
        /// <summary>
        /// Initializes property sets.
        /// </summary>
        /// <param name="propertySetsToExport">Existing functions to call for property set initialization.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        public static void InitPropertySets(Exporter.PropertySetsToExport propertySetsToExport, IFCVersion fileVersion)
        {
            ParameterCache cache = ExporterCacheManager.ParameterCache;

            ExportSchema = fileVersion; // set the variable accordingly

            if (ExporterCacheManager.ExportOptionsCache.PropertySetOptions.ExportIFCCommon)
            {
                if (propertySetsToExport == null)
                    propertySetsToExport = InitCommonPropertySets;
                else
                    propertySetsToExport += InitCommonPropertySets;
            }

            if (ExporterCacheManager.ExportOptionsCache.PropertySetOptions.ExportSchedulesAsPsets)
            {
                if (propertySetsToExport == null)
                    propertySetsToExport = InitCustomPropertySets;
                else
                    propertySetsToExport += InitCustomPropertySets;
            }

            if (ExporterCacheManager.ExportOptionsCache.PropertySetOptions.ExportUserDefinedPsets)
            {
                if (propertySetsToExport == null)
                    propertySetsToExport = InitUserDefinedPropertySets;
                else
                    propertySetsToExport += InitUserDefinedPropertySets;
            }

            if (ExportSchema == IFCVersion.IFCCOBIE)
            {
                if (propertySetsToExport == null)
                    propertySetsToExport = InitCOBIEPropertySets;
                else
                    propertySetsToExport += InitCOBIEPropertySets;
            }

            if (propertySetsToExport != null)
                propertySetsToExport(cache.PropertySets, ExportSchema);
        }
Пример #21
0
        static void Initialize()
        {
            if (KnownExchangeRequirements.Count == 0)
            {
                // For IFC2x3 CV2.0
                IFCVersion ifcVersion = IFCVersion.IFC2x3CV2;
                KnownExchangeRequirements.Add(ifcVersion, new List <KnownERNames>()
                {
                    KnownERNames.Architecture, KnownERNames.BuildingService, KnownERNames.Structural
                });
                List <string> erNameListForUI = new List <string>(KnownExchangeRequirements[ifcVersion].Select(x => x.ToFullLabel()));
                KnownExchangeRequirementsLocalized.Add(ifcVersion, erNameListForUI);

                // For IFC4RV
                ifcVersion = IFCVersion.IFC4RV;
                KnownExchangeRequirements.Add(ifcVersion, new List <KnownERNames>()
                {
                    KnownERNames.Architecture, KnownERNames.BuildingService, KnownERNames.Structural
                });
                KnownExchangeRequirementsLocalized.Add(ifcVersion, erNameListForUI);
            }
        }
Пример #22
0
        /// <summary>
        /// Creates a builtIn configuration by particular options.
        /// </summary>
        /// <param name="name">The configuration name.</param>
        /// <param name="ifcVersion">The IFCVersion.</param>
        /// <param name="spaceBoundaries">The space boundary level.</param>
        /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
        /// <param name="splitWalls">The SplitWallsAndColumns.</param>
        /// <param name="internalSets">The ExportInternalRevitPropertySets.</param>
        /// <param name="schedulesAsPSets">The ExportSchedulesAsPsets.</param>
        /// <param name="userDefinedPSets">The ExportUserDefinedPsets.</param>
        /// <param name="PlanElems2D">The Export2DElements.</param>
        /// <param name="exportBoundingBox">The exportBoundingBox.</param>
        /// <returns>The builtIn configuration.</returns>
        public static IFCExportConfiguration CreateBuiltInConfiguration(string name,
                                                                        IFCVersion ifcVersion,
                                                                        int spaceBoundaries,
                                                                        bool exportBaseQuantities,
                                                                        bool splitWalls,
                                                                        bool internalSets,
                                                                        bool schedulesAsPSets,
                                                                        bool userDefinedPSets,
                                                                        bool PlanElems2D,
                                                                        bool exportBoundingBox)
        {
            IFCExportConfiguration configuration = new IFCExportConfiguration();

            configuration.Name                             = name;
            configuration.IFCVersion                       = ifcVersion;
            configuration.IFCFileType                      = IFCFileFormat.Ifc;
            configuration.SpaceBoundaries                  = spaceBoundaries;
            configuration.ExportBaseQuantities             = exportBaseQuantities;
            configuration.SplitWallsAndColumns             = splitWalls;
            configuration.ExportInternalRevitPropertySets  = internalSets;
            configuration.ExportIFCCommonPropertySets      = true;
            configuration.Export2DElements                 = PlanElems2D;
            configuration.VisibleElementsOfCurrentView     = false;
            configuration.Use2DRoomBoundaryForVolume       = false;
            configuration.UseFamilyAndTypeNameForReference = false;
            configuration.ExportPartsAsBuildingElements    = false;
            configuration.ExportBoundingBox                = exportBoundingBox;
            configuration.ExportSolidModelRep              = false;
            configuration.ExportSchedulesAsPsets           = schedulesAsPSets;
            configuration.ExportUserDefinedPsets           = userDefinedPSets;
            configuration.IncludeSiteElevation             = false;
            configuration.UseCoarseTessellation            = true;
            configuration.StoreIFCGUID                     = false;
            configuration.m_isBuiltIn                      = true;
            configuration.m_isInSession                    = false;
            configuration.ActivePhaseId                    = ElementId.InvalidElementId;
            return(configuration);
        }
        /// <summary>
        /// Initializes property sets.
        /// </summary>
        /// <param name="propertySetsToExport">Existing functions to call for property set initialization.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        public static void InitPropertySets(Exporter.PropertySetsToExport propertySetsToExport, IFCVersion fileVersion)
        {
            ParameterCache cache = ExporterCacheManager.ParameterCache;

            if (ExporterCacheManager.ExportOptionsCache.PropertySetOptions.ExportIFCCommon)
            {
                if (propertySetsToExport == null)
                    propertySetsToExport = InitCommonPropertySets;
                else
                    propertySetsToExport += InitCommonPropertySets;
            }

            if (fileVersion == IFCVersion.IFCCOBIE)
            {
                if (propertySetsToExport == null)
                    propertySetsToExport = InitCOBIEPropertySets;
                else
                    propertySetsToExport += InitCOBIEPropertySets;
            }

            if (propertySetsToExport != null)
                propertySetsToExport(cache.PropertySets, fileVersion);
        }
        /// <summary>
        /// Initializes quantities.
        /// </summary>
        /// <param name="fileVersion">The IFC file version.</param>
        /// <param name="exportBaseQuantities">True if export base quantities.</param>
        public static void InitQuantities(Exporter.QuantitiesToExport quantitiesToExport, IFCVersion fileVersion, bool exportBaseQuantities)
        {
            ParameterCache cache = ExporterCacheManager.ParameterCache;

            if (exportBaseQuantities)
            {
                if (quantitiesToExport == null)
                    quantitiesToExport = InitBaseQuantities;
                else
                    quantitiesToExport += InitBaseQuantities;
            }

            if (fileVersion == IFCVersion.IFCCOBIE)
            {
                if (quantitiesToExport == null)
                    quantitiesToExport = InitCOBIEQuantities;
                else
                    quantitiesToExport += InitCOBIEQuantities; 
            }

            if (quantitiesToExport != null)
                quantitiesToExport(cache.Quantities, fileVersion);
        }
Пример #25
0
        /// <summary>
        /// Converts the <see cref="IFCVersion"/> to string.
        /// </summary>
        /// <returns>The string of IFCVersion.</returns>
        public static string ToLabel(this IFCVersion version)
        {
            switch (version)
            {
            case IFCVersion.IFC2x2:
                return(Resources.IFCVersion2x2);

            case IFCVersion.IFC2x3:
                return(Resources.IFCVersion2x3);

            case IFCVersion.IFCBCA:
            case IFCVersion.IFC2x3CV2:
                return(Resources.IFCMVD2x3CV2);

            case IFCVersion.IFC4:
                return(Resources.IFC4);

            case IFCVersion.IFCCOBIE:
                return(Resources.IFCMVDGSA);

            case IFCVersion.IFC2x3FM:
                return(Resources.IFC2x3FM);

            case IFCVersion.IFC4DTV:
                return(Resources.IFC4DTV);

            case IFCVersion.IFC4RV:
                return(Resources.IFC4RV);

            case IFCVersion.IFC2x3BFM:
                return(Resources.IFCMVDFMHandOver);

            default:
                return(Resources.IFCVersionUnrecognized);
            }
        }
Пример #26
0
        /// <summary>
        /// Initializes common roof property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetRoofCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            // PSet_RoofCommon
            PropertySetDescription propertySetRoofCommon = new PropertySetDescription();
            propertySetRoofCommon.Name = "Pset_RoofCommon";
            propertySetRoofCommon.SubElementIndex = (int)IFCRoofSubElements.PSetRoofCommon;

            propertySetRoofCommon.EntityTypes.Add(IFCEntityType.IfcRoof);

            PropertySetEntry ifcPSE = PropertySetEntry.CreateIdentifier("Reference");
            ifcPSE.PropertyCalculator = ReferenceCalculator.Instance;
            propertySetRoofCommon.Entries.Add(ifcPSE);

            ifcPSE = PropertySetEntry.CreateBoolean("IsExternal");
            ifcPSE.PropertyCalculator = ExternalCalculator.Instance;
            propertySetRoofCommon.Entries.Add(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLabel("FireRating");
            ifcPSE.RevitBuiltInParameter = BuiltInParameter.DOOR_FIRE_RATING;
            propertySetRoofCommon.Entries.Add(ifcPSE);

            if (fileVersion != IFCVersion.IFC2x2)
            {
                ifcPSE = PropertySetEntry.CreateArea("TotalArea");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.HOST_AREA_COMPUTED;
                propertySetRoofCommon.Entries.Add(ifcPSE);

                ifcPSE = PropertySetEntry.CreateArea("ProjectedArea");
                ifcPSE.PropertyCalculator = RoofProjectedAreaCalculator.Instance;
                propertySetRoofCommon.Entries.Add(ifcPSE);
            }

            commonPropertySets.Add(propertySetRoofCommon);
        }
        /// <summary>
        /// Initializes common roof property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetRoofCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            // Pset_RoofCommon
            PropertySetDescription propertySetRoofCommon = new PropertySetDescription();
            propertySetRoofCommon.Name = "Pset_RoofCommon";
            propertySetRoofCommon.SubElementIndex = (int)IFCCommonPSets.PSetRoofCommon;

            propertySetRoofCommon.EntityTypes.Add(IFCEntityType.IfcRoof);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetRoofCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateIsExternalEntry();
            propertySetRoofCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateFireRatingEntry();
            propertySetRoofCommon.AddEntry(ifcPSE);

            if (fileVersion != IFCVersion.IFC2x2)
            {
                ifcPSE = PropertySetEntry.CreateArea("TotalArea");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.HOST_AREA_COMPUTED;
                propertySetRoofCommon.AddEntry(ifcPSE);

                ifcPSE = PropertySetEntry.CreateArea("ProjectedArea");
                ifcPSE.PropertyCalculator = RoofProjectedAreaCalculator.Instance;
                propertySetRoofCommon.AddEntry(ifcPSE);
            }

            commonPropertySets.Add(propertySetRoofCommon);
        }
        /// <summary>
        /// Initializes common covering property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetCoveringCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            //property set covering common
            PropertySetDescription propertySetCoveringCommon = new PropertySetDescription();
            propertySetCoveringCommon.Name = "Pset_CoveringCommon";
            propertySetCoveringCommon.SubElementIndex = (int)IFCCommonPSets.PSetCoveringCommon;

            propertySetCoveringCommon.EntityTypes.Add(IFCEntityType.IfcCovering);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetCoveringCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntryUtil.CreateFireRatingEntry();
            propertySetCoveringCommon.AddEntry(ifcPSE);

            propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateAcousticRatingEntry());
            propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("FlammabilityRating"));
            propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateSurfaceSpreadOfFlameEntry());
            propertySetCoveringCommon.AddEntry(PropertySetEntryUtil.CreateCombustibleEntry());


            if (fileVersion == IFCVersion.IFC2x2)
                propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("Fragility"));
            else
                propertySetCoveringCommon.AddEntry(PropertySetEntry.CreateLabel("FragilityRating"));

            ifcPSE = PropertySetEntry.CreateText("Finish");
            ifcPSE.PropertyCalculator = CoveringFinishCalculator.Instance;
            propertySetCoveringCommon.AddEntry(ifcPSE);

                ifcPSE = PropertySetEntry.CreatePositiveLength("TotalThickness");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.CEILING_THICKNESS;
                propertySetCoveringCommon.AddEntry(ifcPSE);

            commonPropertySets.Add(propertySetCoveringCommon);
        }
Пример #29
0
 /// <summary>
 /// Sets the lists of quantities to be exported.  This can be overriden.
 /// </summary>
 protected virtual void InitializeQuantities(IFCVersion fileVersion)
 {
     ExporterInitializer.InitQuantities(m_QuantitiesToExport, ExporterCacheManager.ExportOptionsCache.FileVersion, ExporterCacheManager.ExportOptionsCache.ExportBaseQuantities);
 }
 /// <summary>
 /// Initializes COBIE property sets.
 /// </summary>
 /// <param name="propertySets">List to store property sets.</param>
 private static void InitCOBIEPropertySets(IList<IList<PropertySetDescription>> propertySets, IFCVersion fileVersion)
 {
     IList<PropertySetDescription> cobiePSets = new List<PropertySetDescription>();
     InitCOBIEPSetSpaceThermalSimulationProperties(cobiePSets);
     InitCOBIEPSetSpaceVentilationCriteria(cobiePSets);
     InitCOBIEPSetBuildingEnergyTarget(cobiePSets);
     InitCOBIEPSetGlazingPropertiesEnergyAnalysis(cobiePSets);
     InitCOBIEPSetPhotovoltaicArray(cobiePSets);
     propertySets.Add(cobiePSets);
 }
 /// <summary>
 /// Initializes COBIE quantities.
 /// </summary>
 /// <param name="quantities">List to store quantities.</param>
 /// <param name="fileVersion">The file version, currently unused.</param>
 private static void InitCOBIEQuantities(IList<IList<QuantityDescription>> quantities, IFCVersion fileVersion)
 {
     IList<QuantityDescription> cobieQuantities = new List<QuantityDescription>();
     InitCOBIESpaceQuantities(cobieQuantities);
     InitCOBIESpaceLevelQuantities(cobieQuantities);
     InitCOBIEPMSpaceQuantities(cobieQuantities);
     quantities.Add(cobieQuantities);
 }
        /// <summary>
        /// Initializes common zone property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetZoneCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            //property set zone common
            PropertySetDescription propertySetZoneCommon = new PropertySetDescription();
            propertySetZoneCommon.Name = "Pset_ZoneCommon";

            propertySetZoneCommon.EntityTypes.Add(IFCEntityType.IfcZone);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetZoneCommon.AddEntry(ifcPSE);

            propertySetZoneCommon.AddEntry(PropertySetEntry.CreateLabel("Category"));
            propertySetZoneCommon.AddEntry(PropertySetEntry.CreateArea("GrossAreaPlanned"));
            propertySetZoneCommon.AddEntry(PropertySetEntry.CreateArea("NetAreaPlanned"));
            propertySetZoneCommon.AddEntry(PropertySetEntry.CreateBoolean("PubliclyAccessible"));
            propertySetZoneCommon.AddEntry(PropertySetEntry.CreateBoolean("HandicapAccessible"));

            commonPropertySets.Add(propertySetZoneCommon);
        }
        /// <summary>
        /// Initializes Space Zones property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSpaceZones(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            PropertySetDescription propertySetSpaceZones = new PropertySetDescription();
            propertySetSpaceZones.Name = "Space Zones";

            propertySetSpaceZones.EntityTypes.Add(IFCEntityType.IfcSpace);

            propertySetSpaceZones.AddEntry(PropertySetEntry.CreateLabel("Security Zone"));
            propertySetSpaceZones.AddEntry(PropertySetEntry.CreateLabel("Preservation Zone"));
            propertySetSpaceZones.AddEntry(PropertySetEntry.CreateLabel("Privacy Zone"));
            if (fileVersion != IFCVersion.IFC2x2)
            {
                propertySetSpaceZones.AddEntry(PropertySetEntry.CreateLabel("Zone GrossAreaPlanned"));
                propertySetSpaceZones.AddEntry(PropertySetEntry.CreateLabel("Zone NetAreaPlanned"));
            }

            PropertySetEntry ifcPSE = PropertySetEntry.CreateListValue("Project Specific Zone", PropertyType.Label);
            ifcPSE.PropertyCalculator = SpecificZoneCalculator.Instance;
            ifcPSE.UseCalculatorOnly = true;
            propertySetSpaceZones.AddEntry(ifcPSE);

            commonPropertySets.Add(propertySetSpaceZones);
        }
        // Properties

        /// <summary>
        /// Initialize user-defined property sets (from external file ParameterMappingTable.txt)
        /// </summary>
        /// <param name="propertySets">List of Psets</param>
        /// <param name="fileVersion">file version - (not used)</param>
        private static void InitUserDefinedPropertySets(IList<IList<PropertySetDescription>> propertySets, IFCVersion fileVersion)
        {
            Document document = ExporterCacheManager.Document;
            IList<PropertySetDescription> userDefinedPropertySets = new List<PropertySetDescription>();

            // get the Pset definitions (using the same file as PropertyMap)
            IList<PropertySetDef> userDefinedPsetDefs = new List<PropertySetDef>();
            userDefinedPsetDefs = PropertyMap.LoadUserDefinedPset();

            // Loop through each definition and add the Pset entries into Cache
            foreach (PropertySetDef psetDef in userDefinedPsetDefs)
            {
                // Add Propertyset entry
                PropertySetDescription userDefinedPropetySet = new PropertySetDescription();
                userDefinedPropetySet.Name = psetDef.propertySetName;
                foreach (string elem in psetDef.applicableElements)
                {
                    IFCEntityType ifcEntity;
                    if (Enum.TryParse(elem, out ifcEntity))
                        userDefinedPropetySet.EntityTypes.Add(ifcEntity);
                }
                foreach (PropertyDef prop in psetDef.propertyDefs)
                {
                    PropertyType dataType;
                    PropertySetEntry pSE;

                    if (!Enum.TryParse(prop.propertyDataType, out dataType))
                        dataType = PropertyType.Text;           // force default to Text/string if the type does not match with any correct datatype

                    // Currently we will support only basic datatypes: Text, Integer, Real, Boolean
                    switch (dataType)
                    {
                        case PropertyType.Integer:
                            pSE = PropertySetEntry.CreateInteger(prop.propertyName);
                            break;
                        case PropertyType.Real:
                            pSE = PropertySetEntry.CreateReal(prop.propertyName);
                            break;
                        case PropertyType.Boolean:
                            pSE = PropertySetEntry.CreateBoolean(prop.propertyName);
                            break;
                        case PropertyType.Text:
                            pSE = PropertySetEntry.CreateText(prop.propertyName);
                            break;
                        default:
                            pSE = PropertySetEntry.CreateText(prop.propertyName);
                            break;
                    }

                    if (string.Compare(prop.propertyName, prop.revitParameterName) != 0)
                    {
                        pSE.RevitParameterName = prop.revitParameterName;
                    }
                    userDefinedPropetySet.AddEntry(pSE);
                }
                userDefinedPropertySets.Add(userDefinedPropetySet);
            }

            propertySets.Add(userDefinedPropertySets);
        }
        /// <summary>
        /// Initializes common level property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitPropertySetLevelCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            //property level common
            PropertySetDescription propertySetLevelCommon = new PropertySetDescription();
            propertySetLevelCommon.Name = "Pset_BuildingStoreyCommon";
            propertySetLevelCommon.EntityTypes.Add(IFCEntityType.IfcBuildingStorey);
            propertySetLevelCommon.SubElementIndex = (int)IFCCommonPSets.PSetBuildingStoreyCommon;

            PropertySetEntry ifcPSE = PropertySetEntry.CreateBoolean("EntranceLevel");
            propertySetLevelCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateLogical("AboveGround");
            propertySetLevelCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateBoolean("SprinklerProtection");
            propertySetLevelCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateBoolean("SprinklerProtectionAutomatic");
            propertySetLevelCommon.AddEntry(ifcPSE);

            ifcPSE = PropertySetEntry.CreateReal("GrossAreaPlanned");
            propertySetLevelCommon.AddEntry(ifcPSE);

            if (fileVersion != IFCVersion.IFC2x2)
            {
                ifcPSE = PropertySetEntry.CreateReal("NetAreaPlanned");
                propertySetLevelCommon.AddEntry(ifcPSE);
            }

            commonPropertySets.Add(propertySetLevelCommon);
        }
Пример #36
0
 /// <summary>
 /// Initializes base quantities.
 /// </summary>
 /// <param name="quantities">List to store quantities.</param>
 /// <param name="fileVersion">The file version, currently unused.</param>
 private static void InitBaseQuantities(IList<IList<QuantityDescription>> quantities, IFCVersion fileVersion)
 {
     IList<QuantityDescription> baseQuantities = new List<QuantityDescription>();
     InitCeilingBaseQuantities(baseQuantities);
     InitRailingBaseQuantities(baseQuantities);
     InitSlabBaseQuantities(baseQuantities);
     InitRampFlightBaseQuantities(baseQuantities);
     quantities.Add(baseQuantities);
 }
        // Properties
        /// <summary>
        /// Initializes common property sets.
        /// </summary>
        /// <param name="propertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitCommonPropertySets(IList<IList<PropertySetDescription>> propertySets, IFCVersion fileVersion)
        {
            IList<PropertySetDescription> commonPropertySets = new List<PropertySetDescription>();

            // Building/Site property sets.
            InitPropertySetBuildingCommon(commonPropertySets, fileVersion);
            InitPropertySetBuildingWaterStorage(commonPropertySets);
            InitPropertySetSiteCommon(commonPropertySets);

            // Architectural property sets.
            InitPropertySetBuildingElementProxyCommon(commonPropertySets);
            InitPropertySetCoveringCommon(commonPropertySets, fileVersion);
            InitPropertySetCurtainWallCommon(commonPropertySets);
            InitPropertySetDoorCommon(commonPropertySets);
            InitPropertySetLevelCommon(commonPropertySets, fileVersion);
            InitPropertySetRailingCommon(commonPropertySets);
            InitPropertySetRampCommon(commonPropertySets);
            InitPropertySetRampFlightCommon(commonPropertySets);
            InitPropertySetRoofCommon(commonPropertySets, fileVersion);
            InitPropertySetSlabCommon(commonPropertySets);
            InitPropertySetStairCommon(commonPropertySets);
            InitPropertySetStairFlightCommon(commonPropertySets);
            InitPropertySetWallCommon(commonPropertySets);
            InitPropertySetWindowCommon(commonPropertySets);

            // Building property sets.
            InitPropertySetBuildingCommon(commonPropertySets, fileVersion);
            InitPropertySetBuildingWaterStorage(commonPropertySets);

            // Proxy property sets.
            InitPropertySetElementShading(commonPropertySets);

            // Level property sets.
            InitPropertySetLevelCommon(commonPropertySets, fileVersion);

            // Site property sets.
            InitPropertySetSiteCommon(commonPropertySets);

            // Building Element Proxy
            InitPropertySetBuildingElementProxyCommon(commonPropertySets);

            // Space
            InitPropertySetSpaceCommon(commonPropertySets, fileVersion);
            InitPropertySetSpaceFireSafetyRequirements(commonPropertySets);
            InitPropertySetSpaceLightingRequirements(commonPropertySets);
            InitPropertySetSpaceThermalRequirements(commonPropertySets, fileVersion);
            InitPropertySetGSASpaceCategories(commonPropertySets);
            InitPropertySetSpaceOccupant(commonPropertySets);
            InitPropertySetSpaceOccupancyRequirements(commonPropertySets);
            InitPropertySetSpaceZones(commonPropertySets, fileVersion);

            // Structural property sets.
            InitPropertySetBeamCommon(commonPropertySets);
            InitPropertySetColumnCommon(commonPropertySets);
            InitPropertySetMemberCommon(commonPropertySets);

            // MEP property sets.
            InitPropertySetAirTerminalTypeCommon(commonPropertySets);
            InitPropertySetDistributionFlowElementCommon(commonPropertySets);
            InitPropertySetFlowTerminalAirTerminal(commonPropertySets);
            InitPropertySetLightFixtureTypeCommon(commonPropertySets);

            // Energy Analysis property sets.
            InitPropertySetElementShading(commonPropertySets);

            // Misc. property sets
            InitPropertySetManufacturerTypeInformation(commonPropertySets);

            propertySets.Add(commonPropertySets);
        }
Пример #38
0
 /// <summary>
 /// Identifies if the schema version being exported is IFC 2x3 Coordination View 2.0.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs2x3CoordinationView2(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC2x3CV2 || fileVersion == IFCVersion.IFCBCA);
 }
Пример #39
0
 /// <summary>
 /// Identifies if the schema version being exported is IFC 2x3 Coordination View 1.0.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs2x3CoordinationView1(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC2x3);
 }
Пример #40
0
 /// <summary>
 /// Creates a builtIn configuration by particular options.
 /// </summary>
 /// <param name="name">The configuration name.</param>
 /// <param name="ifcVersion">The IFCVersion.</param>
 /// <param name="spaceBoundaries">The space boundary level.</param>
 /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
 /// <param name="splitWalls">The SplitWallsAndColumns option.</param>
 /// <param name="internalSets">The ExportInternalRevitPropertySets option.</param>
 /// <param name="schedulesAsPSets">The ExportSchedulesAsPsets option.</param>
 /// <param name="userDefinedPSets">The ExportUserDefinedPsets option.</param>
 /// <param name="PlanElems2D">The Export2DElements option.</param>
 /// <param name="exportBoundingBox">The exportBoundingBox option.</param>
 /// <param name="exportLinkedFiles">The exportLinkedFiles option.</param>
 /// <returns>The builtIn configuration.</returns>
 public static IFCExportConfiguration CreateBuiltInConfiguration(string name,
                            IFCVersion ifcVersion,
                            int spaceBoundaries,
                            bool exportBaseQuantities,
                            bool splitWalls,
                            bool internalSets,
                            bool schedulesAsPSets,
                            bool userDefinedPSets,
                            bool PlanElems2D,
                            bool exportBoundingBox,
                            bool exportLinkedFiles)
 {
     IFCExportConfiguration configuration = new IFCExportConfiguration();
     configuration.Name = name;
     configuration.IFCVersion = ifcVersion;
     configuration.IFCFileType = IFCFileFormat.Ifc;
     configuration.SpaceBoundaries = spaceBoundaries;
     configuration.ExportBaseQuantities = exportBaseQuantities;
     configuration.SplitWallsAndColumns = splitWalls;
     configuration.ExportInternalRevitPropertySets = internalSets;
     configuration.ExportIFCCommonPropertySets = true;
     configuration.Export2DElements = PlanElems2D;
     configuration.VisibleElementsOfCurrentView = false;
     configuration.Use2DRoomBoundaryForVolume = false;
     configuration.UseFamilyAndTypeNameForReference = false;
     configuration.ExportPartsAsBuildingElements = false;
     configuration.ExportBoundingBox = exportBoundingBox;
     configuration.ExportSolidModelRep = false;
     configuration.ExportSchedulesAsPsets = schedulesAsPSets;
     configuration.ExportUserDefinedPsets = userDefinedPSets;
     configuration.ExportUserDefinedPsetsFileName = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\" + name + @".txt";
     configuration.ExportLinkedFiles = exportLinkedFiles;
     configuration.IncludeSiteElevation = false;
     configuration.UseCoarseTessellation = true;
     configuration.StoreIFCGUID = false;
     configuration.m_isBuiltIn = true;
     configuration.m_isInSession = false;
     configuration.ActivePhaseId = ElementId.InvalidElementId;
     return configuration;
 }
        /// <summary>
        /// Initializes common building property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitPropertySetBuildingCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            // Pset_BuildingCommon
            PropertySetDescription propertySetBuildingCommon = new PropertySetDescription();
            propertySetBuildingCommon.Name = "Pset_BuildingCommon";
            propertySetBuildingCommon.EntityTypes.Add(IFCEntityType.IfcBuilding);
            propertySetBuildingCommon.SubElementIndex = (int)IFCCommonPSets.PSetBuildingCommon;

            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateIdentifier("BuildingID"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateBoolean("IsPermanentID"));
                propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateLabel("MainFireUse"));
                propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateLabel("AncillaryFireUse"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateBoolean("SprinklerProtection"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateBoolean("SprinklerProtectionAutomatic"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateLabel("OccupancyType"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateArea("GrossPlannedArea"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateLabel("YearOfConstruction"));
            propertySetBuildingCommon.AddEntry(PropertySetEntry.CreateBoolean("IsLandmarked"));

            if (fileVersion != IFCVersion.IFC2x2)
            {
                PropertySetEntry ifcPSE = PropertySetEntry.CreateInteger("NumberOfStoreys");
                ifcPSE.PropertyCalculator = NumberOfStoreysCalculator.Instance;
                propertySetBuildingCommon.AddEntry(ifcPSE);
            }

            commonPropertySets.Add(propertySetBuildingCommon);
        }
Пример #42
0
 /// <summary>
 /// Identifies if the IFC schema version being exported is IFC 4.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs4(IFCVersion fileVersion)
 {
     return((fileVersion == IFCVersion.IFC4) || (fileVersion == IFCVersion.IFC4RV) || (fileVersion == IFCVersion.IFC4DTV));
 }
        /// <summary>
        /// Initializes common space property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSpaceCommon(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            //property set space common
            PropertySetDescription propertySetSpaceCommon = new PropertySetDescription();
            propertySetSpaceCommon.Name = "Pset_SpaceCommon";

            propertySetSpaceCommon.EntityTypes.Add(IFCEntityType.IfcSpace);

            PropertySetEntry ifcPSE = PropertySetEntryUtil.CreateReferenceEntry();
            propertySetSpaceCommon.AddEntry(ifcPSE);

            propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateBoolean("PubliclyAccessible"));
            propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateBoolean("HandicapAccessible"));
            propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateArea("GrossPlannedArea"));

            if (fileVersion == IFCVersion.IFC2x2)
            {
                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateLabel("OccupancyType"));
                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateReal("OccupancyNumber"));
            
                ifcPSE = PropertySetEntry.CreateBoolean("Concealed");
                ifcPSE.PropertyCalculator = SpaceConcealCalculator.Instance;
                propertySetSpaceCommon.AddEntry(ifcPSE);
            }
            else
            {
                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateLabel("Category"));
                
                ifcPSE = PropertySetEntry.CreateLabel("CeilingCovering");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.ROOM_FINISH_CEILING;
                propertySetSpaceCommon.AddEntry(ifcPSE);

                ifcPSE = PropertySetEntry.CreateLabel("WallCovering");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.ROOM_FINISH_WALL;
                propertySetSpaceCommon.AddEntry(ifcPSE);

                ifcPSE = PropertySetEntry.CreateLabel("FloorCovering");
                ifcPSE.RevitBuiltInParameter = BuiltInParameter.ROOM_FINISH_FLOOR;
                propertySetSpaceCommon.AddEntry(ifcPSE);

                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateLabel("SkirtingBoard"));
                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateArea("NetPlannedArea"));
                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateBoolean("ConcealedFlooring"));
                propertySetSpaceCommon.AddEntry(PropertySetEntry.CreateBoolean("ConcealedCeiling"));
            }

            commonPropertySets.Add(propertySetSpaceCommon);
        }
Пример #44
0
 /// <summary>
 /// Identifies if the schema used is IFC 2x3.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs2x3(IFCVersion fileVersion)
 {
     return((fileVersion == IFCVersion.IFC2x3) || (fileVersion == IFCVersion.IFCCOBIE) || (fileVersion == IFCVersion.IFC2x3FM) ||
            (fileVersion == IFCVersion.IFC2x3BFM) || (fileVersion == IFCVersion.IFC2x3CV2));
 }
        /// <summary>
        /// Initializes SpaceThermalRequirements property sets.
        /// </summary>
        /// <param name="commonPropertySets">List to store property sets.</param>
        private static void InitPropertySetSpaceThermalRequirements(IList<PropertySetDescription> commonPropertySets, IFCVersion fileVersion)
        {
            PropertySetDescription propertySetSpaceThermalRequirements = new PropertySetDescription();
            propertySetSpaceThermalRequirements.Name = "Pset_SpaceThermalRequirements";

            propertySetSpaceThermalRequirements.EntityTypes.Add(IFCEntityType.IfcSpace);

            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureMax"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureMin"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateRatio("SpaceHumidity"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateRatio("SpaceHumiditySummer"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateRatio("SpaceHumidityWinter"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateBoolean("DiscontinuedHeating"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateBoolean("NaturalVentilation"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateCount("NaturalVentilationRate"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateCount("MechanicalVentilationRate"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateBoolean("AirConditioning"));
            propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateBoolean("AirConditioningCentral"));

            if (fileVersion == IFCVersion.IFC2x2)
            {
                PropertySetEntry ifcPSE = PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureSummer");
                ifcPSE.PropertyCalculator = new SpaceTemperatureCalculator("SpaceTemperatureSummer");
                propertySetSpaceThermalRequirements.AddEntry(ifcPSE);

                ifcPSE = PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureWinter");
                ifcPSE.PropertyCalculator = new SpaceTemperatureCalculator("SpaceTemperatureWinter");
                propertySetSpaceThermalRequirements.AddEntry(ifcPSE);
            }
            else
            {
                propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureSummerMax"));
                propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureSummerMin"));
                propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureWinterMax"));
                propertySetSpaceThermalRequirements.AddEntry(PropertySetEntry.CreateThermodynamicTemperature("SpaceTemperatureWinterMin"));
            }
            
            commonPropertySets.Add(propertySetSpaceThermalRequirements);
        }
Пример #46
0
 /// <summary>
 /// Identifies if the schema and MVD used is the IFC 2x3 GSA 2010 COBie specification.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAsCOBIE(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFCCOBIE);
 }
        /// <summary>
        /// Initializes custom property sets from schedules.
        /// </summary>
        /// <param name="propertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitCustomPropertySets(IList<IList<PropertySetDescription>> propertySets, IFCVersion fileVersion)
        {
            Document document = ExporterCacheManager.Document;
            IList<PropertySetDescription> customPropertySets = new List<PropertySetDescription>();

            // Collect all ViewSchedules from the document to use as custom property sets.
            FilteredElementCollector viewScheduleElementCollector = new FilteredElementCollector(document);

            ElementFilter viewScheduleElementFilter = new ElementClassFilter(typeof(ViewSchedule));
            viewScheduleElementCollector.WherePasses(viewScheduleElementFilter);

            int unnamedScheduleIndex = 1;
            foreach (ViewSchedule schedule in viewScheduleElementCollector)
            {
                //property set Manufacturer Information
                PropertySetDescription customPSet = new PropertySetDescription();

                string scheduleName = schedule.Name;
                if (string.IsNullOrWhiteSpace(scheduleName))
                {
                    scheduleName = "Unnamed Schedule " + unnamedScheduleIndex;
                    unnamedScheduleIndex++;
                }
                customPSet.Name = scheduleName;
                
                ScheduleDefinition definition = schedule.Definition;
                if (definition == null)
                    continue;

                // The schedule will be responsible for determining which elements to actually export.
                customPSet.ViewScheduleId = schedule.Id;
                customPSet.EntityTypes.Add(IFCEntityType.IfcElement);
                
                int fieldCount = definition.GetFieldCount();
                if (fieldCount == 0)
                    continue;

                HashSet<ElementId> containedElementIds = new HashSet<ElementId>();
                FilteredElementCollector elementsInViewScheduleCollector = new FilteredElementCollector(document, schedule.Id);
                foreach (Element containedElement in elementsInViewScheduleCollector)
                {
                    containedElementIds.Add(containedElement.Id);
                }
                ExporterCacheManager.ViewScheduleElementCache.Add(new KeyValuePair<ElementId, HashSet<ElementId>>(schedule.Id, containedElementIds));

                IDictionary<ElementId, Element> cachedElementTypes = new Dictionary<ElementId, Element>();

                for (int ii = 0; ii < fieldCount; ii++)
                {
                    ScheduleField field = definition.GetField(ii);

                    ScheduleFieldType fieldType = field.FieldType;
                    if (fieldType != ScheduleFieldType.Instance && fieldType != ScheduleFieldType.ElementType)
                        continue;

                    ElementId parameterId = field.ParameterId;
                    if (parameterId == ElementId.InvalidElementId)
                        continue;

                    // We use asBuiltInParameterId to get the parameter by id below.  We don't want to use it later, however, so
                    // we store builtInParameterId only if it is a proper member of the enumeration.
                    BuiltInParameter asBuiltInParameterId = (BuiltInParameter)parameterId.IntegerValue;
                    BuiltInParameter builtInParameterId =
                        Enum.IsDefined(typeof(BuiltInParameter), asBuiltInParameterId) ? asBuiltInParameterId : BuiltInParameter.INVALID;

                    Parameter containedElementParameter = null;
                   
                    // We could cache the actual elements when we store the element ids.  However, this would almost certainly take more
                    // time than getting one of the first few elements in the collector.
                    foreach (Element containedElement in elementsInViewScheduleCollector)
                    {
                        if (fieldType == ScheduleFieldType.Instance)
                            containedElementParameter = containedElement.get_Parameter(asBuiltInParameterId);

                        // shared parameters can return ScheduleFieldType.Instance, even if they are type parameters, so take a look.
                        if (containedElementParameter == null)
                        {
                            ElementId containedElementTypeId = containedElement.GetTypeId();
                            Element containedElementType = null;
                            if (containedElementTypeId != ElementId.InvalidElementId)
                            {
                                if (!cachedElementTypes.TryGetValue(containedElementTypeId, out containedElementType))
                                {
                                    containedElementType = document.GetElement(containedElementTypeId);
                                    cachedElementTypes[containedElementTypeId] = containedElementType;
                                }
                            }
                            if (containedElementType != null)
                                containedElementParameter = containedElementType.get_Parameter(asBuiltInParameterId);
                        }

                        if (containedElementParameter != null)
                            break;
                    }
                    if (containedElementParameter == null)
                        continue;

                    PropertySetEntry ifcPSE = PropertySetEntry.CreateParameterEntry(containedElementParameter);
                    ifcPSE.RevitBuiltInParameter = builtInParameterId;
                    ifcPSE.PropertyName = field.ColumnHeading;
                    customPSet.AddEntry(ifcPSE);
                }

                customPropertySets.Add(customPSet);
            }

            propertySets.Add(customPropertySets);
        }
Пример #48
0
 /// <summary>
 /// Identifies if the schema and MVD used is the IFC 4 Reference View.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs4ReferenceView(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC4RV);
 }
        /// <summary>
        /// Initializes base quantities.
        /// </summary>
        /// <param name="quantities">List to store quantities.</param>
        /// <param name="fileVersion">The file version, currently unused.</param>
        private static void InitBaseQuantities(IList<IList<QuantityDescription>> quantities, IFCVersion fileVersion)
        {
            IList<QuantityDescription> baseQuantities = new List<QuantityDescription>();
            InitCeilingBaseQuantities(baseQuantities);
            InitRailingBaseQuantities(baseQuantities);
            InitSlabBaseQuantities(baseQuantities);
            InitRampFlightBaseQuantities(baseQuantities);
            InitBuildingStoreyBaseQuantities(baseQuantities);
            InitSpaceBaseQuantities(baseQuantities);
            InitCoveringBaseQuantities(baseQuantities);
            InitWindowBaseQuantities(baseQuantities);
            InitDoorBaseQuantities(baseQuantities);

            quantities.Add(baseQuantities);
        }
Пример #50
0
 /// <summary>
 /// Identifies if the schema and MVD used is the IFC 4 Design Transfer View.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs4DesignTransferView(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC4DTV);
 }
        /// <summary>
        /// Initializes common property sets.
        /// </summary>
        /// <param name="propertySets">List to store property sets.</param>
        /// <param name="fileVersion">The IFC file version.</param>
        private static void InitCommonPropertySets(IList<IList<PropertySetDescription>> propertySets, IFCVersion fileVersion)
        {
            IList<PropertySetDescription> commonPropertySets = new List<PropertySetDescription>();

            // Building/Site property sets.
            InitPropertySetBuildingCommon(commonPropertySets, fileVersion);
            InitPropertySetBuildingWaterStorage(commonPropertySets);
            InitPropertySetSiteCommon(commonPropertySets);

            // Architectural property sets.
            InitPropertySetBuildingElementProxyCommon(commonPropertySets);
            InitPropertySetCoveringCommon(commonPropertySets, fileVersion);
            InitPropertySetCurtainWallCommon(commonPropertySets);
            InitPropertySetDoorCommon(commonPropertySets);
            InitPropertySetLevelCommon(commonPropertySets, fileVersion);
            InitPropertySetRailingCommon(commonPropertySets);
            InitPropertySetRampCommon(commonPropertySets);
            InitPropertySetRampFlightCommon(commonPropertySets);
            InitPropertySetRoofCommon(commonPropertySets, fileVersion);
            InitPropertySetSlabCommon(commonPropertySets);
            InitPropertySetStairCommon(commonPropertySets);
            InitPropertySetStairFlightCommon(commonPropertySets);
            InitPropertySetWallCommon(commonPropertySets);
            InitPropertySetWindowCommon(commonPropertySets);

            // Space property sets.
            InitPropertySetSpaceCommon(commonPropertySets, fileVersion);
            InitPropertySetSpaceFireSafetyRequirements(commonPropertySets);
            InitPropertySetSpaceLightingRequirements(commonPropertySets);
            InitPropertySetSpaceThermalDesign(commonPropertySets);
            InitPropertySetSpaceThermalRequirements(commonPropertySets, fileVersion);
            InitPropertySetGSASpaceCategories(commonPropertySets);
            InitPropertySetSpaceOccupant(commonPropertySets);
            InitPropertySetSpaceOccupancyRequirements(commonPropertySets);
            InitPropertySetSpaceZones(commonPropertySets, fileVersion);

            // Structural property sets.
            InitPropertySetBeamCommon(commonPropertySets);
            InitPropertySetColumnCommon(commonPropertySets);
            InitPropertySetMemberCommon(commonPropertySets);
            InitPropertySetPlateCommon(commonPropertySets);
            InitPropertySetReinforcingBarBendingsBECCommon(commonPropertySets);
            InitPropertySetReinforcingBarBendingsBS8666Common(commonPropertySets);
            InitPropertySetReinforcingBarBendingsDIN135610Common(commonPropertySets);
            InitPropertySetReinforcingBarBendingsISOCD3766Common(commonPropertySets);

            // MEP property sets.
            InitPropertySetAirTerminalTypeCommon(commonPropertySets);
            InitPropertySetDistributionFlowElementCommon(commonPropertySets);
            InitPropertySetElectricalCircuit(commonPropertySets);
            InitPropertySetElectricalDeviceCommon(commonPropertySets);
            InitPropertySetFlowTerminalAirTerminal(commonPropertySets);
            InitPropertySetLightFixtureTypeCommon(commonPropertySets);
            InitPropertySetProvisionForVoid(commonPropertySets);
            InitPropertySetSanitaryTerminalTypeBath(commonPropertySets);
            InitPropertySetSanitaryTerminalTypeShower(commonPropertySets);
            InitPropertySetSanitaryTerminalTypeSink(commonPropertySets);
            InitPropertySetSanitaryTerminalTypeToiletPan(commonPropertySets);
            InitPropertySetSanitaryTerminalTypeWashHandBasin(commonPropertySets);
            InitPropertySetSwitchingDeviceTypeCommon(commonPropertySets);
            InitPropertySetSwitchingDeviceTypeToggleSwitch(commonPropertySets);
            InitPropertySetZoneCommon(commonPropertySets, fileVersion);

                // Energy Analysis property sets.
                InitPropertySetElementShading(commonPropertySets);

            // Misc. property sets
            InitPropertySetManufacturerTypeInformation(commonPropertySets);

            propertySets.Add(commonPropertySets);
        }
Пример #52
0
 /// <summary>
 /// Option to be used for general IFC4 export (not specific to RV or DTV MVDs). Useful when there is a need to export entities that are not strictly valid within RV or DTV
 /// It should work like IFC2x3, except that it will use IFC4 tessellated geometry instead of IFC2x3 BREP
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs4General(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC4);
 }
Пример #53
0
 /// <summary>
 /// Sets the lists of property sets to be exported.  This can be overriden.
 /// </summary>
 protected virtual void InitializePropertySets(IFCVersion fileVersion)
 {
     ExporterInitializer.InitPropertySets(m_PropertySetsToExport, ExporterCacheManager.ExportOptionsCache.FileVersion);
 }
Пример #54
0
 /// <summary>
 /// Identifies if the schema and MVD used is the IFC 2x3 COBie 2.4 Design Deliverable.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs2x3COBIE24DesignDeliverable(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC2x3FM);
 }
Пример #55
0
 /// <summary>
 /// Identifies if the schema version being exported is IFC 2x3 Extended FM Handover View (e.g., UK COBie).
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAs2x3ExtendedFMHandoverView(IFCVersion fileVersion)
 {
     return(fileVersion == IFCVersion.IFC2x3FM);
 }
Пример #56
0
 /// <summary>
 /// Creates a builtIn configuration by particular options.
 /// </summary>
 /// <param name="name">The configuration name.</param>
 /// <param name="ifcVersion">The IFCVersion.</param>
 /// <param name="spaceBoundaries">The space boundary level.</param>
 /// <param name="exportBaseQuantities">The ExportBaseQuantities.</param>
 /// <param name="splitWalls">The SplitWallsAndColumns.</param>
 /// <param name="internalSets">The ExportInternalRevitPropertySets.</param>
 /// <param name="PlanElems2D">The Export2DElements.</param>
 /// <returns>The builtIn configuration.</returns>
 public static IFCExportConfiguration CreateBuiltInConfiguration(string name, 
                            IFCVersion ifcVersion, 
                            int spaceBoundaries,
                            bool exportBaseQuantities,
                            bool splitWalls,
                            bool internalSets,
                            bool PlanElems2D)
 {
     IFCExportConfiguration configuration = new IFCExportConfiguration();
     configuration.Name = name; 
     configuration.IFCVersion = ifcVersion; 
     configuration.IFCFileType = IFCFileFormat.Ifc; 
     configuration.SpaceBoundaries = spaceBoundaries;
     configuration.ExportBaseQuantities = exportBaseQuantities;                    
     configuration.SplitWallsAndColumns = splitWalls;
     configuration.ExportInternalRevitPropertySets = internalSets;
     configuration.Export2DElements = PlanElems2D;
     configuration.VisibleElementsOfCurrentView = false;   
     configuration.Use2DRoomBoundaryForVolume = false;
     configuration.UseFamilyAndTypeNameForReference = false;
     configuration.ExportPartsAsBuildingElements = false;
     configuration.m_isBuiltIn = true;
     configuration.m_isInSession = false; 
     return configuration;
 }
Пример #57
0
 /// <summary>
 /// Constructs the file version choices.
 /// </summary>
 /// <param name="version"></param>
 public IFCVersionAttributes(IFCVersion version)
 {
     Version = version;
 }
Пример #58
0
 /// <summary>
 /// Identifies if the schema version and MVD being exported is IFC 2x3 Coordination View 2.0 or any IFC 4 MVD.
 /// </summary>
 /// <remarks>IFC 4 Coordination View 2.0 is not a real MVD; this was a placeholder and is obsolete.</remarks>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAsCoordinationView2(IFCVersion fileVersion)
 {
     return((fileVersion == IFCVersion.IFC2x3CV2) || (fileVersion == IFCVersion.IFC4) || (fileVersion == IFCVersion.IFC2x3FM) ||
            (fileVersion == IFCVersion.IFC2x3BFM) || (fileVersion == IFCVersion.IFCBCA));
 }
Пример #59
0
 /// <summary>
 /// Constructs the file version choices.
 /// </summary>
 /// <param name="version"></param>
 public IFCVersionAttributes(IFCVersion version)
 {
     Version = version;
 }
Пример #60
0
 /// <summary>
 /// Identifies if the IFC schema version is older than IFC 4.
 /// </summary>
 /// <param name="fileVersion">The file version</param>
 public static bool ExportAsOlderThanIFC4(IFCVersion fileVersion)
 {
     return(ExportAs2x2(fileVersion) || ExportAs2x3(fileVersion));
 }