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
System.IDisposable
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()
Assembly: Xbim.Ifc.dll
Syntax
public class IfcStore : IModel, IDisposable, IFederatedModel, IEquatable<IModel>
Constructors
|
Improve this Doc
View Source
IfcStore()
Declaration
|
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
|
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
Properties
|
Improve this Doc
View Source
CurrentTransaction
Declaration
public ITransaction CurrentTransaction { get; }
Property Value
|
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
|
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
|
Improve this Doc
View Source
EditorDetails
Declaration
public XbimEditorCredentials EditorDetails { get; }
Property Value
|
Improve this Doc
View Source
EntityCache
Declaration
public IEntityCache EntityCache { get; }
Property Value
|
Improve this Doc
View Source
FederatedInstanceHandles
Declaration
public IList<XbimInstanceHandle> FederatedInstanceHandles { get; }
Property Value
|
Improve this Doc
View Source
FederatedInstances
Declaration
public IReadOnlyEntityCollection FederatedInstances { get; }
Property Value
|
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
|
Improve this Doc
View Source
Declaration
public IStepFileHeader Header { get; }
Property Value
|
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
|
Improve this Doc
View Source
Instances
Declaration
public IEntityCollection Instances { get; }
Property Value
|
Improve this Doc
View Source
InverseCache
Declaration
public IInverseCache InverseCache { get; }
Property Value
|
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
Declaration
public ExpressMetaData Metadata { get; }
Property Value
|
Improve this Doc
View Source
Model
Declaration
public IModel Model { get; }
Property Value
|
Improve this Doc
View Source
ModelFactors
Declaration
public IModelFactors ModelFactors { get; }
Property Value
|
Improve this Doc
View Source
ModelProvider
Provides access to model persistence capabilities
Declaration
protected IModelProvider ModelProvider { get; }
Property Value
|
Improve this Doc
View Source
ModelProviderFactory
Factory to create ModelProvider instances.
Declaration
public static IModelProviderFactory ModelProviderFactory { get; set; }
Property Value
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
|
Improve this Doc
View Source
ReferencedModels
Declaration
public IEnumerable<IReferencedModel> ReferencedModels { get; }
Property Value
|
Improve this Doc
View Source
ReferencingModel
Declaration
public IModel ReferencingModel { get; }
Property Value
|
Improve this Doc
View Source
SchemaVersion
Declaration
public XbimSchemaVersion SchemaVersion { get; }
Property Value
|
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
|
Improve this Doc
View Source
AddModelReference(IReferencedModel)
Declaration
public void AddModelReference(IReferencedModel model)
Parameters
|
Improve this Doc
View Source
BeginEntityCaching()
Declaration
public IEntityCache BeginEntityCaching()
Returns
|
Improve this Doc
View Source
BeginInverseCaching()
Declaration
public IInverseCache BeginInverseCaching()
Returns
|
Improve this Doc
View Source
BeginTransaction(String)
Declaration
public ITransaction BeginTransaction(string name = null)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
|
Improve this Doc
View Source
Close()
Closes the store and disposes of all resources. The store is invalid after this call
Declaration
|
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
Returns
|
Improve this Doc
View Source
Create(XbimSchemaVersion, XbimStoreType)
Declaration
public static IfcStore Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType)
Parameters
Returns
|
Improve this Doc
View Source
Create(XbimEditorCredentials, XbimSchemaVersion, XbimStoreType)
Declaration
public static IfcStore Create(XbimEditorCredentials editorDetails, XbimSchemaVersion ifcVersion, XbimStoreType storageType)
Parameters
Returns
|
Improve this Doc
View Source
Delete(IPersistEntity)
Declaration
public void Delete(IPersistEntity entity)
Parameters
|
Improve this Doc
View Source
Dispose()
Declaration
|
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
|
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
Declaration
public T InsertCopy<T>(T toCopy, XbimInstanceHandleMap mappings, PropertyTranformDelegate propTransform, bool includeInverses, bool keepLabels)
where T : IPersistEntity
Parameters
Returns
Type Parameters
|
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
|
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
|
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
|
Improve this Doc
View Source
EntityModified
Declaration
public event ModifiedEntityHandler EntityModified
Event Type
|
Improve this Doc
View Source
EntityNew
Declaration
public event NewEntityHandler EntityNew
Event Type
Operators
|
Improve this Doc
View Source
Equality(IfcStore, IModel)
Declaration
public static bool operator ==(IfcStore store, IModel model)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(IfcStore, IModel)
Declaration
public static bool operator !=(IfcStore store, IModel model)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
IModel.Activate(IPersistEntity)
Declaration
bool IModel.Activate(IPersistEntity owningEntity)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IDisposable
System.IEquatable<T>
Extension Methods