2022 Class
Changes 8
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
    Autodesk.Revit.DB.Macros.DocumentEntryPoint
public class Document : IDisposable
Name Return Type Description
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 DocumentSavedAs event Subscribe to the DocumentSavedAs event to be notified immediately after Revit has finished saving document with a new file name.
E DocumentSaved event Subscribe to the DocumentSaved event to be notified immediately after Revit has finished saving 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 DocumentSaving event Subscribe to the DocumentSaving event to be notified when Revit is just about to save a document.
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
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() bool Checks if cloud worksharing can be enabled for the cloud model.
M CanEnableWorksharing() bool Checks if worksharing can be enabled in the document.
M Close() bool Closes the document, save the changes if there are.
M Close(Boolean) bool 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
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) bool Determines whether the specified equals to this .
M EraseSchemaAndAllEntities(Schema) None Erases Schema and all its Entities from the document.
M ExportImage(ImageExportOptions) None Exports a view or set of views into an image file.
M Export(String, IList<ElementId>, PDFExportOptions) bool Exports a selection of views in PDF format.
M Export(String, String, GBXMLExportOptions) bool Export the model in gbXML (green-building) format.
M Export(String, String, ICollection<ElementId>, DGNExportOptions) bool Exports a selection of views in DGN format.
M Export(String, String, ICollection<ElementId>, DWGExportOptions) bool Exports a selection of views in DWG format.
M Export(String, String, ICollection<ElementId>, DXFExportOptions) bool Exports a selection of views in DXF format.
M Export(String, String, ICollection<ElementId>, SATExportOptions) bool Exports the current view or a selection of views in SAT format.
M Export(String, String, IFCExportOptions) bool Exports the document to the Industry Standard Classes (IFC) format.
M Export(String, String, MassGBXMLExportOptions) None Exports a gbXML file from a mass model document.
M Export(String, String, NavisworksExportOptions) None Exports a Revit project to the Navisworks .nwc format.
M Export(String, String, STLExportOptions) bool Exports the document to the STL format.
M Export(String, String, ViewSet, DWFExportOptions) bool Exports the current view or a selection of views in DWF format.
M Export(String, String, ViewSet, DWFXExportOptions) bool Exports the current view or a selection of views in DWFX format.
M Export(String, String, ViewSet, FBXExportOptions) bool Exports the document in 3D-Studio Max (FBX) format.
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() The preview settings. 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() int Gets the hash code of this document instance.
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(ElementId, Int32) Subelement Gets the subelement referenced by a parent id and subelement id.
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 GetTypeOfStorage(ForgeTypeId) StorageType Get the storage type of the identified built-in parameter.
M GetUnits() The Units object. Gets the Units object.
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() bool Returns whether the model in the current session is up to date with central.
M Import(String, DGNImportOptions, View, ElementId%) bool Imports a DGN file to the document.
M Import(String, DWGImportOptions, View, ElementId%) bool Imports a DWG or DXF file to the document.
M Import(String, GBXMLImportOptions) bool Imports a Green-Building XML file into the document.
M Import(String, ImportOptions3DM, View) ElementId Imports a 3DM 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 IsBackgroundCalculationInProgress() bool Indicates whether there are any background calculations in progress for this document.
M IsDefaultElementTypeIdValid(ElementTypeGroup, ElementId) bool Checks whether the element type id is valid for the give DefaultElmentType id.
M IsDefaultFamilyTypeIdValid(ElementId, ElementId) bool Checks whether the family type id is valid for the give family category.
M IsPainted(ElementId, Face) bool Checks if the element's face is painted with a material.
M Link(String, DGNImportOptions, View, ElementId%) bool Links a DGN file into the project document.
M Link(String, DWFImportOptions) IList<ElementId> Links Markups in a DWF file into the project document.
M Link(String, DWGImportOptions, View, ElementId%) bool Links a DWG or DXF file into the project document.
M Link(String, ImportOptions3DM, View) ElementId Links a 3DM 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 LoadFamily(Document) Family Loads the contents of this family document into another document.
M LoadFamily(Document, IFamilyLoadOptions) Family Loads the contents of this family document into another document.
M LoadFamily(String) bool Loads an entire family and all its types/symbols into the document.
M LoadFamily(String, Family%) bool 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%) bool Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family.
M LoadFamilySymbol(String, String) bool Loads only a specified family type/symbol from a family file into the document.
M LoadFamilySymbol(String, String, FamilySymbol%) bool 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%) bool 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 NewAreaBoundaryConditions(Element, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) nullNothingnullptr Creates a new Area BoundaryConditions element on a host element.
M NewAreaBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) nullNothingnullptr Creates a new Area BoundaryConditions element on a reference.
M NewAreaBoundaryLine(SketchPlane, Curve, ViewPlan) ModelCurve Creates a new boundary line as an Area border.
M NewArea(ViewPlan, UV) Area Creates a new area
M NewAreas(List<AreaCreationData>) ElementSet Creates new areas
M NewAreaTag(ViewPlan, Area, UV) AreaTag Creates a new area tag.
M NewCrossFitting(Connector, Connector, Connector, Connector) FamilyInstance Add a new family instance of a cross fitting into the Autodesk Revit document, using four connectors.
M NewCurtainSystem2(ReferenceArray, CurtainSystemType) ICollection<ElementId> Creates a new CurtainSystem element from a set of face references.
M NewCurtainSystem(FaceArray, CurtainSystemType) CurtainSystem Creates a new CurtainSystem element from a set of faces.
M NewElbowFitting(Connector, Connector) FamilyInstance Add a new family instance of an elbow fitting into the Autodesk Revit document, using two connectors.
M NewExtrusionRoof(CurveArray, ReferencePlane, Level, RoofType, Double, Double) ExtrusionRoof Creates a new Extrusion Roof.
M NewFamilyInstance(Curve, FamilySymbol, Level, StructuralType) nullNothingnullptr Inserts a new instance of a family into the document, using a curve, type/symbol and reference level.
M NewFamilyInstance(XYZ, FamilySymbol, Element, Level, StructuralType) nullNothingnullptr Inserts a new instance of a family into the document, using a location, type/symbol, the host element and a base level.
M NewFamilyInstance(XYZ, FamilySymbol, Level, StructuralType) nullNothingnullptr Inserts a new instance of a family into the document, using a location, type/symbol and a base level.
M NewFascia(FasciaType, Reference) nullNothingnullptr Creates a fascia along a reference.
M NewFascia(FasciaType, ReferenceArray) nullNothingnullptr Creates a fascia along a reference array.
M NewFlexDuct(Connector, Connector, FlexDuctType) FlexDuct Adds a new flexible duct into the document, using two connector, and duct type.
M NewFlexDuct(Connector, IList<XYZ>, FlexDuctType) FlexDuct Adds a new flexible duct into the document, using a connector, point array and duct type.
M NewFlexDuct(IList<XYZ>, FlexDuctType) FlexDuct Adds a new flexible duct into the document, using a point array and duct type.
M NewFlexPipe(Connector, Connector, FlexPipeType) FlexPipe Adds a new flexible pipe into the document, using two connector, and flexible pipe type.
M NewFlexPipe(Connector, IList<XYZ>, FlexPipeType) FlexPipe Adds a new flexible pipe into the document, using a connector, point array and pipe type.
M NewFlexPipe(IList<XYZ>, FlexPipeType) FlexPipe Adds a new flexible pipe into the document, using a point array and pipe type.
M NewFloor(CurveArray, Boolean) nullNothingnullptr Creates a floor within the project with the given horizontal profile using the default floor style.
M NewFloor(CurveArray, FloorType, Level, Boolean) nullNothingnullptr Creates a floor within the project with the given horizontal profile and floor style on the specified level.
M NewFloor(CurveArray, FloorType, Level, Boolean, XYZ) nullNothingnullptr Creates a floor within the project with the given horizontal profile and floor style on the specified level with the specified normal vector.
M NewFootPrintRoof(CurveArray, Level, RoofType, ModelCurveArray%) FootPrintRoof Creates a new FootPrintRoof element.
M NewFoundationSlab(CurveArray, FloorType, Level, Boolean, XYZ) nullNothingnullptr Creates a foundation slab within the project with the given horizontal profile and floor style on the specified level.
M NewGutter(GutterType, Reference) nullNothingnullptr Creates a gutter along a reference.
M NewGutter(GutterType, ReferenceArray) nullNothingnullptr Creates a gutter along a reference array.
M NewLineBoundaryConditions(Element, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) nullNothingnullptr Creates a new Line BoundaryConditions element on a host element.
M NewLineBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) nullNothingnullptr Creates a new Line BoundaryConditions element on a reference.
M NewMechanicalSystem(Connector, ConnectorSet, DuctSystemType) MechanicalSystem Creates a new MEP mechanical system element.
M NewOpening(Element, CurveArray, Boolean) Opening Creates a new opening in a roof, floor and ceiling.
M NewOpening(Element, CurveArray, eRefFace) Opening Creates a new opening in a beam, brace and column.
M NewOpening(Level, Level, CurveArray) Opening Creates a new shaft opening between a set of levels.
M NewOpening(Wall, XYZ, XYZ) Opening Creates a rectangular opening on a wall.
M NewPipingSystem(Connector, ConnectorSet, PipeSystemType) PipingSystem Creates a new MEP piping system element.
M NewPointBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) nullNothingnullptr Creates a new Point BoundaryConditions Element.
M NewRoomBoundaryLines(SketchPlane, CurveArray, View) ModelCurveArray Creates a new boundary line as an Room border.
M NewRoom(Level, UV) nullNothingnullptr Creates a new room on a level at a specified point.
M NewRoom(Phase) nullNothingnullptr Creates a new unplaced room and with an assigned phase.
M NewRoom(Room, PlanCircuit) nullNothingnullptr Creates a new room within the confines of a plan circuit, or places an unplaced room within the confines of the plan circuit.
M NewRooms2(Level) nullNothingnullptr Creates new rooms in each plan circuit found in the given level in the last phase.
M NewRooms2(Level, Phase) ICollection<ElementId> Creates new rooms in each plan circuit found in the given level in the given phase.
M NewRooms2(Phase, Int32) ICollection<ElementId> Creates new unplaced rooms in the given phase.
M NewRoomTag(LinkElementId, UV, ElementId) nullNothingnullptr Creates a new RoomTag referencing a room in the host model or in a Revit link.
M NewSlabEdge(SlabEdgeType, Reference) nullNothingnullptr Creates a slab edge along a reference.
M NewSlabEdge(SlabEdgeType, ReferenceArray) nullNothingnullptr Creates a slab edge along a reference array.
M NewSlab(CurveArray, Level, Line, Double, Boolean) nullNothingnullptr Creates a slab within the project with the given horizontal profile using the default floor style.
M NewSpaceBoundaryLines(SketchPlane, CurveArray, View) ModelCurveArray Creates a new boundary line as an Space border.
M NewSpace(Level, Phase, UV) nullNothingnullptr Creates a new space element on the given level, at the given location, and assigned to the given phase.
M NewSpace(Level, UV) nullNothingnullptr Creates a new space element on the given level at the given location.
M NewSpace(Phase) nullNothingnullptr Creates a new unplaced space on a given phase.
M NewSpaces2(Level, Phase, View) ICollection<ElementId> Creates new spaces on the available plan circuits of a the given level.
M NewSpaces2(Phase, Int32) nullNothingnullptr Creates a set of new unplaced spaces on a given phase.
M NewSpaceTag(Space, UV, View) nullNothingnullptr Creates a new SpaceTag.
M NewSpotCoordinate(View, Reference, XYZ, XYZ, XYZ, XYZ, Boolean) nullNothingnullptr Generate a new spot coordinate object within the project.
M NewSpotElevation(View, Reference, XYZ, XYZ, XYZ, XYZ, Boolean) nullNothingnullptr Generate a new spot elevation object within the project.
M NewTakeoffFitting(Connector, MEPCurve) FamilyInstance Add a new family instance of an takeoff fitting into the Autodesk Revit document, using one connector and one MEP curve.
M NewTeeFitting(Connector, Connector, Connector) FamilyInstance Add a new family instance of a tee fitting into the Autodesk Revit document, using three connectors.
M NewTransitionFitting(Connector, Connector) FamilyInstance Add a new family instance of an transition fitting into the Autodesk Revit document, using two connectors.
M NewUnionFitting(Connector, Connector) FamilyInstance Add a new family instance of an union fitting into the Autodesk Revit document, using two connectors.
M NewZone(Level, Phase) nullNothingnullptr Creates a new Zone element.
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, Boolean) 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, 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 SaveAsCloudModel(Guid, Guid, String, String) None Saves current non-workshared or workshared model as a cloud model or workshared cloud model in BIM 360 Docs or Autodesk Docs.
M SaveAs(ModelPath, SaveAsOptions) None Saves the document to a given path.
M SaveAs(String) None Saves the document to a given file path.
M SaveAs(String, SaveAsOptions) None Saves the document to a given file path.
M SaveCloudModel() None Saves cloud model.
M Save() None Saves the document.
M Save(SaveOptions) None Saves the document.
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 UnpostFailure(FailureMessageKey) None Deletes the posted failure message associated with a given FailureMessageKey.
Name Return Type Description
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 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
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 The document's state of modifiability.
P IsModified bool The state of changes made to the document.
P IsReadOnlyFile bool Signals whether the document was opened from a read-only file.
P IsReadOnly bool Identifies if the document is read-only or can possibly be modified.
P IsValidObject bool 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
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 PlanTopologySet Gets the PlanTopologies of the current project in a given phase.
P PlanTopology PlanTopology Get the PlanTopology of a given level in the last phase.
P PlanTopology 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.