RhinoDoc
Represents an active model.
Inheritance Hierarchy
System.Object
Rhino.RhinoDoc
Namespace: Rhino
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public sealed class RhinoDoc : IDisposable
The RhinoDoc type exposes the following members.
Properties
Name
Description
Public Property
ActiveCommandId
Get the ID of the active command.
Public Property
Static Member
ActiveDoc
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.
Public Property
ActiveSpace
Get the space associated with the active view for this document
Public Property
AnimationProperties
Public Property
Bitmaps
bitmaps used in textures, backgrounds, wallpapers, …
Public Property
CurrentEnvironment
Obsolete.
Access to the current environment for various uses
Public Property
CurrentUndoRecordSerialNumber
\>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.)
Public Property
CustomRenderSizes
Public Property
DateCreated
Public Property
DateLastEdited
Returns the date the document was created in Coordinated Universal Time (UTC). Use DateTime.ToLocalTime to convert to local time.
Public Property
Code Example
DimStyles
Public Property
DistanceDisplayPrecision
Public Property
EarthAnchorPoint
Public Property
Fonts
Obsolete.
Public Property
GroundPlane
Obsolete.
Gets the ground plane of this document.
Public Property
Code Example
Groups
Public Property
Code Example
HatchPatterns
Public Property
InGetPoint
Returns true if currently in a GetPoint.Get().
Public Property
Code Example
InstanceDefinitions
Public Property
IsAvailable
Public Property
IsClosing
Public Property
IsCommandRunning
Returns true if Rhino is currently running a command.
Public Property
IsCreating
Public Property
IsHeadless
Public Property
IsInitializing
Public Property
IsLocked
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.
Public Property
IsOpening
Public Property
IsReadOnly
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.
Public Property
IsSendingMail
true if Rhino is in the process of sending this document as an email attachment.
Public Property
Layers
Layers in the document.
Public Property
LayoutSpaceAnnotationScalingEnabled
If LayoutSpaceAnnotationScaling is on, sizes in dimstyles are multiplied by dimscale when the annotation is displayed in a detail viewport not in a detail
Public Property
Lights
Public Property
Linetypes
Linetypes in the document.
Public Property
Manifest
Public Property
Materials
Materials in the document.
Public Property
MeshingParameterStyle
Type of MeshingParameters currently used by the document to mesh objects
Public Property
ModelAbsoluteTolerance
Model space absolute tolerance.
Public Property
ModelAngleToleranceDegrees
Model space angle tolerance.
Public Property
ModelAngleToleranceRadians
Model space angle tolerance.
Public Property
ModelBasepoint
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.
Public Property
Code Example
ModelDistanceDisplayPrecision
Public Property
ModelRelativeTolerance
Model space relative tolerance.
Public Property
ModelSpaceAnnotationScalingEnabled
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
Public Property
ModelSpaceHatchScale
The scale factor for hatches in model space when Hatch Scaling is enabled
Public Property
ModelSpaceHatchScalingEnabled
True if hatch scaling is enabled, false if not.
Public Property
ModelSpaceTextScale
The scale factor for text in model space when Annotation Scaling is enabled
Public Property
ModelUnitSystem
Public Property
Modified
Returns or sets the document’s modified flag.
Public Property
Name
Returns the name of the currently loaded Rhino document (3DM file).
Public Property
NamedConstructionPlanes
Collection of named construction planes.
Public Property
NamedLayerStates
Collection of named layer states.
Public Property
NamedPositions
Collection of named positions.
Public Property
Code Example
NamedViews
Collection of named views.
Public Property
NextUndoRecordSerialNumber
The serial number that will be assigned to the next undo record that is constructed.
Public Property
Notes
Returns or sets the document’s notes.
Public Property
NotesLocked
Public Property
Objects
Public Property
PageAbsoluteTolerance
Page space absolute tolerance.
Public Property
PageAngleToleranceDegrees
Page space angle tolerance.
Public Property
PageAngleToleranceRadians
Page space angle tolerance.
Public Property
PageDistanceDisplayPrecision
Public Property
PageRelativeTolerance
Page space relative tolerance.
Public Property
Code Example
PageUnitSystem
Public Property
Path
Returns the path of the currently loaded Rhino document (3DM file).
Public Property
PostEffects
Obsolete.
Access to the post effects
Public Property
RedoActive
Returns true if Redo is currently active.
Public Property
RenderEnvironments
Public Property
RenderMaterials
Public Property
RenderSettings
Public Property
RenderTextures
Public Property
RuntimeData
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.
Public Property
RuntimeSerialNumber
Unique serialNumber for the document while the application is running. This is not a persistent value.
Public Property
Snapshots
Collection of snapshots.
Public Property
Strings
Collection of document user data strings in this document
Public Property
SubDAppearance
Returns or sets the appearance of all SubD objects in the document.
Public Property
TemplateFileUsed
name of the template file used to create this document. This is a runtime value only present if the document was newly created.
Public Property
UndoActive
Returns true if Undo is currently active.
Public Property
UndoRecordingEnabled
Public Property
UndoRecordingIsActive
true if undo recording is actually happening now.
Public Property
Views
Public Property
Worksession
Provides access to the document’s worksession.
Methods
Name
Description
Public Method
AddCustomUndoEvent(String, EventHandler.CustomUndoEventArgs.)
Public Method
Code Example
AddCustomUndoEvent(String, EventHandler.CustomUndoEventArgs., Object)
Add a custom undo event so you can undo private plug-in data when the user performs an undo or redo
Public Method
AdjustModelUnitSystem
Public Method
AdjustPageUnitSystem
Public Method
BeginUndoRecord
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.
Public Method
ClearRedoRecords
Public Method
ClearUndoRecords(Boolean)
Public Method
ClearUndoRecords(UInt32, Boolean)
Public Method
Static Member
Create
Creates a new RhinoDoc
Public Method
Code Example
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.
Public Method
Static Member
CreateHeadless
Create a new headless RhinoDoc from a template file
Public Method
CustomRenderMeshesBoundingBox
Returns the bounding box of custom render primitives for this object .
Public Method
Dispose
Releases all resources used by the RhinoDoc
Public Method
EndUndoRecord
Ends the undo record.
Public Method
Equals
(Overrides Object.Equals(Object).)
Public Method
Export(String)
Export the entire document to a file. All file formats that Rhino can export to are supported by this function.
Public Method
Export(String, ArchivableDictionary)
Export the entire document to a file. All file formats that Rhino can export to are supported by this function.
Public Method
ExportSelected(String)
Export selected geometry to a file. All file formats that Rhino can export to are supported by this function.
Public Method
ExportSelected(String, ArchivableDictionary)
Export selected geometry to a file. All file formats that Rhino can export to are supported by this function.
Public Method
Static Member
ExtractPreviewImage
Extracts the bitmap preview image from the specified .3dm file.
Protected Method
Finalize
(Overrides Object.Finalize..)
Public Method
FindFile
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
Public Method
FormatNumber(Double)
Call this method to get string representing the specified value using the documents display coordinate system and display precision.
Public Method
FormatNumber(Double, Boolean, Boolean)
Call this method to get string representing the specified value using the documents display coordinate system and display precision.
Public Method
Static Member
FromFilePath
Search the open document list for a document with a Path equal to the specified file path.
Public Method
Static Member
FromId
Obsolete.
Public Method
Static Member
FromRuntimeSerialNumber
Public Method
GetAnalysisMeshingParameters
Get analysis meshing parameters currently used by the document
Public Method
GetCurrentMeshingParameters
Get the custom meshing parameters that this document will use.
Public Method
GetCustomUnitSystem
Get the custom unit system name and custom unit scale.
Public Method
GetEmbeddedFilesList
Public Method
GetGridDefaults
Public Method
GetGumballPlane
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.
Public Method
GetHashCode
(Overrides Object.GetHashCode..)
Public Method
GetMeshingParameters
Get MeshingParameters currently used by the document
Public Method
GetRenderPrimitiveList
Obsolete.
Build custom render mesh(es) for this document (i.e. - GH meshes).
Public Method
GetRenderPrimitives(Boolean, Boolean)
Obsolete.
Get a enumerable list of custom mesh primitives
Public Method
GetRenderPrimitives(ViewportInfo, Boolean, Boolean)
Obsolete.
Get a enumerable list of custom mesh primitives
Public Method
GetRenderPrimitives(Guid, ViewportInfo, Boolean, Boolean)
Obsolete.
Get a enumerable list of custom mesh primitives
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
GetUnitSystemName
Public Method
HasCustomRenderMeshes
Returns true if the document has a set of custom render primitives - ie, CustomRenderMeshes will return non-null.
Public Method
Import(String)
Import geometry into a RhinoDoc from a file. This can be any file format that Rhino can import
Public Method
Import(String, ArchivableDictionary)
Import geometry into a RhinoDoc from a file. This can be any file format that Rhino can import
Public Method
InCommand
This is a low level tool to determine if Rhino is currently running a command.
Public Method
IsMetricUnitSystem
Determines if a document unit system is a metric unit system.
Public Method
Static Member
Open
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.
Public Method
Static Member
OpenDocuments.
Returns a list of currently open Rhino documents
Public Method
Static Member
OpenDocuments(Boolean)
Returns a list of currently open Rhino documents
Public Method
Static Member
OpenFile
Obsolete.
Public Method
Static Member
OpenHeadless
Opens a 3DM file into a new headless RhinoDoc.
Public Method
Static Member
ReadFile
Public Method
ReadFileVersion
Returns the file version of the current document. Use this function to determine which version of Rhino last saved the document.
Public Method
Redo
Redo the last action that was “undone”
Public Method
RenderMeshes
Returns a set of non-object custom render primitives for this document.
Public Method
Save
Save doc to disk using the document’s Path
Public Method
SaveAs(String)
Save doc as a 3dm to a specified path using the current Rhino file version
Public Method
SaveAs(String, Int32)
Save doc as a 3dm to a specified path
Public Method
SaveAs(String, Int32, Boolean, Boolean, Boolean, Boolean)
Save doc as a 3dm to a specified path
Public Method
SaveAsTemplate(String)
Save this document as a template
Public Method
SaveAsTemplate(String, Int32)
Save this document as a template to a specific Rhino file version
Public Method
SelectRenderContentInEditor
Selects a collection of contents in any editors they appear in.
Public Method
SetCustomMeshingParameters
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
Public Method
SetCustomUnitSystem
Changes the unit system to custom units and sets the custom unit scale.
Public Method
SetGridDefaults
Public Method
SupportsRenderPrimitiveList
Obsolete.
Determines if custom render meshes will be built for this document (i.e. - GH meshes).
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public Method
TryGetRenderPrimitiveBoundingBox
Obsolete.
Get the bounding box for the custom render meshes associated with this document (i.e. - GH meshes).
Public Method
Undo
Undo the last action
Public Method
Write3dmFile
Write information in this document to a .3dm file. Note, the active document’s name will not be changed.
Public Method
WriteFile
Write information in this document to a file. Note, the active document’s name will be changed to that of the path provided.
Events
Name
Description
Public Event
Static Member
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
andEndOpenDocument
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 theNewDocument
,BeginOpenDocument
andEndOpenDocument
events when a new or existing model is opened.Public Event
Static Member
AddRhinoObject
Called if a new object is added to the document.
Public Event
Static Member
Code Example
BeforeTransformObjects
Called before objects are being transformed
Public Event
Static Member
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.
Public Event
Static Member
BeginSaveDocument
Public Event
Static Member
CloseDocument
Public Event
Static Member
DeleteRhinoObject
Called if an object is deleted. At some later point the object can be un-deleted.
Public Event
Static Member
DeselectAllObjects
Called when all objects are deselected.
Public Event
Static Member
DeselectObjects
Called when object(s) are deselected.
Public Event
Static Member
DimensionStyleTableEvent
Called when any modification happens to a document’s dimension style table.
Public Event
Static Member
DocumentPropertiesChanged
Public Event
Static Member
EndOpenDocument
Public Event
Static Member
EndOpenDocumentInitialViewUpdate
This event is raised after
EndOpenDocument
when the documents initial views have been created and initialized.Public Event
Static Member
EndSaveDocument
Public Event
Static Member
GroupTableEvent
Called when any modification happens to a document’s group table.
Public Event
Static Member
InstanceDefinitionTableEvent
Called when any modification happens to a document’s instance definition table.
Public Event
Static Member
LayerTableEvent
Called when any modification happens to a document’s layer table.
Public Event
Static Member
LightTableEvent
Called when any modification happens to a document’s light table.
Public Event
Static Member
LinetypeTableEvent
Called when any modification happens to a document’s linetype table.
Public Event
Static Member
MaterialTableEvent
Called when any modification happens to a document’s material table.
Public Event
Static Member
ModifyObjectAttributes
Called when all object attributes are changed.
Public Event
Static Member
NewDocument
Public Event
Static Member
PurgeRhinoObject
Called if an object is being purged from a document. The object will cease to exist forever.
Public Event
Static Member
RenderEnvironmentTableEvent
Public Event
Static Member
RenderMaterialsTableEvent
Public Event
Static Member
RenderTextureTableEvent
Called when the RenderTextureTable has been loaded, is about to be cleared or has been cleared. See RhinoDoc.RenderContentTableEventType for more information.
Public Event
Static Member
ReplaceRhinoObject
Called if an object is about to be replaced. If both RhinoDoc.UndoActive() and RhinoDoc.RedoActive() return false, then immediately after the ReplaceObject event, there will be a DeleteObject event followed by an AddObject event. If either RhinoDoc.UndoActive() or RhinoDoc::RedoActive() return true, then immediately after the ReplaceObject event, there will be a DeleteObject event followed by an UndeleteObject event.
Public Event
Static Member
SelectObjects
Called when object(s) are selected.
Public Event
Static Member
TextureMappingEvent
Called when any modification happens to a document objects texture mapping.
Public Event
Static Member
UndeleteRhinoObject
Called if an object is un-deleted.
Public Event
Static Member
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.
Public Event
Static Member
UserStringChanged
This event is raised when document user text strings are changed