How can I set paperformat when plotting with vba

How can I set paperformat when plotting with vba

Anonymous
Not applicable
602 Views
1 Reply
Message 1 of 2

How can I set paperformat when plotting with vba

Anonymous
Not applicable
Hello,
I have to convert some 40'000 drawings to pdf (using distiller)
I know the format (papersize) of the drawing (it is an attribute)
I am looking for a way to set the paper size when plotting.
And I would like to make sure A4 (Ansi d) is in portrait and A3 is
landscape.

Could anybody point me towards the right way to do that?

Thank you very much

Robert
0 Likes
603 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
This might help you get what you want. If you need further
help, send me a direct email with specifics.

Joe
--
Public Sub GetPaperSizesAndNames()
Dim Layout As AcadLayout
Dim Width As Double
Dim Height As Double
Dim Margins As Variant
Dim MediaNames As Variant
Dim PlotDeviceNames As Variant

With ThisDrawing
.ActiveSpace = acPaperSpace
Set Layout = .ActiveLayout
End With

With Layout
MediaNames = .GetCanonicalMediaNames
Dim Index As Integer
For Index = 0 To UBound(MediaNames) - 1
.CanonicalMediaName = MediaNames(Index)
'get the current paper size
.GetPaperSize Width, Height
'format it to english units - AutoCAD returns the number in metric
Width = Format(Width, "0000.0") / 25.4: Height = Format(Height,
"0000.0") / 25.4
Debug.Print .CanonicalMediaName & vbTab & "Width: " & Width & vbTab &
"Height: " & Height
'Debug.Print MediaNames(index)
Next Index

'display plot device names
PlotDeviceNames = .GetPlotDeviceNames

For Index = 0 To UBound(PlotDeviceNames) - 1
Debug.Print "PlotDevice: " & PlotDeviceNames(Index)
Next Index
End With

With ThisDrawing
.ActiveSpace = acModelSpace
Set Layout = .ActiveLayout
End With
End Sub

"robert" wrote in message
news:61936CC30DEC209C8B42E335CC96AC36@in.WebX.maYIadrTaRb...
> Hello,
> I have to convert some 40'000 drawings to pdf (using distiller)
> I know the format (papersize) of the drawing (it is an attribute)
> I am looking for a way to set the paper size when plotting.
> And I would like to make sure A4 (Ansi d) is in portrait and A3 is
> landscape.
>
> Could anybody point me towards the right way to do that?
>
> Thank you very much
>
> Robert
>
>
>
0 Likes