Click or drag to resize

Worksession Class

Manages a list of models that are being used as reference geometry.
Inheritance Hierarchy
SystemObject
  Rhino.DocObjectsWorksession

Namespace:  Rhino.DocObjects
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public sealed class Worksession

The Worksession type exposes the following members.

Properties
  NameDescription
Public propertyDocument
Gets the document that owns this worksession.
Public propertyFileName
Returns the path to the open worksession, or .rws, file. If there is no worksession file open, or the active worksession has not yet been saved, then null is returned.
Public propertyModelCount
Returns the number of models in the worksession. The active model will included in this count whether or not it has been saved.
Public propertyModelPaths
Returns the paths to the models used by the worksession. If the active model has not been saved, then it will not be included in the output array.
Public propertyModels
The models in this worksession, including the active model.

UpdateAvailable is not filled in; use GetModels(Boolean) if you need it.

Public propertyName
Gets the name of the worksession - the worksession (.rws) file name without its path or extension. Returns an empty string if there is no worksession file open, or the active worksession has not yet been saved; it is up to the caller to decide what to display in that case.
Public propertyRuntimeSerialNumber
Unique serial number for the worksession while the application is running. This is not a persistent value.

Since Rhino 9 worksessions are per-document and no longer have serial numbers of their own, so this returns Document's RuntimeSerialNumber. Prefer that property in new code.

Top
Methods
  NameDescription
Public methodAttach(IEnumerableString)
Attaches several models to this worksession as reference models.
Public methodAttach(String)
Attaches a model to this worksession as a reference model.
Public methodDetach(IEnumerableUInt32)
Detaches several reference models from this worksession.
Public methodDetach(UInt32)
Detaches a reference model from this worksession.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberFileNameFromRuntimeSerialNumber
Returns the path to the open worksession, or .rws, file. If there is no worksession file open, or the active worksession has not yet been saved, then null is returned.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetLockInformation
Describes whether a worksession model's file is locked, and by whom.
Public methodGetModels
The models in this worksession, including the active model.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodModelPathFromSerialNumber
Returns the path to a model, used by the worksession, given a reference model serial number
Public methodStatic memberOpen
Opens a worksession (.rws) file.
Public methodSave
Saves this worksession to its existing .rws file.
Public methodSaveAs
Saves this worksession to a .rws file.
Public methodSetActiveModel
Makes one of this worksession's reference models the active model.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Re-reads a reference model whose file has changed on disk.
Public methodUpdateAll
Re-reads every reference model in this worksession whose file has changed on disk.
Top
See Also