WorksessionFileModel

ReferencesSince v9.0
public sealed class WorksessionFileModel : IDisposable
A model in a Rhino worksession (.rws) file.

Constructors

WorksessionFileModel

#Since v9.0
public WorksessionFileModel()
Creates a reference model with no paths and no layer overrides.

WorksessionFileModel

#Since v9.0
public WorksessionFileModel(string fullPath)
Creates a reference model for a model file.
fullPath (string)Full path of the model file.

WorksessionFileModel

#Since v9.0
public WorksessionFileModel(WorksessionFileModel other)
Creates a copy of another model.
other (WorksessionFileModel)The model to copy.
ArgumentNullExceptionIf other is null.

Finalizer

~WorksessionFileModel

#
~WorksessionFileModel()
Releases the native model.

Properties

FullPath

#Since v9.0
public string FullPath { get; set; }
Gets or sets the full path of the model file, as saved. Nothing checks that it exists.

IsActive

#Since v9.0
public bool IsActive { get; set; }
Gets or sets whether this is the model that was active when the worksession was saved. Every other model is a reference model.

LayerOverrideCount

#Since v9.0
public int LayerOverrideCount { get; }
Gets the number of layer overrides. Rhino does not save or use layer overrides for the active model. Version 4 files do not have them.

RelativePath

#Since v9.0
public string RelativePath { get; set; }
Gets or sets the path of the model file relative to the .rws file, as saved. Rhino uses it when the file is no longer at FullPath. It can be empty. Version 4 files do not have it.

Methods

AddLayerOverride

#Since v9.0
public void AddLayerOverride(WorksessionFileLayerOverride layerOverride)
Adds a copy of a layer override to the end of the list.
layerOverride (WorksessionFileLayerOverride)The layer override to copy.
ArgumentNullExceptionIf layerOverride is null.

ClearLayerOverrides

#Since v9.0
public void ClearLayerOverrides()
Removes all of the layer overrides.

Dispose

#Since v9.0
public void Dispose()
Releases the native model.

GetLayerOverride

#Since v9.0
public WorksessionFileLayerOverride GetLayerOverride(int index)
Gets a copy of a layer override.
index (int)Index of the layer override.
A copy. Changes to it are kept only after SetLayerOverride(int, WorksessionFileLayerOverride).
ArgumentOutOfRangeExceptionIf index is out of range.

GetLayerOverrides

#Since v9.0
public WorksessionFileLayerOverride[] GetLayerOverrides()
Gets copies of all of the layer overrides.

GetParentLayerValues

#Since v9.0
public WorksessionFileLayerValues GetParentLayerValues()
Gets a copy of the settings of the layer Rhino adds as the parent of all of a reference model's layers. Version 4 files do not have them.
A copy. Changes to it are kept only after SetParentLayerValues(WorksessionFileLayerValues).

RemoveLayerOverrideAt

#Since v9.0
public void RemoveLayerOverrideAt(int index)
Removes a layer override.
index (int)Index of the layer override to remove.
ArgumentOutOfRangeExceptionIf index is out of range.

SetLayerOverride

#Since v9.0
public void SetLayerOverride(int index, WorksessionFileLayerOverride layerOverride)
Replaces a layer override with a copy of another.
index (int)Index of the layer override to replace.
layerOverride (WorksessionFileLayerOverride)The layer override to copy.
ArgumentNullExceptionIf layerOverride is null.
ArgumentOutOfRangeExceptionIf index is out of range.

SetParentLayerValues

#Since v9.0
public void SetParentLayerValues(WorksessionFileLayerValues values)
Replaces the parent layer settings with a copy of values.
values (WorksessionFileLayerValues)The settings to copy.
ArgumentNullExceptionIf values is null.