2027 Class
Changes 7
C

Document

Description:
An object that represents an open Autodesk Revit project.
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.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.Document
public class Document : IDisposable
Name Return Type Description Inherited From
E DocumentClosing event Subscribe to the DocumentClosing event to be notified when Revit is just about to close a document.
E DocumentPrinted event Subscribe to the DocumentPrinted event to be notified immediately after Revit has finished printing a view or ViewSet of the document.
E DocumentPrinting event Subscribe to the DocumentPrinting event to be notified when Revit is just about to print a view or ViewSet of the document.
E DocumentSaved event Subscribe to the DocumentSaved event to be notified immediately after Revit has finished saving a document.
E DocumentSavedAs event Subscribe to the DocumentSavedAs event to be notified immediately after Revit has finished saving document with a new file name.
E DocumentSaving event Subscribe to the DocumentSaving event to be notified when Revit is just about to save a document.
E DocumentSavingAs event Subscribe to the DocumentSavingAs event to be notified when Revit is just about to save the document with a new file name.
E ViewPrinted event Subscribe to the ViewPrinted event to be notified immediately after Revit has finished printing a view of the document.
E ViewPrinting event Subscribe to the ViewPrinting event to be notified when Revit is just about to print a view of the document.
Name Return Type Description Inherited From
M AcquireCoordinates(ElementId) None Acquires coordinates from the specified link instance.
M AutoJoinElements() None Forces the elements in the Revit document to automatically join to their neighbors where appropriate.
M CanEnableCloudWorksharing() Boolean Checks if cloud worksharing can be enabled for the cloud model.
M CanEnableWorksharing() Boolean Checks if worksharing can be enabled in the document.
M Close() Boolean Closes the document, save the changes if there are.
M Close(Boolean) Boolean Closes the document with the option to save.
M CombineElements(CombinableElementArray) GeomCombination Combine a set of combinable elements into a geometry combination.
M ConvertDetailToModelCurves(View, DetailCurveArray) ModelCurveArray Converts a group of DetailCurves to equivalent ModelCurves.
M ConvertModelToDetailCurves(View, ModelCurveArray) DetailCurveArray Converts a group of ModelCurves to equivalent DetailCurves.
M ConvertModelToSymbolicCurves(View, ModelCurveArray) SymbolicCurveArray Converts a group of ModelCurves to equivalent SymbolicCurves.
M ConvertSymbolicToModelCurves(View, SymbolicCurveArray) ModelCurveArray Converts a group of SymbolicCurves to equivalent ModelCurves.
M Delete(ElementId) ICollection<ElementId> Deletes an element from the document given the id of that element.
M Delete(ICollection<ElementId>) ICollection<ElementId> Deletes a set of elements from the document.
M Dispose() None Releases all resources used by the Document
M EditFamily(Family) Document Gets the document of a loaded family to edit.
M EnableCloudWorksharing() None Enables cloud worksharing for a cloud model
M EnableWorksharing(String, String) None Enables worksharing in the document.
M Equals(Object) Boolean Determines whether the specified Object equals to this Object . (Overrides Object . Equals(Object) )
M EraseSchemaAndAllEntities(Schema) None Erases Schema and all its Entities from the document.
M Export(String, IList<ElementId>, PDFExportOptions) Boolean Exports a selection of views in PDF format.
M Export(String, String, GBXMLExportOptions) Boolean Export the model in gbXML (green-building) format.
M Export(String, String, IFCExportOptions) Boolean Exports the document to the Industry Standard Classes (IFC) format.
M Export(String, String, NavisworksExportOptions) None Exports a Revit project to the Navisworks .nwc format.
M Export(String, String, OBJExportOptions) Boolean Exports a view specified in the export options to the OBJ format.
M Export(String, String, STEPExportOptions) Boolean Exports the current view or a selection of views in STEP format.
M Export(String, String, STLExportOptions) Boolean Exports a view specified in the export options to the STL format.
M Export(String, String, ViewSet, DWFExportOptions) Boolean Exports the current view or a selection of views in DWF format.
M Export(String, String, ViewSet, DWFXExportOptions) Boolean Exports the current view or a selection of views in DWFX format.
M Export(String, String, ViewSet, FBXExportOptions) Boolean Exports the document in 3D-Studio Max (FBX) format.
M Export(String, String, ICollection<ElementId>, DGNExportOptions) Boolean Exports a selection of views in DGN format.
M Export(String, String, ICollection<ElementId>, DWGExportOptions) Boolean Exports a selection of views in DWG format.
M Export(String, String, ICollection<ElementId>, DXFExportOptions) Boolean Exports a selection of views in DXF format.
M Export(String, String, ICollection<ElementId>, SATExportOptions) Boolean Exports the current view or a selection of views in SAT format.
M ExportImage(ImageExportOptions) None Exports a view or set of views into an image file.
M GetActiveEditMode() EditModeType Returns the document's active edit mode. Returns None if no edit mode is currently active.
M GetAllUnusedElements(ISet<ElementId>) ISet<ElementId> Returns the list of element ids that are not used. The list of unused element ids may include elements that can't be deleted.
M GetChangedElements(Guid) DocumentDifference 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.
M GetCloudFolderId(Boolean) String Gets ForgeDM folder id where the model locates.
M GetCloudModelPath() ModelPath Gets the cloud model path of the cloud model.
M GetCloudModelUrn() String A ForgeDM Urn identifying the model.
M GetDefaultElementTypeId(ElementTypeGroup) ElementId Gets the default element type id with the given DefaultElementType id.
M GetDefaultFamilyTypeId(ElementId) ElementId Gets the default family type id with the given family category id.
M GetDocumentPreviewSettings() DocumentPreviewSettings Returns the preview settings for the given document.
M GetDocumentVersion(Document) DocumentVersion Gets the DocumentVersion that corresponds to a document.
M GetElement(ElementId) Element Gets the Element referenced by the input ElementId.
M GetElement(Reference) Element Gets the Element referenced by the input reference.
M GetElement(String) Element Gets the Element referenced by a unique id string.
M GetHashCode() Int32 Gets the hash code of this document instance. (Overrides Object . GetHashCode () )
M GetHubId() String Gets ForgeDM hub id where the model locates. It is cached in session.
M GetPaintedMaterial(ElementId, Face) ElementId Get the material painted on the element's face. Returns invalidElementId if the face is not painted.
M GetPrintSettingIds() ICollection<ElementId> Retrieves all Print Settings of current project.
M GetProjectId() String Gets ForgeDM project id where the model locates.
M GetRoomAtPoint(XYZ) Room Gets a room containing the point.
M GetRoomAtPoint(XYZ, Phase) Room Gets a room containing the point.
M GetSpaceAtPoint(XYZ) Space Gets a space containing the point.
M GetSpaceAtPoint(XYZ, Phase) Space Gets a space containing the point.
M GetSubelement(Reference) Subelement Gets the subelement referenced by the input reference.
M GetSubelement(String) Subelement Gets the subelement referenced by a unique id string.
M GetSubelement(ElementId, Int32) Subelement Gets the subelement referenced by a parent id and subelement id.
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M GetTypeOfStorage(ForgeTypeId) StorageType Get the storage type of the identified built-in parameter.
M GetUnits() Units Gets the Units object.
M GetUnusedElements(ISet<ElementId>) ISet<ElementId> Returns the list of element ids that are not used and can be deleted from the document.
M GetWarnings() IList<FailureMessage> Returns list of failure messages generated from persistent (reviewable) warnings accumulated in the document.
M GetWorksetId(ElementId) WorksetId Get Id of the Workset which owns the element.
M GetWorksetTable() WorksetTable Get the WorksetTable of this document.
M GetWorksharingCentralModelPath() ModelPath Gets the central model path of the worksharing model.
M HasAllChangesFromCentral() Boolean Returns whether the model in the current session is up to date with central.
M Import(String, GBXMLImportOptions) Boolean Imports a Green-Building XML file into the document.
M Import(String, AXMImportOptions, View) ElementId Obsolete. Imports an AXM file into the document.
M Import(String, ImportOptions3DM, View) ElementId Imports a 3DM file into the document.
M Import(String, OBJImportOptions, View) ElementId Imports an OBJ file into the document.
M Import(String, SATImportOptions, View) ElementId Imports an SAT file into the document.
M Import(String, SKPImportOptions, View) ElementId Imports a SKP file into the document.
M Import(String, STEPImportOptions, View) ElementId Imports a STEP file into the document.
M Import(String, STLImportOptions, View) ElementId Imports an STL file into the document.
M Import(String, DGNImportOptions, View, ElementId%) Boolean Imports a DGN file to the document.
M Import(String, DWGImportOptions, View, ElementId%) Boolean Imports a DWG or DXF file to the document.
M IsBackgroundCalculationInProgress() Boolean Indicates whether there are any background calculations in progress for this document.
M IsDefaultElementTypeIdValid(ElementTypeGroup, ElementId) Boolean Checks whether the element type id is valid for the give DefaultElmentType id.
M IsDefaultFamilyTypeIdValid(ElementId, ElementId) Boolean Checks whether the family type id is valid for the give family category.
M IsInEditMode() Boolean Indicates if the document is in an edit mode.
M IsPainted(ElementId, Face) Boolean Checks if the element's face is painted with a material.
M IsValidVersionGUID(Document, Guid) Boolean Checks whether the GUID is valid for the given document. Empty GUID is allowed.
M Link(String, DWFImportOptions) IList<ElementId> Links Markups in a DWF file into the project document.
M Link(String, ImportOptions3DM, View) ElementId Links a 3DM file into the project document.
M Link(String, OBJImportOptions, View) ElementId Links an OBJ file into the project document.
M Link(String, SATImportOptions, View) ElementId Links an SAT file into the project document.
M Link(String, SKPImportOptions, View) ElementId Links a SKP file into the project document.
M Link(String, STEPImportOptions, View) ElementId Links an STEP file into the project document.
M Link(String, STLImportOptions, View) ElementId Links an STL file into the project document.
M Link(String, DGNImportOptions, View, ElementId%) Boolean Links a DGN file into the project document.
M Link(String, DWGImportOptions, View, ElementId%) Boolean Links a DWG or DXF file into the project document.
M LoadFamily(Document) Family Loads the contents of this family document into another document.
M LoadFamily(String) Boolean Loads an entire family and all its types/symbols into the document.
M LoadFamily(Document, IFamilyLoadOptions) Family Loads the contents of this family document into another document.
M LoadFamily(String, Family%) Boolean Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family.
M LoadFamily(String, IFamilyLoadOptions, Family%) Boolean Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family.
M LoadFamilySymbol(String, String) Boolean Loads only a specified family type/symbol from a family file into the document.
M LoadFamilySymbol(String, String, FamilySymbol%) Boolean Loads only the specified family type/symbol from a family file into the document and provides a reference to the loaded family symbol.
M LoadFamilySymbol(String, String, IFamilyLoadOptions, FamilySymbol%) Boolean Loads only the specified family type/symbol from a family file into the document and provides a reference to the loaded family symbol.
M MakeTransientElements(ITransientElementMaker) None This method encapsulates the process of creating transient elements in the document.
M Paint(ElementId, Face, ElementId) None Paint the element's face with specified material.
M Paint(ElementId, Face, FamilyParameter) None Paint the element's face with specified material.
M PostFailure(FailureMessage) FailureMessageKey Posts a failure to be displayed to the user at the end of transaction.
M Print(ViewSet) None Prints a set of views with default view template and default print settings.
M Print(ViewSet, View) None Prints a set of views with a specified view template and default print settings.
M Print(ViewSet, Boolean) None Prints a set of views with default view template and default print settings.
M Print(ViewSet, View, Boolean) None Prints a set of views with a specified view template and default print settings.
M PublishCoordinates(LinkElementId) None Publish coordinates to the specified ProjectLocation of the link instance.
M Regenerate() None Updates the elements in the Revit document to reflect all changes.
M ReloadLatest(ReloadLatestOptions) None Fetches changes from central (due to one or more synchronizations with central) and merges them into the current session.
M RemovePaint(ElementId, Face) None Remove the material painted on the element's face. If the face is currently not painted,it will do nothing.
M ResetSharedCoordinates() None Reset shared coordinates for the host model/file.
M Save() None Saves the document.
M Save(SaveOptions) None Saves the document.
M SaveAs(String) None Saves the document to a given file path.
M SaveAs(ModelPath, SaveAsOptions) None Saves the document to a given path.
M SaveAs(String, SaveAsOptions) None Saves the document to a given file path.
M SaveAsCloudModel(Guid, Guid, String, String) None Saves current non-workshared or workshared model as a cloud model or workshared cloud model.
M SaveCloudModel() None Saves cloud model.
M SaveToProjectAsImage(ImageExportOptions) ElementId Creates an image view from the currently active view.
M SeparateElements(CombinableElementArray) None Separate a set of combinable elements out of combinations they currently belong to.
M SetDefaultElementTypeId(ElementTypeGroup, ElementId) None Sets the default element type id of the given DefaultElementType id.
M SetDefaultFamilyTypeId(ElementId, ElementId) None Sets the default family type id for the given family category.
M SetUnits(Units) None Sets the units.
M SynchronizeWithCentral(TransactWithCentralOptions, SynchronizeWithCentralOptions) None 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.
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
M UnpostFailure(FailureMessageKey) None Deletes the posted failure message associated with a given FailureMessageKey.
Name Return Type Description Inherited From
P ActiveProjectLocation ProjectLocation Retrieve the active project location.
P ActiveView View The document's active view.
P Application Application Returns the Application in which the Document resides.
P Create Document An object that can be used to create new instances of Autodesk Revit API elements within a project.
P CreationGUID Guid A unique identifier generated when the Document was first created.
P DisplayUnitSystem DisplayUnit Provides access to display unit type with in the document.
P FamilyCreate FamilyItemFactory An object that can be used to create new instances of Autodesk Revit API elements within a family document.
P FamilyManager FamilyManager The family manager object provides access to family types and parameters.
P IsDetached bool Identifies if a workshared document is detached. Also, see IsWorkshared
P IsFamilyDocument bool Identifies if the current document is a family document.
P IsLinked bool Identifies if a document is a linked RVT.
P IsModelInCloud bool Identifies if document is stored on Autodesk cloud services.
P IsModifiable bool Identifies if the document is modifiable.
P IsModified bool The state of changes made to the document.
P IsReadOnly bool Identifies if the document is read-only or can possibly be modified.
P IsReadOnlyFile bool Signals whether the document was opened from a read-only file.
P IsValidObject Boolean Specifies whether the .NET object represents a valid Revit entity.
P IsWorkshared bool Identifies if worksharing (i.e. editing permissions and multiple worksets) have been enabled in the document. Also, see IsDetached
P MassDisplayTemporaryOverride MassDisplayTemporaryOverrideType This setting controls temporary display in views of objects with mass category or subcategories.
P MullionTypes MullionTypeSet This property is used to retrieve all the mullion types in current system.
P OwnerFamily Family Get the Family of this Family Document.
P PanelTypes PanelTypeSet Retrieves a set of PanelType objects that contains all the panel types that are currently loaded into the project.
P ParameterBindings BindingMap Retrieves an object from which mappings between parameter definitions and categories can be found.
P PathName string The fully qualified path of the document's disk file.
P Phases PhaseArray Retrieves all of the phases in the document.
P PlanTopologies PlanTopologySet Get the PlanTopologies of the current project in the last phase.
P PlanTopologies[Phase] PlanTopologySet Gets the PlanTopologies of the current project in a given phase.
P PlanTopology[Level] PlanTopology Get the PlanTopology of a given level in the last phase.
P PlanTopology[Level, Phase] PlanTopology Get the PlanTopology of a given level in a given phase.
P PrintManager PrintManager Retrieve the PrintManager of current project.
P ProjectInformation ProjectInfo Return the Project Information of the current project.
P ProjectLocations ProjectLocationSet Retrieve all the project locations associated with this project
P ReactionsAreUpToDate bool Reports if the analytical model has regenerated in a document with reaction loads.
P Settings Settings Provides access to general application settings, such as Categories.
P SiteLocation SiteLocation Returns the site location information.
P Title string The document's title.
P TypeOfStorage StorageType Get the storage type of the specified BuiltInParameter.
P WorksharingCentralGUID Guid The central GUID of the server-based model.