WorksessionModel

ReferencesSince v9.0
public sealed class WorksessionModel
An immutable snapshot of one model in a worksession.

The values are copied when the snapshot is taken, so an instance stays usable (though it may go out of date) after the worksession changes. It holds no pointer into the document.

Properties

Alias

#Since v9.0
public string Alias { get; }
The alias used to decorate names - layers, materials, and so on - that come from this model.

AttachFailed

#Since v9.0
public bool AttachFailed { get; }
True if the most recent attempt to attach this model failed, which usually means the file is missing.

FileTypeId

#Since v9.0
public Guid FileTypeId { get; }
The id of the plug-in used to read the model's file.

IsActiveModel

#Since v9.0
public bool IsActiveModel { get; }
True if this is the worksession's active model - the document you are editing - rather than a reference model.

IsAttached

#Since v9.0
public bool IsAttached { get; }
True if the model's contents are currently attached to the document.

Path

#Since v9.0
public string Path { get; }
The full path to the model's file. This is empty for an active model that has never been saved.

SerialNumber

#Since v9.0
[CLSCompliant(false)] public uint SerialNumber { get; }
The reference model's serial number, which identifies this model in calls like Worksession.Detach(uint). Zero means this is the worksession's active model.

Reference model serial numbers are unique across the application, not just within one document, so a serial number from another document's worksession will simply not be found rather than matching the wrong model.

UpdateAvailable

#Since v9.0
public bool UpdateAvailable { get; }
True if the file on disk has changed since it was attached, so Worksession.Update(uint) has something to do.

This is only filled in when the snapshot was taken with the file check enabled. Worksession.Models enables it; pass false to Worksession.GetModels(bool) to skip it, and this is then always false.

Methods

ToString

#
public override string ToString()
Returns the model's alias, or its path when it has no alias.
Object.ToString