VB Save and Manual Save

VB Save and Manual Save

Anonymous
Not applicable
404 Views
2 Replies
Message 1 of 3

VB Save and Manual Save

Anonymous
Not applicable
I wrote a purge routine to roll through all the drawings in a folder and open then purge then save the dwg. After the save the next drawing is opened and the process is repeated.

If I use VB debugger and step through the code I can see the blocks (and other items) being purged from the drawing. If I save the drawing through the VB app the drawing size does not change (as observered in windows explorer) yet the modified date does change. If I switch to the drawing before closing it and do a manual save (File>>save) the drawing file size goes from 777 to 113kb as observed in explorer.

I am using ACAD 2002 and the code minus some dims follows.

Thanks for any suggestions.
LJ

Private Sub PurgeDwg2(FileName As String)
lblActiveDwg = FileName
'Connect to ACAD
Dim acdDwg As AcadDocument

Debug.Print FileName
'PrePurgeKB = Int(SizeOfFile(FileName) / 1000)

Set acdDwg = acdApp.Application.Documents.Open(FileName)

acdDwg.PurgeAll
acdDwg.PurgeAll
acdDwg.PurgeAll

acdDwg.Save

acdApp.ZoomExtents
acdDwg.Save
' Manual save here changes dwg size
acdDwg.Close True

End Sub
0 Likes
405 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
no reason why it shouldn't do that.
i just tried purging a drawing and in the command line did vbastmt(thisdrawing.save) and the file size changed.
i'm using acad 2006
0 Likes
Message 3 of 3

Anonymous
Not applicable
Just so you know.

Seems there is a bug in ACAD 2002 with this. I upgraded to 2005 and the file size is decreasing with the VB save as it should.

LJ
0 Likes