How in VBA in AutoCAD to set the paper size?
How in VBA in AutoCAD to set the paper size?
(OP)
Hi,
In what way using VBA to set the paper size (for example: A2, A3, A4) and color (for example: black)?
please help
In what way using VBA to set the paper size (for example: A2, A3, A4) and color (for example: black)?
please help
RE: How in VBA in AutoCAD to set the paper size?
Here's what you need:
CODE
' This example gets the current plot device information
' and then displays the list of plot device names,
' media names, localized media names, and plot style
' table entries.
Dim Layout As ACADLayout
Set Layout = ThisDrawing.ModelSpace.Layout
' Refresh the current plot information for
' this session.
Layout.RefreshPlotDeviceInfo
' List all the valid device names for the system
Dim plotDevices As Variant
plotDevices = Layout.GetPlotDeviceNames()
Dim x As Integer
For x = LBound(plotDevices) To UBound(plotDevices)
MsgBox plotDevices(x)
Next
' List all the media names, and their localized version
Dim mediaNames As Variant
mediaNames = Layout.GetCanonicalMediaNames()
For x = LBound(mediaNames) To UBound(mediaNames)
MsgBox mediaNames(x)
MsgBox Layout.GetLocaleMediaName(mediaNames(x))
Next
' List all the entries in the plot style table
Dim styleNames As Variant
styleNames = Layout.GetPlotStyleTableNames()
For x = LBound(styleNames) To UBound(styleNames)
MsgBox styleNames(x)
Next
End Sub
HTH
RE: How in VBA in AutoCAD to set the paper size?