Here is a start to get you going. Option Explicit
Public Sub AndyBatchPlot()
Dim currentline As String
Open "c:\dwgnum.dat" For Input As 1
While Not EOF(1)
Line Input #1, currentline
Documents.Open currentline
ThisDrawing.Regen acAllViewports
ZoomExtents
Dim LL As Variant, UR As Variant
LL = ThisDrawing.GetVariable("extmin")
UR = ThisDrawing.GetVariable("extmax")
Dim dwgdist As Double
Dim x As Double, y As Double, z As Double
x = UR(0) - LL(0): y = UR(1) - LL(1)
x = x ^ 2
y = y ^ 2
z = Sqr(x + y)
Select Case z
Case Is <= 40
Call SetupAndPlot("11x17Draft.pc3", "STANDARDS.ctb", "Business_Letter_(8.50_x_11.00_Inches)", ac1_1, ac0degrees)
Case Is <= 48
Call SetupAndPlot("OCE DesignJet 750C.pc3", "VENDOR MEDIUM.ctb", "ARCH_expand_D_(36.00_x_24.00_Inches)", acScaleToFit, ac0degrees)
End Select
ThisDrawing.Plot.PlotToDevice
ThisDrawing.Close (True)
Wend
Close 1
End Sub
Private Sub SetupAndPlot(ByRef Plotter As String, CTB As String, SIZE As String, PSCALE As String, ROT As String)
Dim Layout As AcadLayout
On Error GoTo Err_Control
Set Layout = ThisDrawing.ActiveLayout
Layout.RefreshPlotDeviceInfo
Layout.ConfigName = Plotter ' CALL PLOTTER
Layout.PlotType = acExtents
Layout.PlotRotation = ROT ' CALL ROTATION
Layout.StyleSheet = CTB ' CALL CTB FILE
Layout.PlotWithPlotStyles = True
Layout.PlotViewportBorders = False
Layout.PlotViewportsFirst = True
Layout.CanonicalMediaName = SIZE ' CALL SIZE
Layout.PaperUnits = acInches
Layout.StandardScale = PSCALE 'CALL PSCALE
Layout.ShowPlotStyles = False
ThisDrawing.Plot.NumberOfCopies = 1
Layout.CenterPlot = True
Layout.ScaleLineweights = False
Layout.RefreshPlotDeviceInfo
ThisDrawing.Regen acAllViewports
ZoomExtents
Set Layout = Nothing
ThisDrawing.Save
Exit_Here:
Exit Sub
Err_Control:
Select Case Err.Number
Case "-2145320861"
MsgBox "Unable to Save Drawing- " & Err.Description
Case "-2145386493"
MsgBox "Drawing is setup for Named Plot Styles." & (Chr(13)) & (Chr(13)) & "Run CONVERTPSTYLES command", vbCritical, "Change Plot Style"
Case Else
MsgBox "Unknown Error " & Err.Number
End Select
End Sub