Document
Description:
An object that represents an open Autodesk Revit project.
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.
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
System.Object
Autodesk.Revit.DB.Document
Autodesk.Revit.DB.Macros.DocumentEntryPoint
public class Document : IDisposable
| Name | Return Type | Description |
|---|---|---|
| DocumentClosing | event | Subscribe to the DocumentClosing event to be notified when Revit is just about to close a document. |
| DocumentPrinted | event | Subscribe to the DocumentPrinted event to be notified immediately after Revit has finished printing a view or ViewSet of the document. |
| DocumentPrinting | event | Subscribe to the DocumentPrinting event to be notified when Revit is just about to print a view or ViewSet of the document. |
| DocumentSavedAs | event | Subscribe to the DocumentSavedAs event to be notified immediately after Revit has finished saving document with a new file name. |
| DocumentSaved | event | Subscribe to the DocumentSaved event to be notified immediately after Revit has finished saving a document. |
| DocumentSavingAs | event | Subscribe to the DocumentSavingAs event to be notified when Revit is just about to save the document with a new file name. |
| DocumentSaving | event | Subscribe to the DocumentSaving event to be notified when Revit is just about to save a document. |
| ViewPrinted | event | Subscribe to the ViewPrinted event to be notified immediately after Revit has finished printing a view of the document. |
| 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 |
|---|---|---|
| AcquireCoordinates(ElementId) | None | Acquires coordinates from the specified link instance. |
| AutoJoinElements() | None | Forces the elements in the Revit document to automatically join to their neighbors where appropriate. |
| CanEnableCloudWorksharing() | bool | Checks if cloud worksharing can be enabled for the cloud model. |
| CanEnableWorksharing() | bool | Checks if worksharing can be enabled in the document. |
| Close() | bool | Closes the document, save the changes if there are. |
| Close(Boolean) | bool | Closes the document with the option to save. |
| CombineElements(CombinableElementArray) | GeomCombination | Combine a set of combinable elements into a geometry combination. |
| ConvertDetailToModelCurves(View, DetailCurveArray) | ModelCurveArray | Converts a group of DetailCurves to equivalent ModelCurves. |
| ConvertModelToDetailCurves(View, ModelCurveArray) | DetailCurveArray | Converts a group of ModelCurves to equivalent DetailCurves. |
| ConvertModelToSymbolicCurves(View, ModelCurveArray) | SymbolicCurveArray | Converts a group of ModelCurves to equivalent SymbolicCurves. |
| ConvertSymbolicToModelCurves(View, SymbolicCurveArray) | ModelCurveArray | Converts a group of SymbolicCurves to equivalent ModelCurves. |
| Delete(ElementId) | ICollection<ElementId> | Deletes an element from the document given the id of that element. |
| Delete(ICollection<ElementId>) | ICollection<ElementId> | Deletes a set of elements from the document. |
| Dispose() | None | Releases all resources used by the |
| EditFamily(Family) | Document | Gets the document of a loaded family to edit. |
| EnableCloudWorksharing() | None | Enables cloud worksharing for a cloud model |
| EnableWorksharing(String, String) | None | Enables worksharing in the document. |
| Equals(Object) | bool | Determines whether the specified equals to this . |
| ExportImage(ImageExportOptions) | None | Exports a view or set of views into an image file. |
| Export(String, String, GBXMLExportOptions) | bool | Export the model in gbXML (green-building) format. |
| Export(String, String, ICollection<ElementId>, DGNExportOptions) | bool | Exports a selection of views in DGN format. |
| Export(String, String, ICollection<ElementId>, DWGExportOptions) | bool | Exports a selection of views in DWG format. |
| Export(String, String, ICollection<ElementId>, DXFExportOptions) | bool | Exports a selection of views in DXF format. |
| Export(String, String, ICollection<ElementId>, SATExportOptions) | bool | Exports the current view or a selection of views in SAT format. |
| Export(String, String, IFCExportOptions) | bool | Exports the document to the Industry Standard Classes (IFC) format. |
| Export(String, String, MassGBXMLExportOptions) | None | Exports a gbXML file from a mass model document. |
| Export(String, String, NavisworksExportOptions) | None | Exports a Revit project to the Navisworks .nwc format. |
| Export(String, String, ViewSet, DWFExportOptions) | bool | Exports the current view or a selection of views in DWF format. |
| Export(String, String, ViewSet, DWFXExportOptions) | bool | Exports the current view or a selection of views in DWFX format. |
| Export(String, String, ViewSet, FBXExportOptions) | bool | Exports the document in 3D-Studio Max (FBX) format. |
| GetCloudModelPath() | ModelPath | Gets the cloud model path of the cloud model. |
| GetDefaultElementTypeId(ElementTypeGroup) | ElementId | Gets the default element type id with the given DefaultElementType id. |
| GetDefaultFamilyTypeId(ElementId) | ElementId | Gets the default family type id with the given family category id. |
| GetDocumentPreviewSettings() | The preview settings. | Returns the preview settings for the given document. |
| GetDocumentVersion(Document) | DocumentVersion | Gets the DocumentVersion that corresponds to a document. |
| GetElement(ElementId) | Element | Gets the Element referenced by the input ElementId. |
| GetElement(Reference) | Element | Gets the Element referenced by the input reference. |
| GetElement(String) | Element | Gets the Element referenced by a unique id string. |
| GetHashCode() | int | Gets the hash code of this document instance. |
| GetPaintedMaterial(ElementId, Face) | ElementId | Get the material painted on the element's face. Returns invalidElementId if the face is not painted. |
| GetPrintSettingIds() | ICollection<ElementId> | Retrieves all Print Settings of current project. |
| GetRoomAtPoint(XYZ) | Room | Gets a room containing the point. |
| GetRoomAtPoint(XYZ, Phase) | Room | Gets a room containing the point. |
| GetSpaceAtPoint(XYZ) | Space | Gets a space containing the point. |
| GetSpaceAtPoint(XYZ, Phase) | Space | Gets a space containing the point. |
| GetSubelement(ElementId, Int32) | Subelement | Gets the subelement referenced by a parent id and subelement id. |
| GetSubelement(Reference) | Subelement | Gets the subelement referenced by the input reference. |
| GetSubelement(String) | Subelement | Gets the subelement referenced by a unique id string. |
| GetUnits() | The Units object. | Gets the Units object. |
| GetWarnings() | IList<FailureMessage> | Returns list of failure messages generated from persistent (reviewable) warnings accumulated in the document. |
| GetWorksetId(ElementId) | WorksetId | Get Id of the Workset which owns the element. |
| GetWorksetTable() | WorksetTable | Get the WorksetTable of this document. |
| GetWorksharingCentralModelPath() | ModelPath | Gets the central model path of the worksharing model. |
| HasAllChangesFromCentral() | bool | Returns whether the model in the current session is up to date with central. |
| Import(String, DGNImportOptions, View, ElementId%) | bool | Imports a DGN file to the document. |
| Import(String, DWGImportOptions, View, ElementId%) | bool | Imports a DWG or DXF file to the document. |
| Import(String, GBXMLImportOptions) | bool | Imports a Green-Building XML file into the document. |
| Import(String, ImageImportOptions, View, Element%) | bool | Imports an image (a bitmap) into the document. |
| Import(String, SATImportOptions, View) | ElementId | Imports an SAT file into the document. |
| Import(String, SKPImportOptions, View) | ElementId | Imports an SKP file into the document. |
| IsBackgroundCalculationInProgress() | bool | Indicates whether there are any background calculations in progress for this document. |
| IsDefaultElementTypeIdValid(ElementTypeGroup, ElementId) | bool | Checks whether the element type id is valid for the give DefaultElmentType id. |
| IsDefaultFamilyTypeIdValid(ElementId, ElementId) | bool | Checks whether the family type id is valid for the give family category. |
| IsPainted(ElementId, Face) | bool | Checks if the element's face is painted with a material. |
| Link(String, DGNImportOptions, View, ElementId%) | bool | Links a DGN file to the document. |
| Link(String, DWFImportOptions) | IList<ElementId> | Links Markups in a DWF file to the document. |
| Link(String, DWGImportOptions, View, ElementId%) | bool | Links a DWG or DXF file to the document. |
| Link(String, SATImportOptions, View) | ElementId | Links an SAT file into the document. |
| Link(String, SKPImportOptions, View) | ElementId | Links an SKP file into the document. |
| LoadFamily(Document) | Family | Loads the contents of this family document into another document. |
| LoadFamily(Document, IFamilyLoadOptions) | Family | Loads the contents of this family document into another document. |
| LoadFamily(String) | bool | Loads an entire family and all its types/symbols into the document. |
| LoadFamily(String, Family%) | bool | Loads an entire family and all its types/symbols into the document and provides a reference to the loaded family. |
| 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. |
| LoadFamilySymbol(String, String) | bool | Loads only a specified family type/symbol from a family file into the document. |
| 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. |
| 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. |
| MakeTransientElements(ITransientElementMaker) | None | This method encapsulates the process of creating transient elements in the document. |
| NewAreaBoundaryConditions(Element, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) | nullNothingnullptr | Creates a new Area BoundaryConditions element on a host element. |
| NewAreaBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) | nullNothingnullptr | Creates a new Area BoundaryConditions element on a reference. |
| NewAreaBoundaryLine(SketchPlane, Curve, ViewPlan) | ModelCurve | Creates a new boundary line as an Area border. |
| NewArea(ViewPlan, UV) | Area | Creates a new area |
| NewAreas(List<AreaCreationData>) | ElementSet | Creates new areas |
| NewAreaTag(ViewPlan, Area, UV) | AreaTag | Creates a new area tag. |
| NewCrossFitting(Connector, Connector, Connector, Connector) | FamilyInstance | Add a new family instance of a cross fitting into the Autodesk Revit document, using four connectors. |
| NewCurtainSystem2(ReferenceArray, CurtainSystemType) | ICollection<ElementId> | Creates a new CurtainSystem element from a set of face references. |
| NewCurtainSystem(FaceArray, CurtainSystemType) | CurtainSystem | Creates a new CurtainSystem element from a set of faces. |
| NewElbowFitting(Connector, Connector) | FamilyInstance | Add a new family instance of an elbow fitting into the Autodesk Revit document, using two connectors. |
| NewExtrusionRoof(CurveArray, ReferencePlane, Level, RoofType, Double, Double) | ExtrusionRoof | Creates a new Extrusion Roof. |
| NewFamilyInstance(Curve, FamilySymbol, Level, StructuralType) | nullNothingnullptr | Inserts a new instance of a family into the document, using a curve, type/symbol and reference level. |
| 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. |
| 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. |
| NewFascia(FasciaType, Reference) | nullNothingnullptr | Creates a fascia along a reference. |
| NewFascia(FasciaType, ReferenceArray) | nullNothingnullptr | Creates a fascia along a reference array. |
| NewFlexDuct(Connector, Connector, FlexDuctType) | FlexDuct | Adds a new flexible duct into the document, using two connector, and duct type. |
| NewFlexDuct(Connector, IList<XYZ>, FlexDuctType) | FlexDuct | Adds a new flexible duct into the document, using a connector, point array and duct type. |
| NewFlexDuct(IList<XYZ>, FlexDuctType) | FlexDuct | Adds a new flexible duct into the document, using a point array and duct type. |
| NewFlexPipe(Connector, Connector, FlexPipeType) | FlexPipe | Adds a new flexible pipe into the document, using two connector, and flexible pipe type. |
| NewFlexPipe(Connector, IList<XYZ>, FlexPipeType) | FlexPipe | Adds a new flexible pipe into the document, using a connector, point array and pipe type. |
| NewFlexPipe(IList<XYZ>, FlexPipeType) | FlexPipe | Adds a new flexible pipe into the document, using a point array and pipe type. |
| NewFloor(CurveArray, Boolean) | nullNothingnullptr | Creates a floor within the project with the given horizontal profile using the default floor style. |
| NewFloor(CurveArray, FloorType, Level, Boolean) | nullNothingnullptr | Creates a floor within the project with the given horizontal profile and floor style on the specified level. |
| 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. |
| NewFootPrintRoof(CurveArray, Level, RoofType, ModelCurveArray%) | FootPrintRoof | Creates a new FootPrintRoof element. |
| 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. |
| NewGutter(GutterType, Reference) | nullNothingnullptr | Creates a gutter along a reference. |
| NewGutter(GutterType, ReferenceArray) | nullNothingnullptr | Creates a gutter along a reference array. |
| NewLineBoundaryConditions(Element, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) | nullNothingnullptr | Creates a new Line BoundaryConditions element on a host element. |
| NewLineBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) | nullNothingnullptr | Creates a new Line BoundaryConditions element on a reference. |
| NewMechanicalSystem(Connector, ConnectorSet, DuctSystemType) | MechanicalSystem | Creates a new MEP mechanical system element. |
| NewOpening(Element, CurveArray, Boolean) | Opening | Creates a new opening in a roof, floor and ceiling. |
| NewOpening(Element, CurveArray, eRefFace) | Opening | Creates a new opening in a beam, brace and column. |
| NewOpening(Level, Level, CurveArray) | Opening | Creates a new shaft opening between a set of levels. |
| NewOpening(Wall, XYZ, XYZ) | Opening | Creates a rectangular opening on a wall. |
| NewPipingSystem(Connector, ConnectorSet, PipeSystemType) | PipingSystem | Creates a new MEP piping system element. |
| NewPointBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) | nullNothingnullptr | Creates a new Point BoundaryConditions Element. |
| NewRoomBoundaryLines(SketchPlane, CurveArray, View) | ModelCurveArray | Creates a new boundary line as an Room border. |
| NewRoom(Level, UV) | nullNothingnullptr | Creates a new room on a level at a specified point. |
| NewRoom(Phase) | nullNothingnullptr | Creates a new unplaced room and with an assigned phase. |
| 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. |
| NewRooms2(Level) | nullNothingnullptr | Creates new rooms in each plan circuit found in the given level in the last phase. |
| NewRooms2(Level, Phase) | ICollection<ElementId> | Creates new rooms in each plan circuit found in the given level in the given phase. |
| NewRooms2(Phase, Int32) | ICollection<ElementId> | Creates new unplaced rooms in the given phase. |
| NewRoomTag(LinkElementId, UV, ElementId) | nullNothingnullptr | Creates a new RoomTag referencing a room in the host model or in a Revit link. |
| NewSlabEdge(SlabEdgeType, Reference) | nullNothingnullptr | Creates a slab edge along a reference. |
| NewSlabEdge(SlabEdgeType, ReferenceArray) | nullNothingnullptr | Creates a slab edge along a reference array. |
| NewSlab(CurveArray, Level, Line, Double, Boolean) | nullNothingnullptr | Creates a slab within the project with the given horizontal profile using the default floor style. |
| NewSpaceBoundaryLines(SketchPlane, CurveArray, View) | ModelCurveArray | Creates a new boundary line as an Space border. |
| NewSpace(Level, Phase, UV) | nullNothingnullptr | Creates a new space element on the given level, at the given location, and assigned to the given phase. |
| NewSpace(Level, UV) | nullNothingnullptr | Creates a new space element on the given level at the given location. |
| NewSpace(Phase) | nullNothingnullptr | Creates a new unplaced space on a given phase. |
| NewSpaces2(Level, Phase, View) | ICollection<ElementId> | Creates new spaces on the available plan circuits of a the given level. |
| NewSpaces2(Phase, Int32) | nullNothingnullptr | Creates a set of new unplaced spaces on a given phase. |
| NewSpaceTag(Space, UV, View) | nullNothingnullptr | Creates a new SpaceTag. |
| NewSpotCoordinate(View, Reference, XYZ, XYZ, XYZ, XYZ, Boolean) | nullNothingnullptr | Generate a new spot coordinate object within the project. |
| NewSpotElevation(View, Reference, XYZ, XYZ, XYZ, XYZ, Boolean) | nullNothingnullptr | Generate a new spot elevation object within the project. |
| 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. |
| NewTeeFitting(Connector, Connector, Connector) | FamilyInstance | Add a new family instance of a tee fitting into the Autodesk Revit document, using three connectors. |
| NewTransitionFitting(Connector, Connector) | FamilyInstance | Add a new family instance of an transition fitting into the Autodesk Revit document, using two connectors. |
| NewUnionFitting(Connector, Connector) | FamilyInstance | Add a new family instance of an union fitting into the Autodesk Revit document, using two connectors. |
| NewZone(Level, Phase) | nullNothingnullptr | Creates a new Zone element. |
| Paint(ElementId, Face, ElementId) | None | Paint the element's face with specified material. |
| Paint(ElementId, Face, FamilyParameter) | None | Paint the element's face with specified material. |
| PostFailure(FailureMessage) | FailureMessageKey | Posts a failure to be displayed to the user at the end of transaction. |
| Print(ViewSet) | None | Prints a set of views with default view template and default print settings. |
| Print(ViewSet, Boolean) | None | Prints a set of views with default view template and default print settings. |
| Print(ViewSet, View) | None | Prints a set of views with a specified view template and default print settings. |
| Print(ViewSet, View, Boolean) | None | Prints a set of views with a specified view template and default print settings. |
| PublishCoordinates(LinkElementId) | None | Publish coordinates to the specified ProjectLocation of the link instance. |
| Regenerate() | None | Updates the elements in the Revit document to reflect all changes. |
| ReloadLatest(ReloadLatestOptions) | None | Fetches changes from central (due to one or more synchronizations with central) and merges them into the current session. |
| RemovePaint(ElementId, Face) | None | Remove the material painted on the element's face. If the face is currently not painted,it will do nothing. |
| SaveAsCloudModel(String, String) | None | Saves current nonworkshared model as a cloud model in BIM 360. |
| SaveAs(ModelPath, SaveAsOptions) | None | Saves the document to a given path. |
| SaveAs(String) | None | Saves the document to a given file path. |
| SaveAs(String, SaveAsOptions) | None | Saves the document to a given file path. |
| SaveCloudModel() | None | Saves cloud model. |
| Save() | None | Saves the document. |
| Save(SaveOptions) | None | Saves the document. |
| SaveToProjectAsImage(ImageExportOptions) | ElementId | Creates an image view from the currently active view. |
| SeparateElements(CombinableElementArray) | None | Separate a set of combinable elements out of combinations they currently belong to. |
| SetDefaultElementTypeId(ElementTypeGroup, ElementId) | None | Sets the default element type id of the given DefaultElementType id. |
| SetDefaultFamilyTypeId(ElementId, ElementId) | None | Sets the default family type id for the given family category. |
| SetUnits(Units) | None | Sets the units. |
| 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. |
| UnpostFailure(FailureMessageKey) | None | Deletes the posted failure message associated with a given FailureMessageKey. |
| Name | Return Type | Description |
|---|---|---|
| ActiveProjectLocation | ProjectLocation | Retrieve the active project location. |
| ActiveView | View | The document's active view. |
| Application | Application | Returns the Application in which the Document resides. |
| Create | Document | An object that can be used to create new instances of Autodesk Revit API elements within a project. |
| DisplayUnitSystem | DisplayUnit | Provides access to display unit type with in the document. |
| FamilyCreate | FamilyItemFactory | An object that can be used to create new instances of Autodesk Revit API elements within a family document. |
| FamilyManager | FamilyManager | The family manager object provides access to family types and parameters. |
| IsDetached | bool | Identifies if a workshared document is detached. Also, see |
| IsFamilyDocument | bool | Identifies if the current document is a family document. |
| IsLinked | bool | Identifies if a document is a linked RVT. |
| IsModelInCloud | bool | Identifies if document is stored on Autodesk cloud services. |
| IsModifiable | bool | The document's state of modifiability. |
| IsModified | bool | The state of changes made to the document. |
| IsReadOnlyFile | bool | Signals whether the document was opened from a read-only file. |
| IsReadOnly | bool | Identifies if the document is read-only or can possibly be modified. |
| IsValidObject | bool | Specifies whether the .NET object represents a valid Revit entity. |
| IsWorkshared | bool | Identifies if worksharing (i.e. editing permissions and multiple worksets) have been enabled in the document. Also, see |
| MassDisplayTemporaryOverride | MassDisplayTemporaryOverrideType | This setting controls temporary display in views of objects with mass category or subcategories. |
| MullionTypes | MullionTypeSet | This property is used to retrieve all the mullion types in current system. |
| OwnerFamily | Family | Get the Family of this Family Document. |
| PanelTypes | PanelTypeSet | Retrieves a set of PanelType objects that contains all the panel types that are currently loaded into the project. |
| ParameterBindings | BindingMap | Retrieves an object from which mappings between parameter definitions and categories can be found. |
| PathName | string | The fully qualified path of the document's disk file. |
| Phases | PhaseArray | Retrieves all the object that represent phases within the project. |
| PlanTopologies | PlanTopologySet | Get the PlanTopologies of the current project in the last phase. |
| PlanTopologies | PlanTopologySet | Gets the PlanTopologies of the current project in a given phase. |
| PlanTopology | PlanTopology | Get the PlanTopology of a given level in the last phase. |
| PlanTopology | PlanTopology | Get the PlanTopology of a given level in a given phase. |
| PrintManager | PrintManager | Retrieve the PrintManager of current project. |
| ProjectInformation | ProjectInfo | Return the Project Information of the current project. |
| ProjectLocations | ProjectLocationSet | Retrieve all the project locations associated with this project |
| ReactionsAreUpToDate | bool | Reports if the analytical model has regenerated in a document with reaction loads. |
| Settings | Settings | Provides access to general application settings, such as Categories. |
| SiteLocation | SiteLocation | Returns the site location information. |
| Title | string | The document's title. |
| TypeOfStorage | StorageType | Get the storage type of the specified BuiltInParameter. |
| WorksharingCentralGUID | Guid | The central GUID of the server-based model. |