WorksessionFileModel

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

Constructors

WorksessionFileModel

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

WorksessionFileModel

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

WorksessionFileModel

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

Finalizer

~WorksessionFileModel

#
Releases the native model.
~WorksessionFileModel()

Properties

FullPath

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

IsActive

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

LayerOverrideCount

#Since v9.0
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.
public int LayerOverrideCount { get; }

RelativePath

#Since v9.0
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.
public string RelativePath { get; set; }

Methods

AddLayerOverride

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

ClearLayerOverrides

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

Dispose

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

GetLayerOverride

#Since v9.0
Gets a copy of a layer override.
public WorksessionFileLayerOverride GetLayerOverride(
index
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
Gets copies of all of the layer overrides.
public WorksessionFileLayerOverride[] GetLayerOverrides()

GetParentLayerValues

#Since v9.0
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.
public WorksessionFileLayerValues GetParentLayerValues()
A copy. Changes to it are kept only after SetParentLayerValues(WorksessionFileLayerValues).

RemoveLayerOverrideAt

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

SetLayerOverride

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

SetParentLayerValues

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