M

Application.OpenDocumentFile

Description:
Opens a document from disk or cloud.
Remarks:
This method opens the document into memory but does not make it visible to the user in any way. If the user currently has ownership of elements in this model and there is no local model on this machine, Revit will post a warning.
Overloads (3):
OpenDocumentFile(ModelPath,OpenOptions)
public Document OpenDocumentFile(
	ModelPath modelPath,
	OpenOptions openOptions
)
Return Value The opened document. The opened document.
private static Document OpenDetached(Application application, ModelPath modelPath)
{
    OpenOptions options1 = new OpenOptions();

    options1.DetachFromCentralOption = DetachFromCentralOption.DetachAndDiscardWorksets;
    Document openedDoc = application.OpenDocumentFile(modelPath, options1);

    return openedDoc;
}