TryFindDocumentByTitle

Document? TryFindDocumentByTitle(this Application app, string title)

Tries to find an open document by its title (case-insensitive match, without file extension).

Parameters

  • appApplication

    The Revit application instance.

  • titlestring

    The document title to search for.

Returns: The found Document, or null if not found.

Example

Application app = commandData.Application.Application;
Document? doc = app.TryFindDocumentByTitle("MyProject");
if (doc != null)
{
TaskDialog.Show("Found", doc.Title);
}