RhinoDoc

References
public sealed class RhinoDoc : IDisposable
Represents an active model.

Finalizer

~RhinoDoc

#
~RhinoDoc()

Properties

ActiveCommandId

#Since v8.0
public Guid ActiveCommandId { get; }
Get the ID of the active command.

ActiveDoc

#Since v5.0
public static RhinoDoc ActiveDoc { get; set; }
WARNING!! Do not use the ActiveDoc if you don't have to. Under Mac Rhino the ActiveDoc can change while a command is running. Use the doc that is passed to you in your RunCommand function or continue to use the same doc after the first call to ActiveDoc.

ActiveSpace

#Since v8.0
public ActiveSpace ActiveSpace { get; }
Get the space associated with the active viewport for this document

AnimationProperties

#Since v6.11
public AnimationProperties AnimationProperties { get; set; }

Bitmaps

#Since v5.0
public BitmapTable Bitmaps { get; }
bitmaps used in textures, backgrounds, wallpapers, ...

CurrentEnvironment

#Since v6.0
obsoletePlease use Rhino.Render.RenderSettings methods
Access to the current environment for various uses

CurrentUndoRecordDescription

#Since v9.0
public string CurrentUndoRecordDescription { get; }
The description of the undo record currently being recorded, as shown in Undo, Redo, and UndoMultiple. If no description has been set, this is the name of the command that owns the record. Null if undo recording is not active.

CurrentUndoRecordSerialNumber

#Since v6.0
[CLSCompliant(false)] public uint CurrentUndoRecordSerialNumber { get; }
>0: undo recording is active and being saved on the undo record with the specified serial number. 0: undo recording is not active. (Disabled or nothing is being recorded.)

CustomRenderSizes

#Since v6.0
public List<Size> CustomRenderSizes { get; }

DateCreated

#Since v5.0
public DateTime DateCreated { get; }

DateLastEdited

#Since v5.0
public DateTime DateLastEdited { get; }
Returns the date the document was created in Coordinated Universal Time (UTC). Use DateTime.ToLocalTime to convert to local time.

DimStyles

#ExampleSince v5.0
public DimStyleTable DimStyles { get; }

DistanceDisplayPrecision

#Since v5.0 Obsolete v9.0
[DebuggerBrowsable(DebuggerBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)] public int DistanceDisplayPrecision { get; }
obsolete. Use ModelDistanceDisplayPrecision instead.

DocumentId

#Since v5.0
[Browsable(false)] [DebuggerBrowsable(DebuggerBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)] public int DocumentId { get; }
obsoleteUse RuntimeSerialNumber instead
Gets the Document Id.

EarthAnchorPoint

#Since v5.0
public EarthAnchorPoint EarthAnchorPoint { get; set; }

Fonts

#Since v5.0
[EditorBrowsable(EditorBrowsableState.Never)] public FontTable Fonts { get; }
obsoleteUse DimStyles table instead

GroundPlane

#Since v5.0 Obsolete v8.0
[DebuggerBrowsable(DebuggerBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)] public GroundPlane GroundPlane { get; }
Gets the ground plane of this document.
RdkNotLoadedExceptionIf the RDK is not loaded.

Groups

#ExampleSince v5.0
public GroupTable Groups { get; }

HatchPatterns

#ExampleSince v5.0
public HatchPatternTable HatchPatterns { get; }

InGetPoint

#Since v8.5
public bool InGetPoint { get; }
Returns true if currently in a GetPoint.Get().

InstanceDefinitions

#ExampleSince v5.0
public InstanceDefinitionTable InstanceDefinitions { get; }

IsAvailable

#Since v6.0
public bool IsAvailable { get; }

IsClosing

#Since v6.0
public bool IsClosing { get; }

IsCommandRunning

#Since v7.0
public bool IsCommandRunning { get; }
Returns true if Rhino is currently running a command.

IsCreating

#Since v6.0
public bool IsCreating { get; }

IsHeadless

#Since v7.0
public bool IsHeadless { get; }

IsInitializing

#Since v6.0
public bool IsInitializing { get; }

IsLocked

#Since v5.0
public bool IsLocked { get; }
Check to see if the file associated with this document is locked. If it is locked then this is the only document that will be able to write the file. Other instances of Rhino will fail to write this document.

IsOpening

#Since v6.0
public bool IsOpening { get; }

IsReadOnly

#Since v5.0
public bool IsReadOnly { get; }
Current read-only mode for this document. true if the document can be viewed but NOT saved. false if document can be viewed and saved.

IsSendingMail

#Since v5.0
public bool IsSendingMail { get; }
true if Rhino is in the process of sending this document as an email attachment.

Layers

#Since v5.0
public LayerTable Layers { get; }
Layers in the document.

LayoutSpaceAnnotationScalingEnabled

#Since v6.0
public bool LayoutSpaceAnnotationScalingEnabled { get; set; }
If LayoutSpaceAnnotationScaling is on, sizes in dimstyles are multiplied by dimscale when the annotation is displayed in a detail viewport not in a detail

Lights

#Since v5.0
public LightTable Lights { get; }

Linetypes

#Since v5.0
public LinetypeTable Linetypes { get; }
Linetypes in the document.

LinkedInstanceDefinitionUpdate

#Since v8.29
public LinkedInstanceDefinitionUpdateStyle LinkedInstanceDefinitionUpdate { get; set; }
Controls if, when, and how linked and linked and embedded instance definitions are updated when the source archive that was used to create the instance definition has changed.

Manifest

#Since v6.0
public ManifestTable Manifest { get; }

MarkupMode

#Since v9.0
public MarkupMode MarkupMode { get; }
The markup mode this document is currently in: creating, viewing or editing a markup, or MarkupMode.None when not in markup mode. MarkupViewChanged reports changes to this value.

Markups

#Since v9.0
public MarkupTable Markups { get; }
Collection of markups in this document

Materials

#Since v5.0
public MaterialTable Materials { get; }
Materials in the document.

MeshingParameterStyle

#Since v5.1
public MeshingParameterStyle MeshingParameterStyle { get; set; }
Type of MeshingParameters currently used by the document to mesh objects

ModelAbsoluteTolerance

#Since v5.0
public double ModelAbsoluteTolerance { get; set; }
Model space absolute tolerance.

ModelAngleToleranceDegrees

#Since v5.0
public double ModelAngleToleranceDegrees { get; set; }
Model space angle tolerance.

ModelAngleToleranceRadians

#Since v5.0
public double ModelAngleToleranceRadians { get; set; }
Model space angle tolerance.

ModelBasepoint

#Since v6.10
public Point3d ModelBasepoint { get; set; }
The base point in the model that is used when inserting the model into another as a block definition. By default the base point in any model is 0,0,0.

ModelDistanceDisplayMode

#Since v8.0
public DistanceDisplayMode ModelDistanceDisplayMode { get; set; }
Gets/Sets the distance display mode for model space.

ModelDistanceDisplayPrecision

#ExampleSince v5.8
public int ModelDistanceDisplayPrecision { get; set; }

ModelRelativeTolerance

#Since v5.0
public double ModelRelativeTolerance { get; set; }
Model space relative tolerance.

ModelSpaceAnnotationScalingEnabled

#Since v6.0
public bool ModelSpaceAnnotationScalingEnabled { get; set; }
If ModelSpaceAnnotationScaling is on, sizes in dimstyles are multiplied by dimscale when the annotation is displayed in a model space viewport not in a detail

ModelSpaceHatchScale

#Since v6.1
public double ModelSpaceHatchScale { get; set; }
The scale factor for hatches in model space when Hatch Scaling is enabled

ModelSpaceHatchScalingEnabled

#Since v6.16
public bool ModelSpaceHatchScalingEnabled { get; set; }
True if hatch scaling is enabled, false if not.

ModelSpaceTextScale

#Since v6.1
public double ModelSpaceTextScale { get; set; }
The scale factor for text in model space when Annotation Scaling is enabled

ModelUnits

#Since v9.0
public LengthUnit ModelUnits { get; set; }
Length unit used on model space.

ModelUnitSystem

#Since v5.0
public UnitSystem ModelUnitSystem { get; set; }

ModelUrl

#Since v9.0
public string ModelUrl { get; set; }
Gets and sets the link address, or URL, for the model.

Modified

#Since v5.0
public bool Modified { get; set; }
Returns or sets the document's modified flag.

Name

#Since v5.0
public string Name { get; }
Returns the name of the currently loaded Rhino document (3DM file).

NamedConstructionPlanes

#Since v5.0
public NamedConstructionPlaneTable NamedConstructionPlanes { get; }
Collection of named construction planes.

NamedLayerStates

#Since v6.14
public NamedLayerStateTable NamedLayerStates { get; }
Collection of named layer states.

NamedPositions

#Since v6.0
public NamedPositionTable NamedPositions { get; }
Collection of named positions.

NamedViews

#ExampleSince v5.0
public NamedViewTable NamedViews { get; }
Collection of named views.

NextUndoRecordSerialNumber

#Since v6.0
[CLSCompliant(false)] public uint NextUndoRecordSerialNumber { get; }
The serial number that will be assigned to the next undo record that is constructed.

Notes

#Since v5.0
public string Notes { get; set; }
Returns or sets the document's notes.

NotesLocked

#Since v8.6
public bool NotesLocked { get; set; }

Objects

#Since v5.0
public ObjectTable Objects { get; }

PageAbsoluteTolerance

#Since v5.0
public double PageAbsoluteTolerance { get; set; }
Page space absolute tolerance.

PageAngleToleranceDegrees

#Since v5.0
public double PageAngleToleranceDegrees { get; set; }
Page space angle tolerance.

PageAngleToleranceRadians

#Since v5.0
public double PageAngleToleranceRadians { get; set; }
Page space angle tolerance.

PageDistanceDisplayMode

#Since v8.0
public DistanceDisplayMode PageDistanceDisplayMode { get; set; }
Gets/Sets the distance display mode for page space.

PageDistanceDisplayPrecision

#Since v5.8
public int PageDistanceDisplayPrecision { get; set; }

PageRelativeTolerance

#Since v5.0
public double PageRelativeTolerance { get; set; }
Page space relative tolerance.

PageUnits

#Since v9.0
public LengthUnit PageUnits { get; set; }
Length unit used on page space geometry.

PageUnitSystem

#Since v5.0
public UnitSystem PageUnitSystem { get; set; }

PageViewGroups

#Since v9.0
public PageViewGroupTable PageViewGroups { get; }
Collection of markups in this document

Path

#Since v5.0
public string Path { get; }
Returns the path of the currently loaded Rhino document (3DM file).

PostEffects

#Since v7.0
obsoletePlease use Rhino.Render.RenderSettings methods
Access to the post effects

RedoActive

#Since v6.0
public bool RedoActive { get; }
Returns true if Redo is currently active.

RenderEnvironments

#Since v5.7
public RenderEnvironmentTable RenderEnvironments { get; }

RenderMaterials

#Since v5.7
public RenderMaterialTable RenderMaterials { get; }

RenderSettings

#Since v5.0
public RenderSettings RenderSettings { get; set; }

RenderTextures

#Since v5.7
public RenderTextureTable RenderTextures { get; }

RuntimeData

#Since v6.3
public RuntimeDocumentDataTable RuntimeData { get; }
Collection of document runtime data. This is a good place to put non-serializable, per document data, such as panel view models. Note well: This data will be dispose with the document and does not get serialized.
The runtime document data table.

RuntimeSerialNumber

#Since v6.0
[CLSCompliant(false)] public uint RuntimeSerialNumber { get; }
Unique serialNumber for the document while the application is running. This is not a persistent value.

SectionStyles

#Since v9.0
public SectionStyleTable SectionStyles { get; }
Collection of section styles in this document

Snapshots

#Since v6.7
public SnapshotTable Snapshots { get; }
Collection of snapshots.

Strings

#Since v5.0
public StringTable Strings { get; }
Collection of document user data strings in this document

SubDAppearance

#Since v7.5
public SubDComponentLocation SubDAppearance { get; set; }
Returns or sets the appearance of all SubD objects in the document.
Remarks: When setting this property, if the document contains SubD objects, then the document will be redrawn automatically.

TemplateFileUsed

#Since v5.0
public string TemplateFileUsed { get; }
name of the template file used to create this document. This is a runtime value only present if the document was newly created.

UndoActive

#Since v6.0
public bool UndoActive { get; }
Returns true if Undo is currently active.

UndoRecordingEnabled

#Since v5.0
public bool UndoRecordingEnabled { get; set; }

UndoRecordingIsActive

#Since v5.0
public bool UndoRecordingIsActive { get; }
true if undo recording is actually happening now.

Views

#Since v5.0
public ViewTable Views { get; }

ViewUserInterface

#Since v9.0
public ViewUserInterfaceTable ViewUserInterface { get; }

Worksession

#Since v6.0
public Worksession Worksession { get; }
Provides access to the document's worksession.

Methods

AddCustomUndoEvent

#ExampleSince v5.0
public bool AddCustomUndoEvent(string description, EventHandler<CustomUndoEventArgs> handler, object tag)
Add a custom undo event so you can undo private plug-in data when the user performs an undo or redo
description (string)
handler (EventHandler<CustomUndoEventArgs>)
tag (object)

AddCustomUndoEvent

#Since v5.0
public bool AddCustomUndoEvent(string description, EventHandler<CustomUndoEventArgs> handler)
description (string)
handler (EventHandler<CustomUndoEventArgs>)

AdjustLengthUnits

#Since v9.0
public bool AdjustLengthUnits(bool modelUnits, LengthUnit units, bool scale)
modelUnits (bool)
units (LengthUnit)
scale (bool)

AdjustModelUnitSystem

#Since v5.0
public void AdjustModelUnitSystem(UnitSystem newUnitSystem, bool scale)
newUnitSystem (UnitSystem)
scale (bool)

AdjustPageUnitSystem

#Since v5.0
public void AdjustPageUnitSystem(UnitSystem newUnitSystem, bool scale)
newUnitSystem (UnitSystem)
scale (bool)

Audit

#Since v8.19
public bool Audit(TextLog textLog, bool attemptRepair)
Audits the contents of the document.
textLog (TextLog)If an error is detected, then a description of the error is logged here.
attemptRepair (bool)If true, then the method attempts to repair any detected errors.
True if document is valid.

BeginUndoRecord

#Since v5.0
[CLSCompliant(false)] public uint BeginUndoRecord(string description)
Instructs Rhino to begin recording undo information when the document is changed outside of a command. We use this, e.g., to save changes caused by the modeless layer or object properties dialogs when commands are not running.
description (string)A text describing the record.
Serial number of record. Returns 0 if record is not started because undo information is already being recorded or undo is disabled.

ClearRedoRecords

#Since v5.0
public void ClearRedoRecords()

ClearUndoRecords

#Since v5.0
public void ClearUndoRecords(bool purgeDeletedObjects)
purgeDeletedObjects (bool)

ClearUndoRecords

#Since v6.0
[CLSCompliant(false)] public void ClearUndoRecords(uint undoSerialNumber, bool purgeDeletedObjects)
undoSerialNumber (uint)
purgeDeletedObjects (bool)

Create

#Since v6.4
public static RhinoDoc Create(string modelTemplateFileName)
Creates a new RhinoDoc
modelTemplateFileName (string)Name of a Rhino model to use as a template to initialize the document. If the template contains views, those views are created. If null, an empty document with no views is created

CreateDefaultAttributes

#ExampleSince v5.0
public ObjectAttributes CreateDefaultAttributes()
Gets the default object attributes for this document. The attributes will be linked to the currently active layer and they will inherit the Document WireDensity setting.

CreateHeadless

#Since v7.0
public static RhinoDoc CreateHeadless(string file3dmTemplatePath)
Create a new headless RhinoDoc from a template file
file3dmTemplatePath (string)Name of a Rhino model to use as a template to initialize the document. If null, an empty document is created
New RhinoDoc on success. Note that this is a "headless" RhinoDoc and it's lifetime is under your control.

CustomRenderMeshesBoundingBox

#Since v8.0
public bool CustomRenderMeshesBoundingBox(MeshType mt, ViewportInfo vp, ref Flags flags, PlugIn plugin, DisplayPipelineAttributes attrs, out BoundingBox boundingBox)
Returns the bounding box of custom render primitives for this object .
mt (MeshType)The mesh type requested (render or analysis).
vp (ViewportInfo)The viewport being rendered
flags (ref RenderMeshProvider.Flags)See RenderMeshProvider.Flags. This is an in/out parameter: on return it also carries any status flags - including RenderMeshProvider.Flags.Incomplete when an asynchronous provider has not finished - so reset it before each call and test it afterwards.
plugin (PlugIn)The requesting plug-in (typically the calling plugin)
attrs (DisplayPipelineAttributes)Display attributes for the caller - null if this is a full rendering.
boundingBox (out BoundingBox)The requested bounding box
True if the process was a success

Dispose

#Since v7.0
public void Dispose()

EndUndoRecord

#Since v5.0
[CLSCompliant(false)] public bool EndUndoRecord(uint undoRecordSerialNumber)
Ends the undo record.
undoRecordSerialNumber (uint)The serial number of the undo record.
True if successful, false otherwise.

Equals

#
public override bool Equals(object obj)
obj (object)
Object.Equals

Export

#Since v8.0
public bool Export(string filePath, ArchivableDictionary options)
Export the entire document to a file. All file formats that Rhino can export to are supported by this function.
filePath (string)
options (ArchivableDictionary)Options to help define how data should be exported.
true on success

Export

#Since v7.0
public bool Export(string filePath)
Export the entire document to a file. All file formats that Rhino can export to are supported by this function.
filePath (string)
true on success

ExportSelected

#Since v8.0
public bool ExportSelected(string filePath, ArchivableDictionary options)
Export selected geometry to a file. All file formats that Rhino can export to are supported by this function.
filePath (string)
options (ArchivableDictionary)Options to help define how data should be exported.
true on success

ExportSelected

#Since v7.0
public bool ExportSelected(string filePath)
Export selected geometry to a file. All file formats that Rhino can export to are supported by this function.
filePath (string)
true on success

ExtractPreviewImage

#Since v5.0
public static Bitmap ExtractPreviewImage(string path)
Extracts the bitmap preview image from the specified .3dm file.
path (string)The .3dm file from which to extract the preview image. If null, the path to the active document is used.
The preview bitmap if successful, null otherwise.

FindFile

#Since v5.0
public string FindFile(string filename)
Search for a file using Rhino's search path. Rhino will look in the following places: 1. Current model folder 2. Path specified in options dialog/File tab 3. Rhino system folders 4. Rhino executable folder
filename (string)
Path to existing file if found, an empty string if no file was found

FormatNumber

#Since v8.0
public string FormatNumber(double value, bool appendUnitSystemName, bool abbreviate)
Call this method to get string representing the specified value using the documents display coordinate system and display precision.
value (double)
appendUnitSystemName (bool)
abbreviate (bool)

FormatNumber

#Since v8.0
public string FormatNumber(double value)
Call this method to get string representing the specified value using the documents display coordinate system and display precision.
value (double)

FromFilePath

#Since v6.0
public static RhinoDoc FromFilePath(string filePath)
Search the open document list for a document with a Path equal to the specified file path.
filePath (string)The full path to the file to search for.
The file name to search for

FromId

#Since v5.0 Obsolete v6.0
[EditorBrowsable(EditorBrowsableState.Never)] public static RhinoDoc FromId(int docId)
obsoleteUse FromRuntimeSerialNumber
docId (int)

FromRuntimeSerialNumber

#Since v6.0
[CLSCompliant(false)] public static RhinoDoc FromRuntimeSerialNumber(uint serialNumber)
serialNumber (uint)

GetAnalysisMeshingParameters

#Since v6.0
public MeshingParameters GetAnalysisMeshingParameters()
Get analysis meshing parameters currently used by the document

GetCurrentMeshingParameters

#Since v6.0
public MeshingParameters GetCurrentMeshingParameters()
Get the custom meshing parameters that this document will use.

GetCustomUnitSystem

#Since v7.9
public bool GetCustomUnitSystem(bool modelUnits, out string customUnitName, out double metersPerCustomUnit)
Get the custom unit system name and custom unit scale.
modelUnits (bool)Set true to get values from the document's model unit system. Set false to get values from the document's page unit system.
customUnitName (out string)The custom unit system name.
metersPerCustomUnit (out double)The meters per custom unit scale.
true if successful, false otherwise.

GetEmbeddedFilesList

#Since v6.0
public string[] GetEmbeddedFilesList(bool missingOnly)
missingOnly (bool)

GetGridDefaults

#Since v8.13
public ConstructionPlaneGridDefaults GetGridDefaults()

GetGumballPlane

#Since v6.0
public bool GetGumballPlane(out Plane plane)
Returns the active plane of Rhino's auto-gumball widget. Note, when calling from a Rhino command, make sure the command class has the Rhino.Commands.Style.Transparent command style attribute.
plane (out Plane)The active plane.
true if the auto-gumball widget is enabled and visible. False otherwise.

GetHashCode

#
public override int GetHashCode()

GetMeshingParameters

#Since v5.1
public MeshingParameters GetMeshingParameters(MeshingParameterStyle style)
Get MeshingParameters currently used by the document
style (MeshingParameterStyle)

GetModelUrl

#Since v9.0
public void GetModelUrl(out string url, out string urlDescription)
Gets the link address, or URL, for the model.
url (out string)The URL.
urlDescription (out string)The URL description.

GetRedoRecords

#Since v9.0
public UndoRecordEntry[] GetRedoRecords()
Gets this document's redo history, ordered from the action that the next call to Redo() repeats to the oldest action that can be redone.
The redo records. The list is empty when there is nothing to redo.

GetRenderPrimitiveList

#Since v6.9 Obsolete v8.0
Build custom render mesh(es) for this document (i.e. - GH meshes).
viewport (ViewportInfo)The viewport being rendered.
attrs (DisplayPipelineAttributes)Attributes for the view mode you are supplying meshes for. Will be null if this is a modal rendering.
Returns a RenderPrimitiveList if successful otherwise returns null.

GetRenderPrimitives

#Since v6.0 Obsolete v8.0
[EditorBrowsable(EditorBrowsableState.Never)] public IEnumerable<RenderPrimitive> GetRenderPrimitives(bool forceTriangleMeshes, bool quietly)
obsoleteThis version is obsolete because - uses the old school custom render meshes. Prefer CustomRenderMeshes
Get a enumerable list of custom mesh primitives
forceTriangleMeshes (bool)If true all mesh faces will be triangulated
quietly (bool)Iterate quietly, if true then no user interface will be displayed

GetRenderPrimitives

#Since v6.0 Obsolete v8.0
[EditorBrowsable(EditorBrowsableState.Never)] public IEnumerable<RenderPrimitive> GetRenderPrimitives(Guid plugInId, ViewportInfo viewport, bool forceTriangleMeshes, bool quietly)
obsoleteThis version is obsolete because - uses the old school custom render meshes. Prefer RenderPrimitives
Get a enumerable list of custom mesh primitives
plugInId (Guid)The Id of the plug-in creating the iterator.
viewport (ViewportInfo)The rendering view camera.
forceTriangleMeshes (bool)If true all mesh faces will be triangulated
quietly (bool)Iterate quietly, if true then no user interface will be displayed

GetRenderPrimitives

#Since v6.0 Obsolete v8.0
[EditorBrowsable(EditorBrowsableState.Never)] public IEnumerable<RenderPrimitive> GetRenderPrimitives(ViewportInfo viewport, bool forceTriangleMeshes, bool quietly)
obsoleteThis version is obsolete because - uses the old school custom render meshes. Prefer RenderMeshes
Get a enumerable list of custom mesh primitives
viewport (ViewportInfo)The rendering view camera.
forceTriangleMeshes (bool)If true all mesh faces will be triangulated
quietly (bool)Iterate quietly, if true then no user interface will be displayed

GetUndoRecords

#Since v9.0
public UndoRecordEntry[] GetUndoRecords()
Gets this document's undo history, ordered from the most recently recorded action to the oldest recorded action.
The undo records. The list is empty when there is nothing to undo.

GetUnitSystemName

#
public string GetUnitSystemName(bool modelUnits, bool capitalize, bool singular, bool abbreviate)
modelUnits (bool)
capitalize (bool)
singular (bool)
abbreviate (bool)

HasCustomRenderMeshes

#Since v8.0
public bool HasCustomRenderMeshes(MeshType mt, ViewportInfo vp, ref Flags flags, PlugIn plugin, DisplayPipelineAttributes attrs)
Returns true if the document has a set of custom render primitives - ie, CustomRenderMeshes will return non-null.
mt (MeshType)The mesh type requested (render or analysis).
vp (ViewportInfo)The viewport being rendered.
flags (ref RenderMeshProvider.Flags)See RenderMeshProvider.Flags. This is an in/out parameter: on return it also carries any status flags - including RenderMeshProvider.Flags.Incomplete when an asynchronous provider has not finished - so reset it before each call and test it afterwards.
plugin (PlugIn)The requesting plug-in (typically the calling plugin)
attrs (DisplayPipelineAttributes)Display attributes for the caller - null if this is a full rendering.
Returns true if the object will has a set of custom render primitives

Import

#Since v8.0
public bool Import(string filePath, ArchivableDictionary options)
Import geometry into a RhinoDoc from a file. This can be any file format that Rhino can import
filePath (string)
options (ArchivableDictionary)

Import

#Since v7.0
public bool Import(string filePath)
Import geometry into a RhinoDoc from a file. This can be any file format that Rhino can import
filePath (string)
true on success

InCommand

#Since v8.0
public int InCommand(bool bIgnoreScriptRunnerCommands)
This is a low level tool to determine if Rhino is currently running a command.
bIgnoreScriptRunnerCommands (bool)If true, script running commands, like "ReadCommandFile" and the RhinoScript plug-ins "RunScript" command, are not counted.
Number of active commands.

IsMetricUnitSystem

#Since v8.6
public bool IsMetricUnitSystem(bool modelUnits)
Determines if a document unit system is a metric unit system.
modelUnits (bool)True to query model units, false to query page units.
Return true if the length unit is a metric unit system.

Open

#Since v6.0
public static RhinoDoc Open(string filePath, out bool wasAlreadyOpen)
Opens a 3dm file and makes it the active document. If called on windows the active document will be saved and closed and the new document will be opened and become the active document. If called on the Mac the file will be opened in a new document window.
filePath (string)Full path to the 3dm file to open
wasAlreadyOpen (out bool)Will get set to true if there is a currently open document with the specified path; otherwise it will get set to false.
Returns the newly opened document on success or null on error.

OpenDocuments

#Since v6.0
public static RhinoDoc[] OpenDocuments()
Returns a list of currently open Rhino documents

OpenDocuments

#Since v7.2
public static RhinoDoc[] OpenDocuments(bool includeHeadless)
Returns a list of currently open Rhino documents
includeHeadless (bool)pass true to include headless docs in the list

OpenFile

#Since v5.0 Obsolete v6.0
[EditorBrowsable(EditorBrowsableState.Never)] public static bool OpenFile(string path)
obsoleteOpenFile is obsolete, use Open instead
path (string)

OpenHeadless

#Since v7.0
public static RhinoDoc OpenHeadless(string file3dmPath)
Opens a 3DM file into a new headless RhinoDoc.
file3dmPath (string)Path of a Rhino model to load.

OpenHeadless

#Since v8.21
public static RhinoDoc OpenHeadless(string filePath, ArchivableDictionary options)
Opens a file into a new headless RhinoDoc.
filePath (string)Path of a Rhino model to load.
options (ArchivableDictionary)

OpenInteractive

#Since v6.0
public static RhinoDoc OpenInteractive(string filePath, out bool wasAlreadyOpen)
Opens a 3dm file and makes it the active document. If called on windows the active document will be saved and closed and the new document will be opened and become the active document. If called on the Mac the file will be opened in a new document window. This function is interactive in that it will ask you if you want to open a document as read only if it is already open in a different process
filePath (string)Full path to the 3dm file to open
wasAlreadyOpen (out bool)Will get set to true if there is a currently open document with the specified path; otherwise it will get set to false.
Returns the newly opened document on success or null on error.

Purge

#Since v9.0
public PurgeStatistics Purge(PurgeFilter filter, bool quiet)
Purges unused table objects from this document, the same way the Purge command does.
filter (PurgeFilter)The document table object types to purge.
quiet (bool)Set to true to suppress any output or progress messages.
What was purged.

Purge

#Since v9.0
public PurgeStatistics Purge(PurgeFilter filter)
Purges unused table objects from this document, the same way the Purge command does.
Remarks: The order in which the table object types are purged matters, and purging one type can make another type purgeable, so this purges everything filter asks for in a single operation.
filter (PurgeFilter)The document table object types to purge.
What was purged.
var stats = doc.Purge(PurgeFilter.Layers | PurgeFilter.Materials);
RhinoApp.WriteLine($"Purged {stats.PurgedCount(PurgeFilter.Layers)} layers.");

PurgeObjectHistory

#Since v9.0
public int PurgeObjectHistory()
Purges the history records of every object in this document.
Remarks: Objects that are deleted (and therefore on the undo stack) have their history records purged but are not included in the returned count.
The number of objects that had a history record purged.

PurgeObjectHistory

#Since v9.0
public int PurgeObjectHistory(IEnumerable<RhinoObject> objects)
Purges the history records of a list of objects.
objects (IEnumerable<RhinoObject>)The objects whose history records are to be purged. Objects that have no history record are skipped.
The number of objects that had a history record purged.

PurgeObjectHistory

#Since v9.0
public int PurgeObjectHistory(out int hiddenCount)
Purges the history records of every object in this document.
hiddenCount (out int)The number of purged objects that were hidden or on a hidden layer.
The number of objects that had a history record purged.

ReadFile

#Since v5.0
public static bool ReadFile(string path, FileReadOptions options)
path (string)
options (FileReadOptions)

ReadFileVersion

#Since v5.0
public int ReadFileVersion()
Returns the major version of Rhino that wrote the .3dm file this document was read from. Values from referenced or merged files are not reported.
Remarks: This is the Rhino version, not the 3dm archive version: a file written by Rhino 8 returns 8, not 80. Use File3dm.ReadArchiveVersion(string) for the archive version of a file on disk, or File3dm.ReadRevisionHistory(string, string, string, int, DateTime, DateTime) for who last edited it. A document created by "New" returns -1 even when a template was read.
The Rhino major version (e.g. 1, 2, 3, ... 8, 9), or -1 if this document was not read from a .3dm file.

Redo

#Since v6.16
public bool Redo()
Redo the last action that was "undone"
true on success

RenderMeshes

#Since v8.0
public RenderMeshes[] RenderMeshes(MeshType mt, ViewportInfo vp, ref Flags flags, PlugIn plugin, DisplayPipelineAttributes attrs)
Returns a set of non-object custom render primitives for this document.
mt (MeshType)The mesh type requested (render or analysis).
vp (ViewportInfo)The viewport being rendered
flags (ref RenderMeshProvider.Flags)See RenderMeshProvider.Flags. This is an in/out parameter: on return it also carries any status flags - including RenderMeshProvider.Flags.Incomplete when an asynchronous provider has not finished - so reset it before each call and test it afterwards.
plugin (PlugIn)The requesting plug-in (typically the calling plugin)
attrs (DisplayPipelineAttributes)Display attributes for the caller - null if this is a full rendering.
Returns a set of custom render primitives for this object

Save

#Since v7.0
public bool Save()
Save doc to disk using the document's Path

SaveAs

#Since v9.0
public bool SaveAs(string file3dmPath, int version, bool saveSmall, bool saveTextures, bool saveGeometryOnly, bool savePluginData, bool useCompression)
Save doc as a 3dm to a specified path
file3dmPath (string)
version (int)Rhino file version
saveSmall (bool)whether to inlcude render meshes and preview image
saveTextures (bool)whether to include the bitmap table
saveGeometryOnly (bool)whether to write enything besides geometry
savePluginData (bool)whether to write plugin user data
useCompression (bool)"whether to compress meshes and embedded files
true on success

SaveAs

#Since v8.0
public bool SaveAs(string file3dmPath, int version, bool saveSmall, bool saveTextures, bool saveGeometryOnly, bool savePluginData)
Save doc as a 3dm to a specified path
file3dmPath (string)
version (int)Rhino file version
saveSmall (bool)whether to inlcude render meshes and preview image
saveTextures (bool)whether to include the bitmap table
saveGeometryOnly (bool)whether to write enything besides geometry
savePluginData (bool)whether to write plugin user data
true on success

SaveAs

#Since v7.0
public bool SaveAs(string file3dmPath, int version)
Save doc as a 3dm to a specified path
file3dmPath (string)
version (int)Rhino file version
true on success

SaveAs

#Since v7.0
public bool SaveAs(string file3dmPath)
Save doc as a 3dm to a specified path using the current Rhino file version
file3dmPath (string)
true on success

SaveAsTemplate

#Since v7.0
public bool SaveAsTemplate(string file3dmTemplatePath, int version)
Save this document as a template to a specific Rhino file version
file3dmTemplatePath (string)
version (int)
true on success

SaveAsTemplate

#Since v7.0
public bool SaveAsTemplate(string file3dmTemplatePath)
Save this document as a template
file3dmTemplatePath (string)
true on success

SelectRenderContentInEditor

#Since v7.20
public void SelectRenderContentInEditor(RenderContentCollection collection, bool append)
Selects a collection of contents in any editors they appear in.
collection (RenderContentCollection)A collection of RenderContents to select
append (bool)Append to current selection

SetCurrentUndoRecordDescription

#Since v9.0
public bool SetCurrentUndoRecordDescription(string description)
Sets the description of the undo record currently being recorded. Use this to give the undo record of a running command, such as RunPythonScript, a meaningful name in Undo, Redo, and UndoMultiple.
description (string)The new description. Cannot be null, empty, or only white space.
true if an undo record is active and its description was set.

SetCustomMeshingParameters

#Since v5.1
public void SetCustomMeshingParameters(MeshingParameters mp)
Set the custom meshing parameters that this document will use. You must also modify the MeshingParameterStyle property on the document to Custom if you want these meshing parameters to be used
mp (MeshingParameters)

SetCustomUnitSystem

#Since v7.9
public bool SetCustomUnitSystem(bool modelUnits, string customUnitName, double metersPerCustomUnit, bool scale)
Changes the unit system to custom units and sets the custom unit scale.
modelUnits (bool)Set true to set values from the document's model unit system. Set false to set values from the document's page unit system.
customUnitName (string)The custom unit system name.
metersPerCustomUnit (double)The meters per custom unit scale.
scale (bool)Set true to scale existing objects.
true if successful, false otherwise.

SetGridDefaults

#Since v8.13
public void SetGridDefaults(ConstructionPlaneGridDefaults defaults)
defaults (ConstructionPlaneGridDefaults)

SetModelUrl

#Since v9.0
public void SetModelUrl(string url, string urlDescription)
Sets the link address, or URL, for the model.
url (string)The URL.
urlDescription (string)The URL description.

SupportsRenderPrimitiveList

#Since v6.9 Obsolete v8.0
[EditorBrowsable(EditorBrowsableState.Never)] public bool SupportsRenderPrimitiveList(ViewportInfo viewport, DisplayPipelineAttributes attrs)
Determines if custom render meshes will be built for this document (i.e. - GH meshes).
viewport (ViewportInfo)The viewport being rendered.
attrs (DisplayPipelineAttributes)Type of mesh to build. If attrs is non-null then a smaller mesh may be generated in less time, false is meant when actually rendering.
Returns true if custom render mesh(es) will get built for this document.

TimeoutActiveGet

#Since v9.0
public void TimeoutActiveGet()
Exit the active get operation with a timeout

TryGetRenderPrimitiveBoundingBox

#Since v6.9 Obsolete v8.0
[EditorBrowsable(EditorBrowsableState.Never)] public bool TryGetRenderPrimitiveBoundingBox(ViewportInfo viewport, DisplayPipelineAttributes attrs, out BoundingBox boundingBox)
Get the bounding box for the custom render meshes associated with this document (i.e. - GH meshes).
viewport (ViewportInfo)The viewport being rendered.
attrs (DisplayPipelineAttributes)Attributes for the view mode you are supplying meshes for. Will be null if this is a modal rendering.
boundingBox (out BoundingBox)This will be set to BoundingBox.Unset on failure otherwise it will be the bounding box for the custom render meshes associated with this object.
Returns true if the bounding box was successfully calculated otherwise returns false on error.

Undo

#Since v6.16
public bool Undo()
Undo the last action
true on success

Write3dmFile

#Since v6.5
public bool Write3dmFile(string path, FileWriteOptions options)
Write information in this document to a .3dm file. Note, the active document's name will not be changed.
path (string)The name of the .3dm file to write.
options (FileWriteOptions)The file writing options.
true if successful, false on failure.

WriteFile

#Since v5.0
public bool WriteFile(string path, FileWriteOptions options)
Write information in this document to a file. Note, the active document's name will be changed to that of the path provided.
Remarks: This is the best choice for general file writing. It handles making backups using temporary files, locking and unlocking, loading file writing plug-ins, and many other details.
path (string)The name of the file to write.
options (FileWriteOptions)The file writing options.
true if successful, false on failure.

Events

ActiveDocumentChanged

#Since v6.0
public static event EventHandler<DocumentEventArgs> ActiveDocumentChanged
This event is raised when the active document used by modeless user interface changes. On Mac Rhino this will get raised before the NewDocument, BeginOpenDocument and EndOpenDocument events. Mac Rhino will also raise this event with 0 for the document Id and a null document pointer when the last document is closed. Windows Rhino will raise this event after the NewDocument, BeginOpenDocument and EndOpenDocument events when a new or existing model is opened.

AddRhinoObject

#Since v5.0
public static event EventHandler<RhinoObjectEventArgs> AddRhinoObject
Called if a new object is added to the document.

AfterTransformObjects

#Since v8.15
public static event EventHandler<RhinoAfterTransformObjectsEventArgs> AfterTransformObjects
Called after objects are being transformed

BeforeTransformObjects

#ExampleSince v5.10
public static event EventHandler<RhinoTransformObjectsEventArgs> BeforeTransformObjects
Called before objects are being transformed

BeginOpenDocument

#Since v5.0
public static event EventHandler<DocumentOpenEventArgs> BeginOpenDocument
This event is raised when the document open operation begins. NOTE: On Windows, this event will be fired when a clipboard paste operation occurs, as Rhino opens a .tmp file in the User's Local folder with the contents of the pasted document.

BeginSaveDocument

#Since v5.0
public static event EventHandler<DocumentSaveEventArgs> BeginSaveDocument

CloseDocument

#Since v5.0
public static event EventHandler<DocumentEventArgs> CloseDocument

DeleteRhinoObject

#Since v5.0
public static event EventHandler<RhinoObjectEventArgs> DeleteRhinoObject
Called if an object is deleted. At some later point the object can be un-deleted.

DeselectAllObjects

#Since v5.0
public static event EventHandler<RhinoDeselectAllObjectsEventArgs> DeselectAllObjects
Called when all objects are deselected.

DeselectObjects

#Since v5.0
public static event EventHandler<RhinoObjectSelectionEventArgs> DeselectObjects
Called when object(s) are deselected.

DimensionStyleTableEvent

#Since v6.0
public static event EventHandler<DimStyleTableEventArgs> DimensionStyleTableEvent
Called when any modification happens to a document's dimension style table.

DocumentPropertiesChanged

#Since v5.0
public static event EventHandler<DocumentEventArgs> DocumentPropertiesChanged

EndOpenDocument

#Since v5.0
public static event EventHandler<DocumentOpenEventArgs> EndOpenDocument

EndOpenDocumentInitialiViewUpdate

#Since v5.11
[EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler<DocumentOpenEventArgs> EndOpenDocumentInitialiViewUpdate
obsoleteTypo: use EndOpenDocumentInitialViewUpdate
This event is raised after EndOpenDocument when the documents initial views have been created and initialized.

EndOpenDocumentInitialViewUpdate

#Since v6.18
public static event EventHandler<DocumentOpenEventArgs> EndOpenDocumentInitialViewUpdate
This event is raised after EndOpenDocument when the documents initial views have been created and initialized.

EndSaveDocument

#Since v5.0
public static event EventHandler<DocumentSaveEventArgs> EndSaveDocument

GroupTableEvent

#Since v5.0
public static event EventHandler<GroupTableEventArgs> GroupTableEvent
Called when any modification happens to a document's group table.

HatchPatternTableEvent

#Since v8.15
public static event EventHandler<HatchPatternTableEventArgs> HatchPatternTableEvent
Called when any modification happens to a document's hatch pattern table.

InstanceDefinitionTableEvent

#Since v5.3
public static event EventHandler<InstanceDefinitionTableEventArgs> InstanceDefinitionTableEvent
Called when any modification happens to a document's instance definition table.

LayerTableEvent

#Since v5.0
public static event EventHandler<LayerTableEventArgs> LayerTableEvent
Called when any modification happens to a document's layer table.

LightTableEvent

#Since v5.3
public static event EventHandler<LightTableEventArgs> LightTableEvent
Called when any modification happens to a document's light table.

LinetypeTableEvent

#Since v8.0
public static event EventHandler<LinetypeTableEventArgs> LinetypeTableEvent
Called when any modification happens to a document's linetype table.

MarkupTableEvent

#Since v9.0
public static event EventHandler<MarkupTableEventArgs> MarkupTableEvent
Called when any modification happens to a document's markup table.

MarkupViewChanged

#Since v9.0
public static event EventHandler<MarkupViewChangedEventArgs> MarkupViewChanged
Called when a document's markup view state changes, i.e. when the document enters or leaves markup viewing/editing, or switches which markup is being viewed or edited. Unlike MarkupTableEvent (which reports markup add/delete/modify), this reports which markup is currently active so UI can indicate it.
Remarks: Switching directly from one markup to another first leaves the current markup, so the switch is reported as two events: an intervening MarkupMode.None (index -1) followed by the new markup. Handlers should treat each event as the current state.

MaterialTableEvent

#Since v5.0
public static event EventHandler<MaterialTableEventArgs> MaterialTableEvent
Called when any modification happens to a document's material table.

ModifyObjectAttributes

#Since v5.0
public static event EventHandler<RhinoModifyObjectAttributesEventArgs> ModifyObjectAttributes
Called when all object attributes are changed.

NewDocument

#Since v5.0
public static event EventHandler<DocumentEventArgs> NewDocument

PageViewGroupTableEvent

#Since v9.0
public static event EventHandler<PageViewGroupTableEventArgs> PageViewGroupTableEvent
Called when any modification happens to a document's pageview group table.

PurgeRhinoObject

#Since v5.0
public static event EventHandler<RhinoObjectEventArgs> PurgeRhinoObject
Called if an object is being purged from a document. The object will cease to exist forever.

RenderEnvironmentTableEvent

#Since v5.7
public static event EventHandler<RhinoDoc.RenderContentTableEventArgs> RenderEnvironmentTableEvent

RenderMaterialsTableEvent

#Since v5.7
public static event EventHandler<RhinoDoc.RenderContentTableEventArgs> RenderMaterialsTableEvent

RenderTextureTableEvent

#Since v5.7
public static event EventHandler<RhinoDoc.RenderContentTableEventArgs> RenderTextureTableEvent
Called when the RenderTextureTable has been loaded, is about to be cleared or has been cleared. See RhinoDoc.RenderContentTableEventType for more information.

ReplaceRhinoObject

#Since v5.0
public static event EventHandler<RhinoReplaceObjectEventArgs> ReplaceRhinoObject
Called if an object is about to be replaced. If both UndoActive and RedoActive return false, then immediately after the ReplaceRhinoObject event, there will be a DeleteRhinoObject event followed by a AddRhinoObject event. If either UndoActive or UndoActive return true, then immediately after the ReplaceRhinoObject event, there will be a DeleteRhinoObject event followed by a UndeleteRhinoObject event.

SectionStyleTableEvent

#Since v9.0
public static event EventHandler<SectionStyleTableEventArgs> SectionStyleTableEvent
Called when any modification happens to a document's section style table.

SelectObjects

#Since v5.0
public static event EventHandler<RhinoObjectSelectionEventArgs> SelectObjects
Called when object(s) are selected.

TextureMappingEvent

#Since v5.8
public static event EventHandler<RhinoDoc.TextureMappingEventArgs> TextureMappingEvent
Called when any modification happens to a document objects texture mapping.

UndeleteRhinoObject

#Since v5.0
public static event EventHandler<RhinoObjectEventArgs> UndeleteRhinoObject
Called if an object is un-deleted.

UnitsChangedWithScaling

#Since v7.20
public static event EventHandler<UnitsChangedWithScalingEventArgs> UnitsChangedWithScaling
Called when a change in the model units results in a scaling operation on all of the objects in the document. This call is made before any of the objects are scaled. A call to RhinoDoc.DocumentPropertiesChanged follows.

UserStringChanged

#
public static event EventHandler<RhinoDoc.UserStringChangedArgs> UserStringChanged
This event is raised when document user text strings are changed

WorksessionFileChanged

#Since v9.0
public static event EventHandler<RhinoDoc.WorksessionFileChangedEventArgs> WorksessionFileChanged
Raised after a worksession reference model has been attached to or detached from a document. The document state already reflects the change at the time the event fires.