Message 1 of 3
VB Save and Manual Save

Not applicable
01-15-2007
06:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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