2027 Class
Changes 0
C

UIDocument

Description:
An object that represents an Autodesk Revit project opened in the Revit user interface.
Remarks:

This class represents a document opened in the user interface and therefore offers interfaces to work with settings and operations in the UI (for example, the active selection). 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 UIApplication object.

Obtain the database level Document (which contains interfaces not related to the UI) via the Document property. If you have a database level Document and need to access it from the UI, you can construct a new UIDocument from that object (the document must be open and visible in the UI to allow the methods to work successfully).
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.UI.UIDocument
public class UIDocument : IDisposable
Name Return Type Description Inherited From
C UIDocument(Document) None Use a database level Document to construct a UI-level Document.
Name Return Type Description Inherited From
M CanPlaceElementType(ElementType) Boolean Verifies that the user can be prompted to place the input element type interactively.
M Dispose() None Releases all resources used by the UIDocument
M Equals None Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
M GetHashCode None Serves as the default hash function. (Inherited from Object ) Object
M GetOpenUIViews() IList<UIView> Get a list of all open view windows in the Revit user interface.
M GetPlacementTypes(FamilySymbol, View) IList<FaceBasedPlacementType> Get a collection of valid placement types for input family symbol.
M GetRevitUIFamilyLoadOptions() IFamilyLoadOptions Return the option object that allows you to use Revit's dialog boxes to let the user respond to questions that arise during loading of families.
M GetSketchGalleryOptions(FamilySymbol) IList<SketchGalleryOptions> Gets the valid sketch gallery options of a family symbol.
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M PostRequestForElementTypePlacement(ElementType) None Places a request on Revit's command queue for the user to place instances of the specified ElementType. This does not execute immediately, but instead when control returns to Revit from the current API context.
M PromptForFamilyInstancePlacement(FamilySymbol) None Prompts the user to place instances of the specified FamilySymbol.
M PromptForFamilyInstancePlacement(FamilySymbol, PromptForFamilyInstancePlacementOptions) None Prompts the user to place instances of the specified FamilySymbol.
M PromptToMatchElementType(ElementType) None Prompts the user to select elements to change them to the input type.
M PromptToPlaceElementTypeOnLegendView(ElementType) None Prompts the user to place an element type onto a legend view.
M PromptToPlaceViewOnSheet(View, Boolean) None Prompts the user to place a specified view onto a sheet.
M RefreshActiveView() None Refresh the display of the active view in the active document.
M RequestViewChange(View) None Requests an asynchronous change of the active view in the currently active document.
M SaveAndClose() Boolean Close the document, prompting the user for saving it when necessary.
M SaveAs() None Saves the document to a file name obtained from the Revit user without prompting the user to overwrite file if it exists.
M SaveAs(UISaveAsOptions) None Saves the document to a file name obtained from the Revit user optionally prompting the user to overwrite file if it exists.
M ShowElements(Element) None Shows the element by zoom to fit.
M ShowElements(ElementId) None Shows the element by zoom to fit.
M ShowElements(ElementSet) None Shows the elements by zoom to fit.
M ShowElements(ICollection<ElementId>) None Shows the elements by zoom to fit.
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
M UpdateAllOpenViews() None Update all open views in this document after elements have been changed, deleted, selected or de-selected. Graphics in the views are fully redrawn regardless of which elements have changed.
Name Return Type Description Inherited From
P ActiveGraphicalView View The currently active graphical view of the currently active document.
P ActiveView View The currently active view of the currently active document.
P Application UIApplication Retrieves an object that represents the current Application.
P Document Document Returns the database level document represented by this UI-level document.
P IsValidObject Boolean Specifies whether the .NET object represents a valid Revit entity.
P Selection Selection Retrieve the currently selected Elements in Autodesk Revit.