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

Application.Documents.Open with updates deferred

meGVGMF
Advocate

Application.Documents.Open with updates deferred

meGVGMF
Advocate
Advocate

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
Reply
Accepted solutions (1)
544 Views
4 Replies
Replies (4)

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

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
Advocate
Advocate

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

meGVGMF
Advocate
Advocate
Great, thanks for all the help
0 Likes