Class StepModel
Inheritance
System.Object
StepModel
Implements
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()
Assembly: Xbim.Common.dll
Syntax
public class StepModel : IModel, IDisposable
Constructors
|
Improve this Doc
View Source
StepModel(IEntityFactory)
Declaration
public StepModel(IEntityFactory entityFactory)
Parameters
|
Improve this Doc
View Source
StepModel(IEntityFactory, ILogger, Int32)
Declaration
public StepModel(IEntityFactory entityFactory, ILogger logger = null, int labelFrom = 0)
Parameters
Type |
Name |
Description |
IEntityFactory |
entityFactory |
|
Microsoft.Extensions.Logging.ILogger |
logger |
|
System.Int32 |
labelFrom |
|
|
Improve this Doc
View Source
StepModel(IEntityFactory, Int32)
Declaration
public StepModel(IEntityFactory entityFactory, int labelFrom)
Parameters
Type |
Name |
Description |
IEntityFactory |
entityFactory |
|
System.Int32 |
labelFrom |
|
|
Improve this Doc
View Source
StepModel(EntityFactoryResolverDelegate, ILogger, Int32)
Declaration
public StepModel(EntityFactoryResolverDelegate factoryResolver, ILogger logger = null, int labelFrom = 0)
Parameters
Properties
|
Improve this Doc
View Source
AllowMissingReferences
Indicates whether this is a partial view of a STEP model, meaning some references could be invalid
Declaration
public bool AllowMissingReferences { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CurrentTransaction
Declaration
public virtual ITransaction CurrentTransaction { get; }
Property Value
|
Improve this Doc
View Source
EntityCache
Declaration
public IEntityCache EntityCache { get; }
Property Value
|
Improve this Doc
View Source
EntityFactory
Declaration
public IEntityFactory EntityFactory { get; }
Property Value
|
Improve this Doc
View Source
GeometryStore
Declaration
public IGeometryStore GeometryStore { get; }
Property Value
|
Improve this Doc
View Source
Declaration
public IStepFileHeader Header { get; protected set; }
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
Instance collection of all entities in the model. You can use this collection to create new
entities or to query the model. This is the only way how to create new entities.
Declaration
public virtual IEntityCollection Instances { get; }
Property Value
|
Improve this Doc
View Source
InverseCache
Declaration
public IInverseCache InverseCache { get; }
Property Value
|
Improve this Doc
View Source
IsTransactional
Declaration
public virtual bool IsTransactional { 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
Declaration
public ExpressMetaData Metadata { get; }
Property Value
|
Improve this Doc
View Source
ModelFactors
Declaration
public virtual IModelFactors ModelFactors { get; set; }
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
AddEntityInternal(IPersistEntity)
Declaration
protected void AddEntityInternal(IPersistEntity entity)
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 virtual ITransaction BeginTransaction(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
|
Improve this Doc
View Source
Delete(IPersistEntity)
This will delete the entity from model dictionary and also from any references in the model.
Be careful as this might take a while to check for all occurrences of the object. Also make sure
you don't use this object anymore yourself because it won't get disposed until than. This operation
doesn't guarantee that model is compliant with any kind of schema but it leaves it consistent. So if you
serialize the model there won't be any references to the object which wouldn't be there.
Declaration
public virtual void Delete(IPersistEntity entity)
Parameters
|
Improve this Doc
View Source
Delete(IPersistEntity[], Boolean)
This will delete the entities from model dictionary and also from any references in the model.
Be careful as this might take a while to check for all occurrences of the object. Also make sure
you don't use this object anymore yourself because it won't get disposed until than. This operation
doesn't guarantee that model is compliant with any kind of schema but it leaves it consistent. So if you
serialize the model there won't be any references to the object which wouldn't be there.
Declaration
public virtual void Delete(IPersistEntity[] entities, bool noTransaction)
Parameters
Type |
Name |
Description |
IPersistEntity[] |
entities |
Entities to be deleted in a batch
|
System.Boolean |
noTransaction |
When true, the operation will run outside of transaction. This will save resources on massive operations.
|
|
Improve this Doc
View Source
DiscardNaturalOrder()
Normally model respects the order in which entities were created or read from the file.
However, if you don't care and you are creating or deleting many entities, you might gain
some performance improvement by not keeping that order.
Declaration
public virtual void DiscardNaturalOrder()
|
Improve this Doc
View Source
Dispose()
Declaration
|
Improve this Doc
View Source
Dispose(Boolean)
Extension point for inheriting classes
Declaration
protected virtual void Dispose(bool native)
Parameters
Type |
Name |
Description |
System.Boolean |
native |
|
|
Improve this Doc
View Source
ForEach<TSource>(IEnumerable<TSource>, Action<TSource>)
Declaration
public virtual 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
GetStepFileSchemaVersion(Stream)
Declaration
public static List<string> GetStepFileSchemaVersion(Stream stream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
|
Returns
Type |
Description |
System.Collections.Generic.List<System.String> |
|
|
Improve this Doc
View Source
Inserts deep copy of an object into this model. The entity must originate from the same schema (the same EntityFactory).
This operation happens within a transaction which you have to handle yourself unless you set the parameter "noTransaction" to true.
Insert will happen outside of transactional behaviour in that case. Resulting model is not guaranteed to be valid according to any
model view definition. However, it is granted to be consistent. You can optionally bring in all inverse relationships. Be careful as it
might easily bring in almost full model.
Declaration
public T InsertCopy<T>(T toCopy, XbimInstanceHandleMap mappings, PropertyTranformDelegate propTransform, bool includeInverses, bool keepLabels)
where T : IPersistEntity
Parameters
Type |
Name |
Description |
T |
toCopy |
Entity to be copied
|
XbimInstanceHandleMap |
mappings |
Mappings of previous inserts
|
PropertyTranformDelegate |
propTransform |
Optional delegate which you can use to filter the content which will get copied over.
|
System.Boolean |
includeInverses |
Option if to bring in all inverse entities (enumerations in original entity)
|
System.Boolean |
keepLabels |
Option if to keep entity labels the same
|
Returns
Type |
Description |
T |
Copy from this model
|
Type Parameters
Name |
Description |
T |
Type of the copied entity
|
|
Improve this Doc
View Source
Inserts deep copy of an object into this model. The entity must originate from the same schema (the same EntityFactory).
This operation happens within a transaction which you have to handle yourself unless you set the parameter "noTransaction" to true.
Insert will happen outside of transactional behaviour in that case. Resulting model is not guaranteed to be valid according to any
model view definition. However, it is granted to be consistent. You can optionally bring in all inverse relationships. Be careful as it
might easily bring in almost full model.
Declaration
public T InsertCopy<T>(T toCopy, XbimInstanceHandleMap mappings, PropertyTranformDelegate propTransform, bool includeInverses, bool keepLabels, bool noTransaction)
where T : IPersistEntity
Parameters
Type |
Name |
Description |
T |
toCopy |
Entity to be copied
|
XbimInstanceHandleMap |
mappings |
Mappings of previous inserts
|
PropertyTranformDelegate |
propTransform |
Optional delegate which you can use to filter the content which will get copied over.
|
System.Boolean |
includeInverses |
Option if to bring in all inverse entities (enumerations in original entity)
|
System.Boolean |
keepLabels |
Option if to keep entity labels the same
|
System.Boolean |
noTransaction |
If TRUE all operations inside this function will happen out of transaction.
Also no notifications will be fired from objects.
|
Returns
Type |
Description |
T |
Copy from this model
|
Type Parameters
Name |
Description |
T |
Type of the copied entity
|
|
Improve this Doc
View Source
LoadStep21(Stream, Int64, ReportProgressDelegate, IEnumerable<String>)
Opens the model from STEP21 file.
Declaration
public virtual int LoadStep21(Stream stream, long streamSize, ReportProgressDelegate progDelegate = null, IEnumerable<string> ignoreTypes = null)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
Path to the file
|
System.Int64 |
streamSize |
|
ReportProgressDelegate |
progDelegate |
|
System.Collections.Generic.IEnumerable<System.String> |
ignoreTypes |
Types to ignore
|
Returns
Type |
Description |
System.Int32 |
Number of errors in parsing. Always check this to be null or the model might be incomplete.
|
|
Improve this Doc
View Source
LoadStep21(String, ReportProgressDelegate)
Opens the model from STEP21 file.
Declaration
public virtual int LoadStep21(string file, ReportProgressDelegate progDelegate = null)
Parameters
Returns
Type |
Description |
System.Int32 |
Number of errors in parsing. Always check this to be null or the model might be incomplete.
|
|
Improve this Doc
View Source
LoadStep21(XbimP21Scanner)
Declaration
protected virtual int LoadStep21(XbimP21Scanner parser)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
public static IStepFileHeader LoadStep21Header(Stream stream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
|
Returns
|
Improve this Doc
View Source
LoadStep21Part(Stream)
Declaration
public int LoadStep21Part(Stream data)
Parameters
Type |
Name |
Description |
System.IO.Stream |
data |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
LoadStep21Part(String)
Declaration
public int LoadStep21Part(string data)
Parameters
Type |
Name |
Description |
System.String |
data |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
SaveAsStep21(Stream, ReportProgressDelegate)
Saves the model as PART21 file
Declaration
public virtual void SaveAsStep21(Stream stream, ReportProgressDelegate progress = null)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
Stream to be used to write the file
|
ReportProgressDelegate |
progress |
|
|
Improve this Doc
View Source
SaveAsStep21(TextWriter, ReportProgressDelegate)
Saves the model as PART21 file
Declaration
public virtual void SaveAsStep21(TextWriter writer, ReportProgressDelegate progress = null)
Parameters
Type |
Name |
Description |
System.IO.TextWriter |
writer |
Text writer to be used to write the file
|
ReportProgressDelegate |
progress |
|
|
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
|
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
|
Improve this Doc
View Source
EntityNew
This event is fired every time new entity is created.
Declaration
public event NewEntityHandler EntityNew
Event Type
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