<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I set paperformat when plotting with vba in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/how-can-i-set-paperformat-when-plotting-with-vba/m-p/297041#M70350</link>
    <description>This might help you get what you want. If you need further&lt;BR /&gt;
help, send me a direct email with specifics.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
--&lt;BR /&gt;
Public Sub GetPaperSizesAndNames()&lt;BR /&gt;
Dim Layout As AcadLayout&lt;BR /&gt;
Dim Width As Double&lt;BR /&gt;
Dim Height As Double&lt;BR /&gt;
Dim Margins As Variant&lt;BR /&gt;
Dim MediaNames As Variant&lt;BR /&gt;
Dim PlotDeviceNames As Variant&lt;BR /&gt;
&lt;BR /&gt;
With ThisDrawing&lt;BR /&gt;
    .ActiveSpace = acPaperSpace&lt;BR /&gt;
    Set Layout = .ActiveLayout&lt;BR /&gt;
  End With&lt;BR /&gt;
&lt;BR /&gt;
With Layout&lt;BR /&gt;
    MediaNames = .GetCanonicalMediaNames&lt;BR /&gt;
    Dim Index As Integer&lt;BR /&gt;
    For Index = 0 To UBound(MediaNames) - 1&lt;BR /&gt;
      .CanonicalMediaName = MediaNames(Index)&lt;BR /&gt;
      'get the current paper size&lt;BR /&gt;
      .GetPaperSize Width, Height&lt;BR /&gt;
      'format it to english units - AutoCAD returns the number in metric&lt;BR /&gt;
      Width = Format(Width, "0000.0") / 25.4: Height = Format(Height,&lt;BR /&gt;
"0000.0") / 25.4&lt;BR /&gt;
      Debug.Print .CanonicalMediaName &amp;amp; vbTab &amp;amp; "Width: " &amp;amp; Width &amp;amp; vbTab &amp;amp;&lt;BR /&gt;
"Height: " &amp;amp; Height&lt;BR /&gt;
      'Debug.Print MediaNames(index)&lt;BR /&gt;
    Next Index&lt;BR /&gt;
&lt;BR /&gt;
'display plot device names&lt;BR /&gt;
    PlotDeviceNames = .GetPlotDeviceNames&lt;BR /&gt;
&lt;BR /&gt;
For Index = 0 To UBound(PlotDeviceNames) - 1&lt;BR /&gt;
      Debug.Print "PlotDevice: " &amp;amp; PlotDeviceNames(Index)&lt;BR /&gt;
    Next Index&lt;BR /&gt;
  End With&lt;BR /&gt;
&lt;BR /&gt;
With ThisDrawing&lt;BR /&gt;
    .ActiveSpace = acModelSpace&lt;BR /&gt;
    Set Layout = .ActiveLayout&lt;BR /&gt;
  End With&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
"robert" &lt;ROBERT&gt; wrote in message&lt;BR /&gt;
news:61936CC30DEC209C8B42E335CC96AC36@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hello,&lt;BR /&gt;
&amp;gt; I have to convert some 40'000 drawings to pdf (using distiller)&lt;BR /&gt;
&amp;gt; I know the format (papersize) of the drawing (it is an attribute)&lt;BR /&gt;
&amp;gt; I am looking for a way to set the paper size when plotting.&lt;BR /&gt;
&amp;gt; And I would like to make sure A4 (Ansi d) is in portrait and A3 is&lt;BR /&gt;
&amp;gt; landscape.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Could anybody point me towards the right way to do that?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thank you very much&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Robert&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROBERT&gt;</description>
    <pubDate>Tue, 24 Sep 2002 17:36:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-09-24T17:36:17Z</dc:date>
    <item>
      <title>How can I set paperformat when plotting with vba</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-can-i-set-paperformat-when-plotting-with-vba/m-p/297040#M70349</link>
      <description>Hello,&lt;BR /&gt;
I have to convert some 40'000 drawings to pdf (using distiller)&lt;BR /&gt;
I know the format (papersize) of the drawing (it is an attribute)&lt;BR /&gt;
I am looking for a way to set the paper size when plotting.&lt;BR /&gt;
And I would like to make sure A4 (Ansi d) is in portrait and A3 is&lt;BR /&gt;
landscape.&lt;BR /&gt;
&lt;BR /&gt;
Could anybody point me towards the right way to do that?&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much&lt;BR /&gt;
&lt;BR /&gt;
Robert</description>
      <pubDate>Tue, 24 Sep 2002 13:09:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-can-i-set-paperformat-when-plotting-with-vba/m-p/297040#M70349</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T13:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set paperformat when plotting with vba</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-can-i-set-paperformat-when-plotting-with-vba/m-p/297041#M70350</link>
      <description>This might help you get what you want. If you need further&lt;BR /&gt;
help, send me a direct email with specifics.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
--&lt;BR /&gt;
Public Sub GetPaperSizesAndNames()&lt;BR /&gt;
Dim Layout As AcadLayout&lt;BR /&gt;
Dim Width As Double&lt;BR /&gt;
Dim Height As Double&lt;BR /&gt;
Dim Margins As Variant&lt;BR /&gt;
Dim MediaNames As Variant&lt;BR /&gt;
Dim PlotDeviceNames As Variant&lt;BR /&gt;
&lt;BR /&gt;
With ThisDrawing&lt;BR /&gt;
    .ActiveSpace = acPaperSpace&lt;BR /&gt;
    Set Layout = .ActiveLayout&lt;BR /&gt;
  End With&lt;BR /&gt;
&lt;BR /&gt;
With Layout&lt;BR /&gt;
    MediaNames = .GetCanonicalMediaNames&lt;BR /&gt;
    Dim Index As Integer&lt;BR /&gt;
    For Index = 0 To UBound(MediaNames) - 1&lt;BR /&gt;
      .CanonicalMediaName = MediaNames(Index)&lt;BR /&gt;
      'get the current paper size&lt;BR /&gt;
      .GetPaperSize Width, Height&lt;BR /&gt;
      'format it to english units - AutoCAD returns the number in metric&lt;BR /&gt;
      Width = Format(Width, "0000.0") / 25.4: Height = Format(Height,&lt;BR /&gt;
"0000.0") / 25.4&lt;BR /&gt;
      Debug.Print .CanonicalMediaName &amp;amp; vbTab &amp;amp; "Width: " &amp;amp; Width &amp;amp; vbTab &amp;amp;&lt;BR /&gt;
"Height: " &amp;amp; Height&lt;BR /&gt;
      'Debug.Print MediaNames(index)&lt;BR /&gt;
    Next Index&lt;BR /&gt;
&lt;BR /&gt;
'display plot device names&lt;BR /&gt;
    PlotDeviceNames = .GetPlotDeviceNames&lt;BR /&gt;
&lt;BR /&gt;
For Index = 0 To UBound(PlotDeviceNames) - 1&lt;BR /&gt;
      Debug.Print "PlotDevice: " &amp;amp; PlotDeviceNames(Index)&lt;BR /&gt;
    Next Index&lt;BR /&gt;
  End With&lt;BR /&gt;
&lt;BR /&gt;
With ThisDrawing&lt;BR /&gt;
    .ActiveSpace = acModelSpace&lt;BR /&gt;
    Set Layout = .ActiveLayout&lt;BR /&gt;
  End With&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
"robert" &lt;ROBERT&gt; wrote in message&lt;BR /&gt;
news:61936CC30DEC209C8B42E335CC96AC36@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hello,&lt;BR /&gt;
&amp;gt; I have to convert some 40'000 drawings to pdf (using distiller)&lt;BR /&gt;
&amp;gt; I know the format (papersize) of the drawing (it is an attribute)&lt;BR /&gt;
&amp;gt; I am looking for a way to set the paper size when plotting.&lt;BR /&gt;
&amp;gt; And I would like to make sure A4 (Ansi d) is in portrait and A3 is&lt;BR /&gt;
&amp;gt; landscape.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Could anybody point me towards the right way to do that?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thank you very much&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Robert&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROBERT&gt;</description>
      <pubDate>Tue, 24 Sep 2002 17:36:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-can-i-set-paperformat-when-plotting-with-vba/m-p/297041#M70350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T17:36:17Z</dc:date>
    </item>
  </channel>
</rss>

