Hi,
You can use the below code. It has a few extra bits in there to catch any duplicate scenarios. It also files it in a folder named "Auto Imager" in the root folder the drawing document resides in.
Code Snippet
Sub Main()
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim sExt As String = ".png"
Dim pImageX As Integer = 5000
Dim pImageY As Integer = 5000
Dim FilePath As String = ThisDoc.Path
Dim sDocName As String = ThisDoc.FileName(False)
Dim sImageLocation As String = "\Auto Imager" '''CHANGE STORAGE FOLDER HERE
Dim sWritePath As String = FilePath & sImageLocation
Dim IncVal As Integer = 1
Dim SFile As System.IO.File
Dim SDir As System.IO.Directory
'''Check the directory exists
If Not SDir.Exists(sWritePath) Then SDir.CreateDirectory(sWritePath)
'''Set the active view
ThisApplication.CommandManager.ControlDefinitions.Item("AppIsometricViewCmd").Execute
oView = ThisApplication.ActiveView
'''Iterate through and capture image
For Each oSheet In oDrawDoc.Sheets
oSheet.Activate
sSheetName = oSheet.Name
sSheetName = sSheetName.Substring(0,sSheetName.Length-2)
'sImageName = sDocName & "_" & sSheetName
sImageName = sSheetName ''' SAVED AS SHEET NAME ONLY
sImageNameandPath = sWritePath & "\" & sImageName & sExt
'''Check if File exsists already. If So, increase incremental value
If Not SFile.Exists(sImageNameandPath) Then
oView.SaveAsBitmap(sImageNameandPath, pImageX, pImageY)
Else
Do
IncVal += 1
sImageNameandPath = sWritePath & "\" & sImageName & "_" & IncVal & sExt
Loop While SFile.Exists(sImageNameandPath)
oView.SaveAsBitmap(sImageNameandPath, pImageX, pImageY)
End If
Next
End Sub