Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I have a script that creates a new project, saves it, closes it, and then re-opens it. After reopening (using the OpenAndActivateDocument method), I proceed to enable worksharing and create worksets. My concern is whether the document is fully loaded and activated immediately after calling OpenAndActivateDocument. Specifically, is there a risk that the document is not yet fully activated when I attempt to enable worksharing and start a transaction? If so, what is the best practice to ensure the document is fully ready before performing these actions? I’m also aware it’s not allowed to have an open transaction in the active document when calling OpenAndActivateDocument.
doc_start = app.NewProjectDocument(template_path)
doc_start.SaveAs(save_path)
doc_start.Close()
uiapp = UIApplication(app)
uidoc = uiapp.OpenAndActivateDocument(save_path)
doc = uidoc.Document
doc.EnableWorksharing('Shared Levels and Grids', 'Workset1')
Then I also create predifined worksets
Solved! Go to Solution.