Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
meGVGMF
542 Views, 4 Replies

Application.Documents.Open with updates deferred

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.

Labels (4)
Andrii_Humeniuk
in reply to: meGVGMF

Hi @meGVGMF . 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

meGVGMF
in reply to: Andrii_Humeniuk

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` ?

Andrii_Humeniuk
in reply to: meGVGMF

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

meGVGMF
in reply to: Andrii_Humeniuk

Great, thanks for all the help