How to make sure all drawingviews are done updating before exporting to PDF?

How to make sure all drawingviews are done updating before exporting to PDF?

bshbsh
Collaborator Collaborator
453 Views
2 Replies
Message 1 of 3

How to make sure all drawingviews are done updating before exporting to PDF?

bshbsh
Collaborator
Collaborator

Hi,

I need to do specific things before exporting drawings to PDFs, some of which (one example: making sure the parts list is sorted the way it has to be) causes the drawing to need a full update on all views (that has balloons).

I've been using the built-in command "DrawingUpdateAllSheetsCmd" from the vba macro, with Execute2(True). This should make it synchronous and shouldn't give control back to the macro until it fully completes. And I haven't had problems with this before.

But now it doesn't work anymore, the command returns control to the macro even before the view computation is done, so the PDF will contain faint/badlooking bitmapped crap instead of the vectorized views. I dunno why is this now? Is this a new bug in the latest update?

Same thing happens if I do a Document.Update, or even if I go through all sheets and all views and update each one individually.

How can I make sure, views are done updating, before continuing with the macro? Is there any way except for checking running viewcompute threads?

Or does anyone know why this command is not synchrounous anymore even if it is executed as such?

0 Likes
Accepted solutions (1)
454 Views
2 Replies
Replies (2)
Message 2 of 3

lmc.engineering
Advocate
Advocate
Accepted solution

Hi @bshbsh

 

I had a problem similar to this, calling IsUpdateComplete on drawing views seemed to solve it for me:

 

SyntaxEditor Code Snippet

	For Each oDwgView In oDwgViews
		Do While oDwgView.IsUpdateComplete = False
		ThisApplication.UserInterfaceManager.DoEvents
		ThisApplication.StatusBarText = "Updating drawing views..."
		Loop
	Next
Message 3 of 3

bshbsh
Collaborator
Collaborator

Thanks! Works!

I also disabled userinteraction while this is running.

0 Likes