Search Results for

    Show / Hide Table of Contents

    Class IfcStore

    The IfcStore is the main entry point for working with Model files of any format.

    IfcStore handles opening, parsing, export, and (optionally persistence) of Ifc files in any format, as well as accessing internal XBIM formats (such as *.xbim) files.

    Inheritance
    System.Object
    IfcStore
    Implements
    IModel
    System.IDisposable
    IFederatedModel
    System.IEquatable<IModel>
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Xbim.Ifc
    Assembly: Xbim.Ifc.dll
    Syntax
    public class IfcStore : IModel, IDisposable, IFederatedModel, IEquatable<IModel>
    Remarks

    Note: the Store capabilities may be affected by the ModelProvider implementation - some stores may not implement all capabilities. e.g. An In-Memory store will not permit saving to XBIM format.

    IMPORTANT: By default, the v5 IfcStore will attempt to discover the HeuristicModelProvider (in the Esent assembly), by probing the app's loaded assemblies. This provider gives the same functionality as prior IfcStore versions. However, this will only be discovered if Xbim.IO.Esent dll has been referenced and loaded. ASP.NET apps do this automatically, but console and windows apps may not load the DLL into the AppDomain unless a type is referenced. If the store cannot be discover the Heuristic provider it will fall back to a MemoryModelProvider which is less efficient with larger models.

    To guarantee the correct provider regardless, configure ModelProviderFactory with the following code in your application initialisation:

    IfcStore.ModelProviderFactory.UseHeuristicModelProvider();

    Constructors

    | Improve this Doc View Source

    IfcStore()

    Declaration
    protected IfcStore()
    | Improve this Doc View Source

    IfcStore(String, XbimSchemaVersion, XbimEditorCredentials)

    Constructor used to create a new persistent model with specified path

    Declaration
    protected IfcStore(string filepath, XbimSchemaVersion ifcVersion, XbimEditorCredentials editorDetails)
    Parameters
    Type Name Description
    System.String filepath
    XbimSchemaVersion ifcVersion
    XbimEditorCredentials editorDetails
    | Improve this Doc View Source

    IfcStore(XbimStoreType, XbimSchemaVersion, XbimEditorCredentials)

    Constructor used to create a new model for edit

    Declaration
    protected IfcStore(XbimStoreType storageType, XbimSchemaVersion ifcVersion, XbimEditorCredentials editorDetails)
    Parameters
    Type Name Description
    XbimStoreType storageType
    XbimSchemaVersion ifcVersion
    XbimEditorCredentials editorDetails

    Properties

    | Improve this Doc View Source

    CurrentTransaction

    Declaration
    public ITransaction CurrentTransaction { get; }
    Property Value
    Type Description
    ITransaction
    | Improve this Doc View Source

    DefaultOwningApplication

    Returns default application used to fill in owner history on new or modified objects. This object is only populated if you provide XbimEditorCredentials in one of constructors

    Declaration
    public IIfcApplication DefaultOwningApplication { get; }
    Property Value
    Type Description
    IIfcApplication
    | Improve this Doc View Source

    DefaultOwningUser

    Returns default user used to fill in owner history on new or modified objects. This object is only populated if you provide XbimEditorCredentials in one of constructors

    Declaration
    public IIfcPersonAndOrganization DefaultOwningUser { get; }
    Property Value
    Type Description
    IIfcPersonAndOrganization
    | Improve this Doc View Source

    EditorDetails

    Declaration
    public XbimEditorCredentials EditorDetails { get; }
    Property Value
    Type Description
    XbimEditorCredentials
    | Improve this Doc View Source

    EntityCache

    Declaration
    public IEntityCache EntityCache { get; }
    Property Value
    Type Description
    IEntityCache
    | Improve this Doc View Source

    FederatedInstanceHandles

    Declaration
    public IList<XbimInstanceHandle> FederatedInstanceHandles { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<XbimInstanceHandle>
    | Improve this Doc View Source

    FederatedInstances

    Declaration
    public IReadOnlyEntityCollection FederatedInstances { get; }
    Property Value
    Type Description
    IReadOnlyEntityCollection
    | Improve this Doc View Source

    FileName

    Declaration
    public string FileName { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    GeometryStore

    Declaration
    public IGeometryStore GeometryStore { get; }
    Property Value
    Type Description
    IGeometryStore
    | Improve this Doc View Source

    Header

    Declaration
    public IStepFileHeader Header { get; }
    Property Value
    Type Description
    IStepFileHeader
    | Improve this Doc View Source

    InstanceHandles

    Returns a list of the handles to only the entities in this model Note this do NOT include entities that are in any federated models

    Declaration
    public IList<XbimInstanceHandle> InstanceHandles { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<XbimInstanceHandle>
    | Improve this Doc View Source

    Instances

    Declaration
    public IEntityCollection Instances { get; }
    Property Value
    Type Description
    IEntityCollection
    | Improve this Doc View Source

    InverseCache

    Declaration
    public IInverseCache InverseCache { get; }
    Property Value
    Type Description
    IInverseCache
    | Improve this Doc View Source

    IsFederation

    Returns true if the model contains reference models or the model has extension xBIMf

    Declaration
    public virtual bool IsFederation { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsTransactional

    Declaration
    public bool IsTransactional { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Location

    Declaration
    public string Location { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Logger

    Declaration
    public ILogger Logger { get; set; }
    Property Value
    Type Description
    Microsoft.Extensions.Logging.ILogger
    | Improve this Doc View Source

    Metadata

    Declaration
    public ExpressMetaData Metadata { get; }
    Property Value
    Type Description
    ExpressMetaData
    | Improve this Doc View Source

    Model

    Declaration
    public IModel Model { get; }
    Property Value
    Type Description
    IModel
    | Improve this Doc View Source

    ModelFactors

    Declaration
    public IModelFactors ModelFactors { get; }
    Property Value
    Type Description
    IModelFactors
    | Improve this Doc View Source

    ModelProvider

    Provides access to model persistence capabilities

    Declaration
    protected IModelProvider ModelProvider { get; }
    Property Value
    Type Description
    IModelProvider
    | Improve this Doc View Source

    ModelProviderFactory

    Factory to create ModelProvider instances.

    Declaration
    public static IModelProviderFactory ModelProviderFactory { get; set; }
    Property Value
    Type Description
    IModelProviderFactory
    Remarks

    Consumers can use this instance of IModelProviderFactory to control the implementations of IModel it uses. In particular you can tell the factory to always use MemoryModel, or Esent model, or a blend (Heuristic)

    Examples

    To override the Store's backing model with an implementation you would use:

    IfcStore.ModelProvider.Use(() => new MyCustomModelProvider());
    | Improve this Doc View Source

    OwnerHistoryAddObject

    Declaration
    public IIfcOwnerHistory OwnerHistoryAddObject { get; }
    Property Value
    Type Description
    IIfcOwnerHistory
    | Improve this Doc View Source

    ReferencedModels

    Declaration
    public IEnumerable<IReferencedModel> ReferencedModels { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IReferencedModel>
    | Improve this Doc View Source

    ReferencingModel

    Declaration
    public IModel ReferencingModel { get; }
    Property Value
    Type Description
    IModel
    | Improve this Doc View Source

    SchemaVersion

    Declaration
    public XbimSchemaVersion SchemaVersion { get; }
    Property Value
    Type Description
    XbimSchemaVersion
    | Improve this Doc View Source

    Tag

    Declaration
    public object Tag { get; set; }
    Property Value
    Type Description
    System.Object
    | Improve this Doc View Source

    UserDefinedId

    Declaration
    public int UserDefinedId { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    AddModelReference(String, String, String)

    Adds a model as a reference or federated model, do not call inside a transaction

    Declaration
    public XbimReferencedModel AddModelReference(string refModelPath, string organisationName, string organisationRole)
    Parameters
    Type Name Description
    System.String refModelPath
    System.String organisationName
    System.String organisationRole
    Returns
    Type Description
    XbimReferencedModel
    | Improve this Doc View Source

    AddModelReference(IReferencedModel)

    Declaration
    public void AddModelReference(IReferencedModel model)
    Parameters
    Type Name Description
    IReferencedModel model
    | Improve this Doc View Source

    BeginEntityCaching()

    Declaration
    public IEntityCache BeginEntityCaching()
    Returns
    Type Description
    IEntityCache
    | Improve this Doc View Source

    BeginInverseCaching()

    Declaration
    public IInverseCache BeginInverseCaching()
    Returns
    Type Description
    IInverseCache
    | Improve this Doc View Source

    BeginTransaction(String)

    Declaration
    public ITransaction BeginTransaction(string name = null)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    ITransaction
    | Improve this Doc View Source

    Close()

    Closes the store and disposes of all resources. The store is invalid after this call

    Declaration
    public void Close()
    | Improve this Doc View Source

    Create(String, XbimEditorCredentials, XbimSchemaVersion)

    Creates a Database store at the specified location

    Declaration
    public static IfcStore Create(string filePath, XbimEditorCredentials editorDetails, XbimSchemaVersion ifcVersion)
    Parameters
    Type Name Description
    System.String filePath
    XbimEditorCredentials editorDetails
    XbimSchemaVersion ifcVersion
    Returns
    Type Description
    IfcStore
    | Improve this Doc View Source

    Create(XbimSchemaVersion, XbimStoreType)

    Declaration
    public static IfcStore Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType)
    Parameters
    Type Name Description
    XbimSchemaVersion ifcVersion
    XbimStoreType storageType
    Returns
    Type Description
    IfcStore
    | Improve this Doc View Source

    Create(XbimEditorCredentials, XbimSchemaVersion, XbimStoreType)

    Declaration
    public static IfcStore Create(XbimEditorCredentials editorDetails, XbimSchemaVersion ifcVersion, XbimStoreType storageType)
    Parameters
    Type Name Description
    XbimEditorCredentials editorDetails
    XbimSchemaVersion ifcVersion
    XbimStoreType storageType
    Returns
    Type Description
    IfcStore
    | Improve this Doc View Source

    Delete(IPersistEntity)

    Declaration
    public void Delete(IPersistEntity entity)
    Parameters
    Type Name Description
    IPersistEntity entity
    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    EnsureUniqueUserDefinedId()

    Declaration
    public void EnsureUniqueUserDefinedId()
    | Improve this Doc View Source

    Equals(Object)

    Returns true if it is another reference to this or if it is an embedded model

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    Equals(IModel)

    Returns true if it is another reference to this or if it is an embedded model

    Declaration
    public bool Equals(IModel other)
    Parameters
    Type Name Description
    IModel other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ForEach<TSource>(IEnumerable<TSource>, Action<TSource>)

    Declaration
    public void ForEach<TSource>(IEnumerable<TSource> source, Action<TSource> body)
        where TSource : IPersistEntity
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source
    System.Action<TSource> body
    Type Parameters
    Name Description
    TSource
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    InsertCopy<T>(T, XbimInstanceHandleMap, PropertyTranformDelegate, Boolean, Boolean)

    Declaration
    public T InsertCopy<T>(T toCopy, XbimInstanceHandleMap mappings, PropertyTranformDelegate propTransform, bool includeInverses, bool keepLabels)
        where T : IPersistEntity
    Parameters
    Type Name Description
    T toCopy
    XbimInstanceHandleMap mappings
    PropertyTranformDelegate propTransform
    System.Boolean includeInverses
    System.Boolean keepLabels
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Open(Stream, StorageType, XbimSchemaVersion, XbimModelType, XbimEditorCredentials, XbimDBAccess, ReportProgressDelegate, Int32)

    You can use this function to open IFC model from a System.IO.Stream. You need to know file type (IFC, IFCZIP, IFCXML) and schema type (IFC2x3 or IFC4) to be able to use this function. If you don't know, you should the overloaded Open(String, XbimEditorCredentials, Nullable<Double>, ReportProgressDelegate, XbimDBAccess, Int32) method which takes file paths as an argument, and can automatically detect schema and file type. If are opening an *.xbim file you should also use the path-based overload because Esent database needs to operate on the file and this function will have to create temporal file if it is not a file stream. If the input is a FileStream, be aware this method may call System.IO.Stream.Close on it to keep exclusive access.

    Declaration
    public static IfcStore Open(Stream stream, StorageType dataType, XbimSchemaVersion schema, XbimModelType modelType, XbimEditorCredentials editorDetails = null, XbimDBAccess accessMode = XbimDBAccess.Read, ReportProgressDelegate progDelegate = null, int codePageOverride = -1)
    Parameters
    Type Name Description
    System.IO.Stream stream

    Stream of data

    StorageType dataType

    Type of data (*.ifc, *.ifcxml, *.ifczip)

    XbimSchemaVersion schema

    IFC schema (IFC2x3, IFC4). Other schemas are not supported by this class.

    XbimModelType modelType

    Type of model to be used. You can choose between EsentModel and MemoryModel

    XbimEditorCredentials editorDetails

    Optional details. You should always pass these if you are going to change the data.

    XbimDBAccess accessMode

    Access mode to the stream. This is only important if you choose EsentModel. MemoryModel is completely in memory so this is not relevant

    ReportProgressDelegate progDelegate

    Progress reporting delegate

    System.Int32 codePageOverride

    A CodePage that will be used to read implicitly encoded one-byte-char strings. If -1 is specified the default ISO8859-1 encoding will be used according to the Ifc specification.

    Returns
    Type Description
    IfcStore
    | Improve this Doc View Source

    Open(String, XbimEditorCredentials, Nullable<Double>, ReportProgressDelegate, XbimDBAccess, Int32)

    Opens an IFC file, Ifcxml, IfcZip, xbim from a file path

    Declaration
    public static IfcStore Open(string path, XbimEditorCredentials editorDetails = null, double? ifcDatabaseSizeThreshHold = null, ReportProgressDelegate progDelegate = null, XbimDBAccess accessMode = XbimDBAccess.Read, int codePageOverride = -1)
    Parameters
    Type Name Description
    System.String path

    the file name of the ifc, ifczip, ifcxml or xbim file to be opened

    XbimEditorCredentials editorDetails

    This is only required if the store is opened for editing

    System.Nullable<System.Double> ifcDatabaseSizeThreshHold

    Expressed in MB. If not defined the DefaultIfcDatabaseSizeThreshHold is used, IFC files below this size will be opened in memory, above this size a database will be created. If -1 is specified an in memory model will be created for all IFC files that are opened. Xbim files are always opened as databases

    ReportProgressDelegate progDelegate
    XbimDBAccess accessMode
    System.Int32 codePageOverride

    A CodePage that will be used to read implicitly encoded one-byte-char strings. If -1 is specified the default ISO8859-1 encoding will be used according to the Ifc specification.

    Returns
    Type Description
    IfcStore
    | Improve this Doc View Source

    SaveAs(String, Nullable<StorageType>, ReportProgressDelegate)

    Saves the model to the specified file

    Declaration
    public void SaveAs(string fileName, StorageType? format = null, ReportProgressDelegate progDelegate = null)
    Parameters
    Type Name Description
    System.String fileName

    Name of the file to save to, if no format is specified the extension is used to determine the format

    System.Nullable<StorageType> format

    if specified saves in the required format and changes the extension to the correct one

    ReportProgressDelegate progDelegate

    reports on progress

    Events

    | Improve this Doc View Source

    EntityDeleted

    Declaration
    public event DeletedEntityHandler EntityDeleted
    Event Type
    Type Description
    DeletedEntityHandler
    | Improve this Doc View Source

    EntityModified

    Declaration
    public event ModifiedEntityHandler EntityModified
    Event Type
    Type Description
    ModifiedEntityHandler
    | Improve this Doc View Source

    EntityNew

    Declaration
    public event NewEntityHandler EntityNew
    Event Type
    Type Description
    NewEntityHandler

    Operators

    | Improve this Doc View Source

    Equality(IfcStore, IModel)

    Declaration
    public static bool operator ==(IfcStore store, IModel model)
    Parameters
    Type Name Description
    IfcStore store
    IModel model
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Inequality(IfcStore, IModel)

    Declaration
    public static bool operator !=(IfcStore store, IModel model)
    Parameters
    Type Name Description
    IfcStore store
    IModel model
    Returns
    Type Description
    System.Boolean

    Explicit Interface Implementations

    | Improve this Doc View Source

    IModel.Activate(IPersistEntity)

    Declaration
    bool IModel.Activate(IPersistEntity owningEntity)
    Parameters
    Type Name Description
    IPersistEntity owningEntity
    Returns
    Type Description
    System.Boolean

    Implements

    IModel
    System.IDisposable
    IFederatedModel
    System.IEquatable<T>

    Extension Methods

    IfcStoreCopyItemsExtensions.InsertCopy(IModel, IEnumerable<IIfcProduct>, Boolean, Boolean, XbimInstanceHandleMap)
    IfcStoreExportExtensions.SaveAsIfc(IModel, Stream, ReportProgressDelegate)
    IfcStoreExportExtensions.SaveAsIfcXml(IModel, Stream, ReportProgressDelegate)
    IfcStoreExportExtensions.SaveAsIfcZip(IModel, Stream, String, StorageType, ReportProgressDelegate)
    IfcStoreGeometryExtensions.SaveAsWexBim(IModel, BinaryWriter, IEnumerable<IIfcProduct>, IVector3D)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2022 xbim