Search Results for

    Show / Hide Table of Contents

    Class EsentModel

    IModel implementation for Esent DB based model support

    Inheritance
    System.Object
    EsentModel
    Implements
    IModel
    IFederatedModel
    System.IDisposable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Xbim.IO.Esent
    Assembly: Xbim.IO.Esent.dll
    Syntax
    public class EsentModel : IModel, IFederatedModel, IDisposable

    Constructors

    | Improve this Doc View Source

    EsentModel(IEntityFactory)

    Declaration
    public EsentModel(IEntityFactory factory)
    Parameters
    Type Name Description
    IEntityFactory factory

    Fields

    | Improve this Doc View Source

    InstanceCache

    Declaration
    protected PersistedEntityInstanceCache InstanceCache
    Field Value
    Type Description
    PersistedEntityInstanceCache

    Properties

    | Improve this Doc View Source

    AllInstancesHandles

    Returns an enumerable of the handles to all entities in the model Note this includes entities that are in any federated models

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

    CanEdit

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

    CodePageOverride

    Some applications do not comply with the standard and used the Windows code page for text. This property gives the possibility to override the character encoding when reading ifc. default value = -1 - by standard http://www.buildingsmart-tech.org/implementation/get-started/string-encoding/string-encoding-decoding-summary

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

    model.CodePageOverride = Encoding.Default.WindowsCodePage;

    | Improve this Doc View Source

    CurrentTransaction

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

    DatabaseName

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

    EntityCache

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

    Factory

    Declaration
    public IEntityFactory Factory { get; }
    Property Value
    Type Description
    IEntityFactory
    | 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

    Returns a collection of all instances in the model and all federated instances

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

    GeometriesCount

    Returns the total number of Geometry objects in the model

    Declaration
    public virtual long GeometriesCount { get; }
    Property Value
    Type Description
    System.Int64
    | Improve this Doc View Source

    GeometryManager

    Declaration
    public IGeometryManager GeometryManager { get; set; }
    Property Value
    Type Description
    IGeometryManager
    | Improve this Doc View Source

    GeometryStore

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

    GeometrySupportLevel

    Returns the level of geometry supported in the model 0 = No geometry has been compiled in the model 1 = Triangulated Mesh only 2 = Polygonal geometry meshes supporting maps

    Declaration
    public int GeometrySupportLevel { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Header

    Declaration
    public IStepFileHeader Header { get; set; }
    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

    Returns a collection of all instances only in the model

    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

    IsTransacting

    Declaration
    public bool IsTransacting { get; }
    Property Value
    Type Description
    System.Boolean
    | 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

    ModelFactors

    Model wide factors, precision etc.

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

    ModelOpenCount

    Declaration
    public static int ModelOpenCount { get; }
    Property Value
    Type Description
    System.Int32
    | 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

    An identifier that an application can use to identify this model uniquely

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

    Methods

    | 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()

    Declaration
    public XbimReadWriteTransaction BeginTransaction()
    Returns
    Type Description
    XbimReadWriteTransaction
    | Improve this Doc View Source

    BeginTransaction(String)

    Declaration
    public XbimReadWriteTransaction BeginTransaction(string operationName)
    Parameters
    Type Name Description
    System.String operationName
    Returns
    Type Description
    XbimReadWriteTransaction
    | Improve this Doc View Source

    CacheClear()

    Clears all read data in the cache

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

    CacheStart()

    Begins a cache of all data read from the model, improves performance where data is read many times

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

    CacheStop()

    Stops further caching of data and clears the current cache

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

    CheckMaps()

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

    Close()

    Closes the current model and releases all resources and instances

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

    Compact(String)

    Declaration
    public void Compact(string targetModelName)
    Parameters
    Type Name Description
    System.String targetModelName
    | Improve this Doc View Source

    CreateDatabase(String)

    Declaration
    protected void CreateDatabase(string tmpFileName)
    Parameters
    Type Name Description
    System.String tmpFileName
    | Improve this Doc View Source

    CreateFrom(Stream, Int64, StorageType, String, ReportProgressDelegate, Boolean, Boolean)

    Declaration
    public virtual bool CreateFrom(Stream inputStream, long streamSize, StorageType streamType, string xbimDbName, ReportProgressDelegate progDelegate = null, bool keepOpen = false, bool cacheEntities = false)
    Parameters
    Type Name Description
    System.IO.Stream inputStream
    System.Int64 streamSize
    StorageType streamType
    System.String xbimDbName
    ReportProgressDelegate progDelegate
    System.Boolean keepOpen
    System.Boolean cacheEntities
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    CreateFrom(String, String, ReportProgressDelegate, Boolean, Boolean, Nullable<StorageType>, Boolean)

    Creates a new Model and populates with instances from the specified file, Ifc, IfcXML, and IfcZip are all supported.

    Declaration
    public virtual bool CreateFrom(string importFrom, string xbimDbName = null, ReportProgressDelegate progDelegate = null, bool keepOpen = false, bool cacheEntities = false, StorageType? storageType = null, bool deleteOnClose = false)
    Parameters
    Type Name Description
    System.String importFrom

    Name of the file containing the instances to import

    System.String xbimDbName

    Name of the xbim file that will be created. If null the contents are loaded into memory and are not persistent

    ReportProgressDelegate progDelegate
    System.Boolean keepOpen

    Flag indicating whether to keep the model open after creation, otherwise closes after import

    System.Boolean cacheEntities
    System.Nullable<StorageType> storageType

    The expected Ifc Format of the file. Inferred from extension when null

    System.Boolean deleteOnClose

    Indicates whether the xbim database file should be deleted on close of model

    Returns
    Type Description
    System.Boolean
    Remarks

    To create a new model from an existing XBIM file, use SaveAs(String, Nullable<StorageType>, ReportProgressDelegate, IDictionary<Int32, Int32>), or CreateFrom(IModel, String, ReportProgressDelegate)

    | Improve this Doc View Source

    CreateFrom(IModel, String, ReportProgressDelegate)

    Declaration
    public void CreateFrom(IModel model, string fileName, ReportProgressDelegate progDelegate = null)
    Parameters
    Type Name Description
    IModel model
    System.String fileName
    ReportProgressDelegate progDelegate
    | Improve this Doc View Source

    CreateModel(IEntityFactory, String, XbimDBAccess)

    Creates and opens a new Xbim Database

    Declaration
    public static EsentModel CreateModel(IEntityFactory factory, string dbFileName, XbimDBAccess access = XbimDBAccess.ReadWrite)
    Parameters
    Type Name Description
    IEntityFactory factory

    Entity factory to be used for deserialization

    System.String dbFileName

    Name of the Xbim file

    XbimDBAccess access
    Returns
    Type Description
    EsentModel
    | Improve this Doc View Source

    CreateTemporaryModel(IEntityFactory)

    Creates an empty model using a temporary filename, the model will be deleted on close, unless SaveAs is called It will be returned open for read write operations

    Declaration
    public static EsentModel CreateTemporaryModel(IEntityFactory factory)
    Parameters
    Type Name Description
    IEntityFactory factory
    Returns
    Type Description
    EsentModel
    | Improve this Doc View Source

    DatabaseHasGeometryTable()

    Declaration
    public bool DatabaseHasGeometryTable()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DatabaseHasInstanceTable()

    Declaration
    public bool DatabaseHasInstanceTable()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Delete(IPersistEntity)

    Registers an entity for deletion

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

    DeleteGeometryCache()

    Declaration
    public bool DeleteGeometryCache()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Dispose()

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

    Dispose(Boolean)

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

    EnsureGeometryTables()

    Invoke the function before meshing to ensure database structure is available

    Declaration
    public bool EnsureGeometryTables()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    EnsureUniqueUserDefinedId()

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

    Finalize()

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

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

    Performs a set of actions on a collection of entities inside a single read only transaction This improves database performance for retrieving and accessing complex and deep objects

    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

    FreeTable(EsentEntityCursor)

    Returns the table to the cache for reuse

    Declaration
    public void FreeTable(EsentEntityCursor table)
    Parameters
    Type Name Description
    EsentEntityCursor table
    | Improve this Doc View Source

    FreeTable(EsentShapeGeometryCursor)

    Returns the table to the cache for reuse

    Declaration
    public void FreeTable(EsentShapeGeometryCursor table)
    Parameters
    Type Name Description
    EsentShapeGeometryCursor table
    | Improve this Doc View Source

    FreeTable(EsentShapeInstanceCursor)

    Returns the table to the cache for reuse

    Declaration
    public void FreeTable(EsentShapeInstanceCursor table)
    Parameters
    Type Name Description
    EsentShapeInstanceCursor table
    | Improve this Doc View Source

    FreeTable(XbimGeometryCursor)

    Returns the table to the cache for reuse

    Declaration
    public void FreeTable(XbimGeometryCursor table)
    Parameters
    Type Name Description
    XbimGeometryCursor table
    | Improve this Doc View Source

    GetEntityBinaryData(IInstantiableEntity)

    Declaration
    public byte[] GetEntityBinaryData(IInstantiableEntity entity)
    Parameters
    Type Name Description
    IInstantiableEntity entity
    Returns
    Type Description
    System.Byte[]
    | Improve this Doc View Source

    GetGeometryData(IEnumerable<XbimGeometryHandle>)

    Declaration
    public IEnumerable<XbimGeometryData> GetGeometryData(IEnumerable<XbimGeometryHandle> handles)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<XbimGeometryHandle> handles
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<XbimGeometryData>
    | Improve this Doc View Source

    GetGeometryData(Int32)

    Declaration
    public XbimGeometryData GetGeometryData(int geomLabel)
    Parameters
    Type Name Description
    System.Int32 geomLabel
    Returns
    Type Description
    XbimGeometryData
    | Improve this Doc View Source

    GetGeometryData(Int32, XbimGeometryType)

    Returns all the geometries for the geometry type Typically bounding box returns a single object, triangulated mesh mes may return multiple geometry meshes where an object is made of multiple materials

    Declaration
    public IEnumerable<XbimGeometryData> GetGeometryData(int productLabel, XbimGeometryType geomType)
    Parameters
    Type Name Description
    System.Int32 productLabel
    XbimGeometryType geomType
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<XbimGeometryData>
    | Improve this Doc View Source

    GetGeometryData(XbimGeometryType)

    Declaration
    public IEnumerable<XbimGeometryData> GetGeometryData(XbimGeometryType ofType)
    Parameters
    Type Name Description
    XbimGeometryType ofType
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<XbimGeometryData>
    | Improve this Doc View Source

    GetGeometryData(XbimGeometryHandle)

    Declaration
    public XbimGeometryData GetGeometryData(XbimGeometryHandle handle)
    Parameters
    Type Name Description
    XbimGeometryHandle handle
    Returns
    Type Description
    XbimGeometryData
    | Improve this Doc View Source

    GetGeometryHandle(Int32)

    Declaration
    public XbimGeometryHandle GetGeometryHandle(int geometryLabel)
    Parameters
    Type Name Description
    System.Int32 geometryLabel
    Returns
    Type Description
    XbimGeometryHandle
    | Improve this Doc View Source

    GetGeometryHandles(XbimGeometryType, XbimGeometrySort)

    Declaration
    public XbimGeometryHandleCollection GetGeometryHandles(XbimGeometryType geomType = XbimGeometryType.TriangulatedMesh, XbimGeometrySort sortOrder = XbimGeometrySort.OrderByIfcSurfaceStyleThenIfcType)
    Parameters
    Type Name Description
    XbimGeometryType geomType
    XbimGeometrySort sortOrder
    Returns
    Type Description
    XbimGeometryHandleCollection
    | Improve this Doc View Source

    GetStepFileHeader(String)

    Declaration
    public static IStepFileHeader GetStepFileHeader(string fileName)
    Parameters
    Type Name Description
    System.String fileName
    Returns
    Type Description
    IStepFileHeader
    | Improve this Doc View Source

    Init(IEntityFactory)

    Declaration
    protected void Init(IEntityFactory factory)
    Parameters
    Type Name Description
    IEntityFactory factory
    | Improve this Doc View Source

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

    Implementation of IModel variant of InsertCopy() function

    Declaration
    public T InsertCopy<T>(T toCopy, XbimInstanceHandleMap mappings, PropertyTranformDelegate propTransform, bool includeInverses, bool keepLabels)
        where T : IPersistEntity
    Parameters
    Type Name Description
    T toCopy

    Object to copy

    XbimInstanceHandleMap mappings

    Mappings make sure object is only inserted once. You should use one instance of mappings for all InsertCopy() calls between two models

    PropertyTranformDelegate propTransform

    Delegate which can be used to transform properties. You can use this to filter out certain properties or referenced objects

    System.Boolean includeInverses

    If TRUE interse relations are also copied over. This may potentially bring over almost entire model if not controlled by propTransform delegate

    System.Boolean keepLabels

    If TRUE entity labels of inserted objects will be the same as the labels of original objects. This should be FALSE if you are inserting objects to existing model or if you are inserting objects from multiple source models into a single target model where entity labels may potentially clash.

    Returns
    Type Description
    T

    New created object in this model which is a deep copy of original object

    Type Parameters
    Name Description
    T

    Type of the object to be inserted. This must be a type supported by this model

    | Improve this Doc View Source

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

    Inserts a deep copy of the toCopy object into this model All property values are copied to the maximum depth Inverse properties are not copied

    Declaration
    public T InsertCopy<T>(T toCopy, XbimInstanceHandleMap mappings, XbimReadWriteTransaction txn, bool includeInverses = false)
        where T : IPersistEntity
    Parameters
    Type Name Description
    T toCopy

    Instance to copy

    XbimInstanceHandleMap mappings

    Supply a dictionary of mappings if repeat copy insertions are to be made

    XbimReadWriteTransaction txn
    System.Boolean includeInverses
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

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

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

    NextReferenceIdentifier()

    Declaration
    protected string NextReferenceIdentifier()
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    Open(String, XbimDBAccess, Boolean)

    Declaration
    protected void Open(string fileName, XbimDBAccess accessMode, bool deleteOnClose)
    Parameters
    Type Name Description
    System.String fileName
    XbimDBAccess accessMode
    System.Boolean deleteOnClose
    | Improve this Doc View Source

    Open(String, XbimDBAccess, ReportProgressDelegate)

    Opens an Xbim model only, to open Ifc, IfcZip and IfcXML files use the CreateFrom method

    Declaration
    public virtual bool Open(string fileName, XbimDBAccess accessMode = XbimDBAccess.Read, ReportProgressDelegate progDelegate = null)
    Parameters
    Type Name Description
    System.String fileName
    XbimDBAccess accessMode
    ReportProgressDelegate progDelegate
    Returns
    Type Description
    System.Boolean

    True if successful

    | Improve this Doc View Source

    Print()

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

    SaveAs(String, Nullable<StorageType>, ReportProgressDelegate, IDictionary<Int32, Int32>)

    Declaration
    public bool SaveAs(string outputFileName, StorageType? storageType = null, ReportProgressDelegate progress = null, IDictionary<int, int> map = null)
    Parameters
    Type Name Description
    System.String outputFileName
    System.Nullable<StorageType> storageType
    ReportProgressDelegate progress
    System.Collections.Generic.IDictionary<System.Int32, System.Int32> map
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    StopCaching()

    Declaration
    public void StopCaching()

    Events

    | Improve this Doc View Source

    EntityDeleted

    This event is fired every time when entity gets deleted from model.

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

    EntityModified

    This event is fired every time any entity is modified. If your model is not transactional it might not be called at all as the central point for all modifications is a transaction.

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

    EntityNew

    This event is fired every time new entity is created.

    Declaration
    public event NewEntityHandler EntityNew
    Event Type
    Type Description
    NewEntityHandler

    Explicit Interface Implementations

    | Improve this Doc View Source

    IModel.Activate(IPersistEntity)

    Declaration
    bool IModel.Activate(IPersistEntity entity)
    Parameters
    Type Name Description
    IPersistEntity entity
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IModel.BeginTransaction(String)

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

    IModel.IsTransactional

    Declaration
    bool IModel.IsTransactional { get; }
    Returns
    Type Description
    System.Boolean

    Implements

    IModel
    IFederatedModel
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2022 xbim