FileOpenDialog Class


File Open Dialog Class

This class allows an add-in to prompt the user with the Revit dialog used to navigate to and select an existing file path. This dialog is typically used to select a file for opening or importing.
Inheritance Hierarchy
System Object
Autodesk.Revit.UI FileDialog
Autodesk.Revit.UI FileOpenDialog

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class FileOpenDialog : FileDialog

The FileOpenDialog type exposes the following members.

Constructors
Name Description
Public method FileOpenDialog Constructs a new instance of a File Open dialog.
Top
Properties
Name Description
Public property DefaultFilterEntry The default entry (from the filter) to be selected in the dialog.
(Inherited from FileDialog )
Public property Filter The filter string representing a collection of extensions allowed by the dialog.
(Inherited from FileDialog )
Public property IsValidObject Specifies whether the .NET object represents a valid Revit entity.
(Inherited from FileDialog )
Public property ShowPreview Identifies if the dialog should include a region showing a preview of the selected file.
Public property Title The title to show on the dialog.
(Inherited from FileDialog )
Top
Methods
Name Description
Public method Dispose
(Inherited from FileDialog )
Public method Equals Determines whether the specified object is equal to the current object.
(Inherited from Object )
Public method GetHashCode Serves as the default hash function.
(Inherited from Object )
Public method GetSelectedModelPath Returns the selected file path chosen by the user.
(Inherited from FileDialog )
Public method GetType Gets the Type of the current instance.
(Inherited from Object )
Public method Show Shows the dialog using the stored settings.
(Inherited from FileDialog )
Public method ToString Returns a string that represents the current object.
(Inherited from Object )
Top
Remarks

The behavior and appearance of this dialog matches the Revit "Open" dialog. This is a general-purpose dialog for opening any given file type, and options to configure settings like worksharing options will not be included.

The user will be prompted to select an existing file that matches one of the provided filters. The user may not enter a file name that does not exist.

The folder location shown when the dialog is displayed defaults to the most recently used file location for opening or importing.

Use of this dialog does not actually open an existing file, but it will provide the selected file path back to the caller to take any action necessary.

See Also