Skip to content

Document

Public Class

An object that represents an open Autodesk Revit project.

Inheritance Hierarchy

System.Object
Autodesk.Revit.DB.Document

Namespace: Autodesk.Revit.DB

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public class Document : IDisposable

The Document type exposes the following members.

Properties

Name

Description


Public Property
ActiveProjectLocation

Retrieve the active project location.


Public Property
Code Example

The document’s active view.


Public Property

Returns the Application in which the Document resides.


Public Property

An object that can be used to create new instances of Autodesk Revit API elements within a project.


Public Property

A unique identifier generated when the Document was first created.


Public Property
DisplayUnitSystem

Provides access to display unit type with in the document.


Public Property

An object that can be used to create new instances of Autodesk Revit API elements within a family document.


Public Property
FamilyManager

The family manager object provides access to family types and parameters.


Public Property
IsDetached

Identifies if a workshared document is detached. Also, see


Public Property

Identifies if the current document is a family document.


Public Property

Identifies if a document is a linked RVT.


Public Property

Identifies if document is stored on Autodesk cloud services.


Public Property
IsModifiable

Identifies if the document is modifiable.


Public Property

The state of changes made to the document.


Public Property
IsReadOnly

Identifies if the document is read-only or can possibly be modified.


Public Property
IsReadOnlyFile

Signals whether the document was opened from a read-only file.


Public Property
IsValidObject

Specifies whether the .NET object represents a valid Revit entity.


Public Property

Identifies if worksharing (i.e. editing permissions and multiple worksets) have been enabled in the document. Also, see IsDetached


Public Property
MassDisplayTemporaryOverride

This setting controls temporary display in views of objects with mass category or subcategories.


Public Property
MullionTypes

This property is used to retrieve all the mullion types in current system.


Public Property
Code Example
OwnerFamily

Get the Family of this Family Document.


Public Property
PanelTypes

Retrieves a set of PanelType objects that contains all the panel types that are currently loaded into the project.


Public Property
ParameterBindings

Retrieves an object from which mappings between parameter definitions and categories can be found.


Public Property
Code Example
PathName

The fully qualified path of the document’s disk file.


Public Property
Code Example
Phases

Retrieves all of the phases in the document.


Public Property
PlanTopologies

Get the PlanTopologies of the current project in the last phase.


Public Property
PlanTopologies.Phase.

Gets the PlanTopologies of the current project in a given phase.


Public Property
PlanTopology.Level.

Get the PlanTopology of a given level in the last phase.


Public Property
PlanTopology.Level, Phase.

Get the PlanTopology of a given level in a given phase.


Public Property

Retrieve the PrintManager of current project.


Public Property

Return the Project Information of the current project.


Public Property
ProjectLocations

Retrieve all the project locations associated with this project


Public Property
ReactionsAreUpToDate

Reports if the analytical model has regenerated in a document with reaction loads.


Public Property
Settings

Provides access to general application settings, such as Categories.


Public Property
SiteLocation

Returns the site location information.


Public Property
Title

The document’s title.


Public Property

Get the storage type of the specified BuiltInParameter.


Public Property
WorksharingCentralGUID

The central GUID of the server-based model.


Methods

Name

Description


Public Method
AcquireCoordinates

Acquires coordinates from the specified link instance.


Public Method
AutoJoinElements

Forces the elements in the Revit document to automatically join to their neighbors where appropriate.


Public Method

Checks if cloud worksharing can be enabled for the cloud model.


Public Method

Checks if worksharing can be enabled in the document.


Public Method
Close.

Closes the document, save the changes if there are.


Public Method
Close(Boolean)

Closes the document with the option to save.


Public Method
CombineElements

Combine a set of combinable elements into a geometry combination.


Public Method
ConvertDetailToModelCurves

Converts a group of DetailCurves to equivalent ModelCurves.


Public Method
ConvertModelToDetailCurves

Converts a group of ModelCurves to equivalent DetailCurves.


Public Method
ConvertModelToSymbolicCurves

Converts a group of ModelCurves to equivalent SymbolicCurves.


Public Method
ConvertSymbolicToModelCurves

Converts a group of SymbolicCurves to equivalent ModelCurves.


Public Method
Code Example
Delete(ElementId)

Deletes an element from the document given the id of that element.


Public Method
Code Example
Delete(ICollection.ElementId.)

Deletes a set of elements from the document.


Public Method

Releases all resources used by the Document


Public Method
Code Example
EditFamily

Gets the document of a loaded family to edit.


Public Method
EnableCloudWorksharing

Enables cloud worksharing for a cloud model


Public Method
EnableWorksharing

Enables worksharing in the document.


Public Method
Equals

Determines whether the specified Object equals to this Object.
(Overrides Object.Equals(Object))


Public Method
EraseSchemaAndAllEntities

Erases Schema and all its Entities from the document.


Public Method

Exports a selection of views in PDF format.


Public Method
Export(String, String, GBXMLExportOptions)

Export the model in gbXML (green-building) format.


Public Method
Export(String, String, IFCExportOptions)

Exports the document to the Industry Standard Classes (IFC) format.


Public Method
Export(String, String, NavisworksExportOptions)

Exports a Revit project to the Navisworks .nwc format.


Public Method

Exports a view specified in the export options to the OBJ format.


Public Method
Export(String, String, STEPExportOptions)

Exports the current view or a selection of views in STEP format.


Public Method

Exports a view specified in the export options to the STL format.


Public Method
Code Example
Export(String, String, ViewSet, DWFExportOptions)

Exports the current view or a selection of views in DWF format.


Public Method
Export(String, String, ViewSet, DWFXExportOptions)

Exports the current view or a selection of views in DWFX format.


Public Method
Export(String, String, ViewSet, FBXExportOptions)

Exports the document in 3D-Studio Max (FBX) format.


Public Method
Code Example
Export(String, String, ICollection.ElementId., DGNExportOptions)

Exports a selection of views in DGN format.


Public Method
Code Example
Export(String, String, ICollection.ElementId., DWGExportOptions)

Exports a selection of views in DWG format.


Public Method
Export(String, String, ICollection.ElementId., DXFExportOptions)

Exports a selection of views in DXF format.


Public Method
Export(String, String, ICollection.ElementId., SATExportOptions)

Exports the current view or a selection of views in SAT format.


Public Method

Exports a view or set of views into an image file.


Public Method
Code Example
GetAllUnusedElements

Returns the list of element ids that are not used. The list of unused element ids may include elements that can’t be deleted.


Public Method
Code Example

Extracts a collection containing the ids of elements that have been created, modified or deleted between the input baseVersion and the document’s current version.


Public Method
GetCloudFolderId

Gets ForgeDM folder id where the model locates.


Public Method

Gets the cloud model path of the cloud model.


Public Method
GetCloudModelUrn

A ForgeDM Urn identifying the model.


Public Method
Code Example

Gets the default element type id with the given DefaultElementType id.


Public Method
Code Example

Gets the default family type id with the given family category id.


Public Method

Returns the preview settings for the given document.


Public Method
Static Member
GetDocumentVersion

Gets the DocumentVersion that corresponds to a document.


Public Method
GetElement(ElementId)

Gets the Element referenced by the input ElementId.


Public Method
GetElement(Reference)

Gets the Element referenced by the input reference.


Public Method
GetElement(String)

Gets the Element referenced by a unique id string.


Public Method
GetHashCode

Gets the hash code of this document instance.
(Overrides Object.GetHashCode.)


Public Method
GetHubId

Gets ForgeDM hub id where the model locates. It is cached in session.


Public Method

Get the material painted on the element’s face. Returns invalidElementId if the face is not painted.


Public Method

Retrieves all Print Settings of current project.


Public Method
GetProjectId

Gets ForgeDM project id where the model locates.


Public Method
GetRoomAtPoint(XYZ)

Gets a room containing the point.


Public Method
GetRoomAtPoint(XYZ, Phase)

Gets a room containing the point.


Public Method
GetSpaceAtPoint(XYZ)

Gets a space containing the point.


Public Method
GetSpaceAtPoint(XYZ, Phase)

Gets a space containing the point.


Public Method

Gets the subelement referenced by the input reference.


Public Method
GetSubelement(String)

Gets the subelement referenced by a unique id string.


Public Method
GetSubelement(ElementId, Int32)

Gets the subelement referenced by a parent id and subelement id.


Public Method

GetType

Gets the Type of the current instance.
(Inherited from Object)


Public Method

Get the storage type of the identified built-in parameter.


Public Method

Gets the Units object.


Public Method
Code Example
GetUnusedElements

Returns the list of element ids that are not used and can be deleted from the document.


Public Method
GetWarnings

Returns list of failure messages generated from persistent (reviewable) warnings accumulated in the document.


Public Method
GetWorksetId

Get Id of the Workset which owns the element.


Public Method
GetWorksetTable

Get the WorksetTable of this document.


Public Method

Gets the central model path of the worksharing model.


Public Method
Code Example

Returns whether the model in the current session is up to date with central.


Public Method
Import(String, GBXMLImportOptions)

Imports a Green-Building XML file into the document.


Public Method

Imports an AXM file into the document.


Public Method

Imports a 3DM file into the document.


Public Method

Imports an OBJ file into the document.


Public Method

Imports an SAT file into the document.


Public Method

Imports a SKP file into the document.


Public Method

Imports a STEP file into the document.


Public Method

Imports an STL file into the document.


Public Method

Imports a DGN file to the document.


Public Method

Imports a DWG or DXF file to the document.


Public Method
IsBackgroundCalculationInProgress

Indicates whether there are any background calculations in progress for this document.


Public Method

Checks whether the element type id is valid for the give DefaultElmentType id.


Public Method

Checks whether the family type id is valid for the give family category.


Public Method

Checks if the element’s face is painted with a material.


Public Method
Static Member

Checks whether the GUID is valid for the given document. Empty GUID is allowed.


Public Method
Link(String, DWFImportOptions)

Links Markups in a DWF file into the project document.


Public Method
Link(String, ImportOptions3DM, View)

Links a 3DM file into the project document.


Public Method
Link(String, OBJImportOptions, View)

Links an OBJ file into the project document.


Public Method
Link(String, SATImportOptions, View)

Links an SAT file into the project document.


Public Method
Link(String, SKPImportOptions, View)

Links a SKP file into the project document.


Public Method
Link(String, STEPImportOptions, View)

Links an STEP file into the project document.


Public Method
Link(String, STLImportOptions, View)

Links an STL file into the project document.


Public Method
Link(String, DGNImportOptions, View, ElementId.)

Links a DGN file into the project document.


Public Method
Link(String, DWGImportOptions, View, ElementId.)

Links a DWG or DXF file into the project document.


Public Method
LoadFamily(Document)

Loads the contents of this family document into another document.


Public Method
LoadFamily(String)

Loads an entire family and all its types/symbols into the document.


Public Method
LoadFamily(Document, IFamilyLoadOptions)

Loads the contents of this family document into another document.


Public Method
Code Example
LoadFamily(String, Family.)

Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family.


Public Method
LoadFamily(String, IFamilyLoadOptions, Family.)

Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family.


Public Method
LoadFamilySymbol(String, String)

Loads only a specified family type/symbol from a family file into the document.


Public Method
LoadFamilySymbol(String, String, FamilySymbol.)

Loads only the specified family type/symbol from a family file into the document and provides a reference to the loaded family symbol.


Public Method
LoadFamilySymbol(String, String, IFamilyLoadOptions, FamilySymbol.)

Loads only the specified family type/symbol from a family file into the document and provides a reference to the loaded family symbol.


Public Method
MakeTransientElements

This method encapsulates the process of creating transient elements in the document.


Public Method
Code Example

Paint the element’s face with specified material.


Public Method
Code Example

Paint the element’s face with specified material.


Public Method
Code Example
PostFailure

Posts a failure to be displayed to the user at the end of transaction.


Public Method
Print(ViewSet)

Prints a set of views with default view template and default print settings.


Public Method
Print(ViewSet, View)

Prints a set of views with a specified view template and default print settings.


Public Method
Print(ViewSet, Boolean)

Prints a set of views with default view template and default print settings.


Public Method
Print(ViewSet, View, Boolean)

Prints a set of views with a specified view template and default print settings.


Public Method
PublishCoordinates

Publish coordinates to the specified ProjectLocation of the link instance.


Public Method
Code Example
Regenerate

Updates the elements in the Revit document to reflect all changes.


Public Method
Code Example
ReloadLatest

Fetches changes from central (due to one or more synchronizations with central) and merges them into the current session.


Public Method

Remove the material painted on the element’s face. If the face is currently not painted,it will do nothing.


Public Method
ResetSharedCoordinates

Reset shared coordinates for the host model/file.


Public Method
Save.

Saves the document.


Public Method
Save(SaveOptions)

Saves the document.


Public Method
SaveAs(String)

Saves the document to a given file path.


Public Method
SaveAs(ModelPath, SaveAsOptions)

Saves the document to a given path.


Public Method
Code Example
SaveAs(String, SaveAsOptions)

Saves the document to a given file path.


Public Method
SaveAsCloudModel

Saves current non-workshared or workshared model as a cloud model or workshared cloud model in BIM 360 Docs or Autodesk Docs.


Public Method

Saves cloud model.


Public Method

Creates an image view from the currently active view.


Public Method
SeparateElements

Separate a set of combinable elements out of combinations they currently belong to.


Public Method

Sets the default element type id of the given DefaultElementType id.


Public Method
Code Example

Sets the default family type id for the given family category.


Public Method

Sets the units.


Public Method
Code Example

Performs reload latest until the model in the current session is up to date and then saves changes back to central. A save to central is performed even if no changes were made.


Public Method

ToString

Returns a string that represents the current object.
(Inherited from Object)


Public Method
UnpostFailure

Deletes the posted failure message associated with a given FailureMessageKey.


Events

Name

Description


Public Event
DocumentClosing

Subscribe to the DocumentClosing event to be notified when Revit is just about to close a document.


Public Event
DocumentPrinted

Subscribe to the DocumentPrinted event to be notified immediately after Revit has finished printing a view or ViewSet of the document.


Public Event
DocumentPrinting

Subscribe to the DocumentPrinting event to be notified when Revit is just about to print a view or ViewSet of the document.


Public Event
DocumentSaved

Subscribe to the DocumentSaved event to be notified immediately after Revit has finished saving a document.


Public Event
DocumentSavedAs

Subscribe to the DocumentSavedAs event to be notified immediately after Revit has finished saving document with a new file name.


Public Event
DocumentSaving

Subscribe to the DocumentSaving event to be notified when Revit is just about to save a document.


Public Event
DocumentSavingAs

Subscribe to the DocumentSavingAs event to be notified when Revit is just about to save the document with a new file name.


Public Event
ViewPrinted

Subscribe to the ViewPrinted event to be notified immediately after Revit has finished printing a view of the document.


Public Event
ViewPrinting

Subscribe to the ViewPrinting event to be notified when Revit is just about to print a view of the document.


Remarks

The Document object represents an Autodesk Revit project. Revit can have multiple projects open and multiple views to those projects. The active or top most view will be the active project and hence the active document which is available from the Application object.