Click or drag to resize

RhinoDoc Class

Represents an active model.
Inheritance Hierarchy
SystemObject
  RhinoRhinoDoc

Namespace:  Rhino
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public sealed class RhinoDoc : IDisposable

The RhinoDoc type exposes the following members.

Properties
  NameDescription
Public propertyActiveCommandId
Get the ID of the active command.
Public propertyStatic memberActiveDoc
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 propertyActiveSpace
Get the space associated with the active view for this document
Public propertyAnimationProperties
Public propertyBitmaps
bitmaps used in textures, backgrounds, wallpapers, ...
Public propertyCurrentEnvironment Obsolete.
Access to the current environment for various uses
Public propertyCurrentUndoRecordSerialNumber
>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 propertyCustomRenderSizes
Public propertyDateCreated
Public propertyDateLastEdited
Returns the date the document was created in Coordinated Universal Time (UTC). Use DateTime.ToLocalTime to convert to local time.
Public propertyCode exampleDimStyles
Public propertyDistanceDisplayPrecision
Public propertyEarthAnchorPoint
Public propertyFonts Obsolete.
Public propertyGroundPlane Obsolete.
Gets the ground plane of this document.
Public propertyCode exampleGroups
Public propertyCode exampleHatchPatterns
Public propertyInGetPoint
Returns true if currently in a GetPoint.Get().
Public propertyCode exampleInstanceDefinitions
Public propertyIsAvailable
Public propertyIsClosing
Public propertyIsCommandRunning
Returns true if Rhino is currently running a command.
Public propertyIsCreating
Public propertyIsHeadless
Public propertyIsInitializing
Public propertyIsLocked
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 propertyIsOpening
Public propertyIsReadOnly
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 propertyIsSendingMail
true if Rhino is in the process of sending this document as an email attachment.
Public propertyLayers
Layers in the document.
Public propertyLayoutSpaceAnnotationScalingEnabled
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 propertyLights
Public propertyLinetypes
Linetypes in the document.
Public propertyManifest
Public propertyMaterials
Materials in the document.
Public propertyMeshingParameterStyle
Type of MeshingParameters currently used by the document to mesh objects
Public propertyModelAbsoluteTolerance
Model space absolute tolerance.
Public propertyModelAngleToleranceDegrees
Model space angle tolerance.
Public propertyModelAngleToleranceRadians
Model space angle tolerance.
Public propertyModelBasepoint
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 propertyCode exampleModelDistanceDisplayPrecision
Public propertyModelRelativeTolerance
Model space relative tolerance.
Public propertyModelSpaceAnnotationScalingEnabled
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 propertyModelSpaceHatchScale
The scale factor for hatches in model space when Hatch Scaling is enabled
Public propertyModelSpaceHatchScalingEnabled
True if hatch scaling is enabled, false if not.
Public propertyModelSpaceTextScale
The scale factor for text in model space when Annotation Scaling is enabled
Public propertyModelUnitSystem
Public propertyModified
Returns or sets the document's modified flag.
Public propertyName
Returns the name of the currently loaded Rhino document (3DM file).
Public propertyNamedConstructionPlanes
Collection of named construction planes.
Public propertyNamedLayerStates
Collection of named layer states.
Public propertyNamedPositions
Collection of named positions.
Public propertyCode exampleNamedViews
Collection of named views.
Public propertyNextUndoRecordSerialNumber
The serial number that will be assigned to the next undo record that is constructed.
Public propertyNotes
Returns or sets the document's notes.
Public propertyNotesLocked
Public propertyObjects
Public propertyPageAbsoluteTolerance
Page space absolute tolerance.
Public propertyPageAngleToleranceDegrees
Page space angle tolerance.
Public propertyPageAngleToleranceRadians
Page space angle tolerance.
Public propertyPageDistanceDisplayPrecision
Public propertyPageRelativeTolerance
Page space relative tolerance.
Public propertyCode examplePageUnitSystem
Public propertyPath
Returns the path of the currently loaded Rhino document (3DM file).
Public propertyPostEffects Obsolete.
Access to the post effects
Public propertyRedoActive
Returns true if Redo is currently active.
Public propertyRenderEnvironments
Public propertyRenderMaterials
Public propertyRenderSettings
Public propertyRenderTextures
Public propertyRuntimeData
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 propertyRuntimeSerialNumber
Unique serialNumber for the document while the application is running. This is not a persistent value.
Public propertySnapshots
Collection of snapshots.
Public propertyStrings
Collection of document user data strings in this document
Public propertySubDAppearance
Returns or sets the appearance of all SubD objects in the document.
Public propertyTemplateFileUsed
name of the template file used to create this document. This is a runtime value only present if the document was newly created.
Public propertyUndoActive
Returns true if Undo is currently active.
Public propertyUndoRecordingEnabled
Public propertyUndoRecordingIsActive
true if undo recording is actually happening now.
Public propertyViews
Public propertyWorksession
Provides access to the document's worksession.
Top
Methods
  NameDescription
Public methodAddCustomUndoEvent(String, EventHandlerCustomUndoEventArgs)
Public methodCode exampleAddCustomUndoEvent(String, EventHandlerCustomUndoEventArgs, Object)
Add a custom undo event so you can undo private plug-in data when the user performs an undo or redo
Public methodAdjustModelUnitSystem
Public methodAdjustPageUnitSystem
Public methodBeginUndoRecord
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 methodClearRedoRecords
Public methodClearUndoRecords(Boolean)
Public methodClearUndoRecords(UInt32, Boolean)
Public methodStatic memberCreate
Creates a new RhinoDoc
Public methodCode exampleCreateDefaultAttributes
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 methodStatic memberCreateHeadless
Create a new headless RhinoDoc from a template file
Public methodCustomRenderMeshesBoundingBox
Returns the bounding box of custom render primitives for this object .
Public methodDispose
Releases all resources used by the RhinoDoc
Public methodEndUndoRecord
Ends the undo record.
Public methodEquals (Overrides ObjectEquals(Object).)
Public methodExport(String)
Export the entire document to a file. All file formats that Rhino can export to are supported by this function.
Public methodExport(String, ArchivableDictionary)
Export the entire document to a file. All file formats that Rhino can export to are supported by this function.
Public methodExportSelected(String)
Export selected geometry to a file. All file formats that Rhino can export to are supported by this function.
Public methodExportSelected(String, ArchivableDictionary)
Export selected geometry to a file. All file formats that Rhino can export to are supported by this function.
Public methodStatic memberExtractPreviewImage
Extracts the bitmap preview image from the specified .3dm file.
Protected methodFinalize (Overrides ObjectFinalize.)
Public methodFindFile
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 methodFormatNumber(Double)
Call this method to get string representing the specified value using the documents display coordinate system and display precision.
Public methodFormatNumber(Double, Boolean, Boolean)
Call this method to get string representing the specified value using the documents display coordinate system and display precision.
Public methodStatic memberFromFilePath
Search the open document list for a document with a Path equal to the specified file path.
Public methodStatic memberFromId Obsolete.
Public methodStatic memberFromRuntimeSerialNumber
Public methodGetAnalysisMeshingParameters
Get analysis meshing parameters currently used by the document
Public methodGetCurrentMeshingParameters
Get the custom meshing parameters that this document will use.
Public methodGetCustomUnitSystem
Get the custom unit system name and custom unit scale.
Public methodGetEmbeddedFilesList
Public methodGetGridDefaults
Public methodGetGumballPlane
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 methodGetHashCode (Overrides ObjectGetHashCode.)
Public methodGetMeshingParameters
Get MeshingParameters currently used by the document
Public methodGetRenderPrimitiveList Obsolete.
Build custom render mesh(es) for this document (i.e. - GH meshes).
Public methodGetRenderPrimitives(Boolean, Boolean) Obsolete.
Get a enumerable list of custom mesh primitives
Public methodGetRenderPrimitives(ViewportInfo, Boolean, Boolean) Obsolete.
Get a enumerable list of custom mesh primitives
Public methodGetRenderPrimitives(Guid, ViewportInfo, Boolean, Boolean) Obsolete.
Get a enumerable list of custom mesh primitives
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUnitSystemName
Public methodHasCustomRenderMeshes
Returns true if the document has a set of custom render primitives - ie, CustomRenderMeshes will return non-null.
Public methodImport(String)
Import geometry into a RhinoDoc from a file. This can be any file format that Rhino can import
Public methodImport(String, ArchivableDictionary)
Import geometry into a RhinoDoc from a file. This can be any file format that Rhino can import
Public methodInCommand
This is a low level tool to determine if Rhino is currently running a command.
Public methodIsMetricUnitSystem
Determines if a document unit system is a metric unit system.
Public methodStatic memberOpen
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 methodStatic memberOpenDocuments
Returns a list of currently open Rhino documents
Public methodStatic memberOpenDocuments(Boolean)
Returns a list of currently open Rhino documents
Public methodStatic memberOpenFile Obsolete.
Public methodStatic memberOpenHeadless
Opens a 3DM file into a new headless RhinoDoc.
Public methodStatic memberReadFile
Public methodReadFileVersion
Returns the file version of the current document. Use this function to determine which version of Rhino last saved the document.
Public methodRedo
Redo the last action that was "undone"
Public methodRenderMeshes
Returns a set of non-object custom render primitives for this document.
Public methodSave
Save doc to disk using the document's Path
Public methodSaveAs(String)
Save doc as a 3dm to a specified path using the current Rhino file version
Public methodSaveAs(String, Int32)
Save doc as a 3dm to a specified path
Public methodSaveAs(String, Int32, Boolean, Boolean, Boolean, Boolean)
Save doc as a 3dm to a specified path
Public methodSaveAsTemplate(String)
Save this document as a template
Public methodSaveAsTemplate(String, Int32)
Save this document as a template to a specific Rhino file version
Public methodSelectRenderContentInEditor
Selects a collection of contents in any editors they appear in.
Public methodSetCustomMeshingParameters
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 methodSetCustomUnitSystem
Changes the unit system to custom units and sets the custom unit scale.
Public methodSetGridDefaults
Public methodSupportsRenderPrimitiveList Obsolete.
Determines if custom render meshes will be built for this document (i.e. - GH meshes).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTryGetRenderPrimitiveBoundingBox Obsolete.
Get the bounding box for the custom render meshes associated with this document (i.e. - GH meshes).
Public methodUndo
Undo the last action
Public methodWrite3dmFile
Write information in this document to a .3dm file. Note, the active document's name will not be changed.
Public methodWriteFile
Write information in this document to a file. Note, the active document's name will be changed to that of the path provided.
Top
Events
  NameDescription
Public eventStatic memberActiveDocumentChanged
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.
Public eventStatic memberAddRhinoObject
Called if a new object is added to the document.
Public eventStatic memberCode exampleBeforeTransformObjects
Called before objects are being transformed
Public eventStatic memberBeginOpenDocument
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 eventStatic memberBeginSaveDocument
Public eventStatic memberCloseDocument
Public eventStatic memberDeleteRhinoObject
Called if an object is deleted. At some later point the object can be un-deleted.
Public eventStatic memberDeselectAllObjects
Called when all objects are deselected.
Public eventStatic memberDeselectObjects
Called when object(s) are deselected.
Public eventStatic memberDimensionStyleTableEvent
Called when any modification happens to a document's dimension style table.
Public eventStatic memberDocumentPropertiesChanged
Public eventStatic memberEndOpenDocument
Public eventStatic memberEndOpenDocumentInitialViewUpdate
This event is raised after EndOpenDocument when the documents initial views have been created and initialized.
Public eventStatic memberEndSaveDocument
Public eventStatic memberGroupTableEvent
Called when any modification happens to a document's group table.
Public eventStatic memberInstanceDefinitionTableEvent
Called when any modification happens to a document's instance definition table.
Public eventStatic memberLayerTableEvent
Called when any modification happens to a document's layer table.
Public eventStatic memberLightTableEvent
Called when any modification happens to a document's light table.
Public eventStatic memberLinetypeTableEvent
Called when any modification happens to a document's linetype table.
Public eventStatic memberMaterialTableEvent
Called when any modification happens to a document's material table.
Public eventStatic memberModifyObjectAttributes
Called when all object attributes are changed.
Public eventStatic memberNewDocument
Public eventStatic memberPurgeRhinoObject
Called if an object is being purged from a document. The object will cease to exist forever.
Public eventStatic memberRenderEnvironmentTableEvent
Public eventStatic memberRenderMaterialsTableEvent
Public eventStatic memberRenderTextureTableEvent
Called when the RenderTextureTable has been loaded, is about to be cleared or has been cleared. See RhinoDocRenderContentTableEventType for more information.
Public eventStatic memberReplaceRhinoObject
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 eventStatic memberSelectObjects
Called when object(s) are selected.
Public eventStatic memberTextureMappingEvent
Called when any modification happens to a document objects texture mapping.
Public eventStatic memberUndeleteRhinoObject
Called if an object is un-deleted.
Public eventStatic memberUnitsChangedWithScaling
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 eventStatic memberUserStringChanged
This event is raised when document user text strings are changed
Top
See Also