Properties
WorksessionModel.UpdateAvailable is filled in, so this reports the same state the Worksessions panel shows. Use GetModels(bool) with false to skip that check.
Since Rhino 9 worksessions are per-document and no longer have serial numbers of their own, so this returns Document's RhinoDoc.RuntimeSerialNumber. Prefer that property in new code.
Methods
Opening a worksession is a document-level operation rather than a change to an existing worksession, which is why this is static. Always use the returned document: it may be the current document, reused, or a newly created one, depending on the platform and on whether the current document can be reused. On Windows, other than headless, the current document is closed and replaced.
As with SetActiveModel(uint), do not call this from a script running in a document that this might close.
Changing the active model loads the requested model into a different document, so carry on with the returned document: treat Document and this Worksession instance as unusable once this returns.
The document this was called on is closed as part of the switch, but on Mac that close is asynchronous and may not have finished when this returns. Do not rely on the old document either still being open or already being gone.
This is not fully silent: if the outgoing document has unsaved changes the user is prompted to save it, and cancelling that prompt makes this return null. Save the document first if you need it to run unattended.
Do not call this from a script that is itself running in the document being replaced. Scripts run in a document context, and closing that document from underneath the running script leaves Rhino's command machinery working with a document that no longer exists. Drive this from a command, a panel, or an idle handler instead.