Application.Documents.Open with updates deferred

Application.Documents.Open with updates deferred

Anonymous
Not applicable
686 Views
4 Replies
Message 1 of 5

Application.Documents.Open with updates deferred

Anonymous
Not applicable

Hi

 

I'm looking to open a drawing via the Application.Documents.Open method, or else something effectively the same, that can get me the drawing document from within a different document, only with updates deferred.

 

I would like to skip resolving files/opening subdocuments for a particular script because it has a huge impact on performance (lots of files, no subdocument information needed).

 

Is there any way to do this?

 

Thanks

 

EDIT: using Application.AssemblyOptions.DeferUpdate seems to help, but there aren't equivalent properties for the DrawingOptions or PartOptions classes, so I'm still curious to know if there's anything else that can be done.

0 Likes
Accepted solutions (1)
687 Views
4 Replies
Replies (4)
Message 2 of 5

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @Anonymous . You need to write the path to your file in line 3 - "FullFileName"

 

 

Dim oNVM As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
oNVM.Add("DeferUpdates", True)
Dim oDDoc As DrawingDocument = ThisApplication.Documents.OpenWithOptions("FullFileName", oNVM)

 

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 5

Anonymous
Not applicable

Thanks

But what would be the way to turn this off? Do I need to reopen the document with the option unset, or can I do it through the document object somehow?

Would that be through `oDoc.DrawingSettings.DeferUpdates` ?

Message 4 of 5

Andrii_Humeniuk
Advisor
Advisor

Yes, your guess is correct. In order for the document to be updated again, you need DeferUpdates = False.

oDoc.DrawingSettings.DeferUpdates = False

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 5 of 5

Anonymous
Not applicable
Great, thanks for all the help
0 Likes