# Open Document in background with Python

**URL:** <https://forum.dynamobim.com/t/open-document-in-background-with-python/48556>\
**Category:** Revit\
**Tags:** python\
**Created:** [March 27, 2020, 10:45pm UTC](https://forum.dynamobim.com/t/open-document-in-background-with-python/48556 "2020-03-27T22:45:43Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 28, 2020, 1:12am UTC](https://forum.dynamobim.com/t/open-document-in-background-with-python/48556/6 "2020-03-28T01:12:50Z")

</div>

Not sure, but it looks as though you may be using the wrong Method to try and open the file.

> **[OpenDocumentFile Method](https://www.revitapidocs.com/2019/701607cd-705d-34e0-b248-a7541d4ab43c.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

OpenDocumentFile(path,options)

See here for more:

> [@openDocumentFile](https://forum.dynamobim.com/t/opendocumentfile/33725/2):
>
> Hi @Yien I hope you’re well. Try this: import clr clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistence import DocumentManager clr.AddReference('RevitAPI') import Autodesk from Autodesk.Revit.DB import \* doc = DocumentManager.Instance.CurrentDBDocument app = doc.Application filePath = IN[0] modelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(filePath) options = OpenOptions() options.DetachFromCentralOption = DetachFromCentralOption.DetachAndPreserv…

---

_[View the full topic](https://forum.dynamobim.com/t/open-document-in-background-with-python/48556)._
