<?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: creating new page setup from VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033610#M24084</link>
    <description>Hi Gray,&lt;BR /&gt;
Thanks a lot for your reply. &lt;BR /&gt;
I just find a work arround, by creating a plotconfigration and calling it fom EndOpen event handler. Here is the code.&lt;BR /&gt;
&lt;BR /&gt;
Private Sub plotcorrector()&lt;BR /&gt;
Dim myconf As AcadPlotConfiguration&lt;BR /&gt;
&lt;BR /&gt;
Set myconf = ThisDrawing.PlotConfigurations.Add("MyPPlot", False)&lt;BR /&gt;
myconf.Name = "MyPlot"&lt;BR /&gt;
myconf.RefreshPlotDeviceInfo&lt;BR /&gt;
myconf.ConfigName = "\\BPC-SECONDARY\X-WC7245 - BW - PS"&lt;BR /&gt;
Dim mx(0 To 1) As Double&lt;BR /&gt;
Dim my(0 To 1) As Double&lt;BR /&gt;
mx(0) = 0&lt;BR /&gt;
mx(1) = 0&lt;BR /&gt;
my(0) = 1&lt;BR /&gt;
my(1) = 1&lt;BR /&gt;
myconf.SetWindowToPlot mx, my&lt;BR /&gt;
myconf.PlotType = acWindow&lt;BR /&gt;
myconf.StyleSheet = "tilt.ctb"&lt;BR /&gt;
myconf.PaperUnits = acMillimeters&lt;BR /&gt;
'myconf.RefreshPlotDeviceInfo&lt;BR /&gt;
myconf.CanonicalMediaName = "A3"&lt;BR /&gt;
&lt;BR /&gt;
myconf.CenterPlot = True&lt;BR /&gt;
myconf.UseStandardScale = True&lt;BR /&gt;
&lt;BR /&gt;
            myconf.StandardScale = acScaleToFit&lt;BR /&gt;
&lt;BR /&gt;
myconf.PlotWithPlotStyles = False&lt;BR /&gt;
myconf.RefreshPlotDeviceInfo&lt;BR /&gt;
&lt;BR /&gt;
ThisDrawing.Application.Update&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
    <pubDate>Wed, 01 Aug 2007 12:40:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-08-01T12:40:08Z</dc:date>
    <item>
      <title>creating new page setup from VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033608#M24082</link>
      <description>Hi,&lt;BR /&gt;
How do I create a new page setup for plotting from VBA? &lt;BR /&gt;
&lt;BR /&gt;
 I know the plotter, paper size and all other such parameters; I had to show them in a page-setup  to the user.&lt;BR /&gt;
Regards&lt;BR /&gt;
Shijith</description>
      <pubDate>Wed, 01 Aug 2007 08:10:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033608#M24082</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-01T08:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: creating new page setup from VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033609#M24083</link>
      <description>Hi Shijith,&lt;BR /&gt;
&lt;BR /&gt;
I believe it may be the "CopyFrom" method that you are looking for.&lt;BR /&gt;
&lt;BR /&gt;
Once you have setup all of your desired plot parameters in a&lt;BR /&gt;
"PlotConfiguration" you can copy them into the active layout with&lt;BR /&gt;
"CopyFrom". Something similar to the sample below.&lt;BR /&gt;
&lt;BR /&gt;
Hope it helps.&lt;BR /&gt;
&lt;BR /&gt;
Gary&lt;BR /&gt;
&lt;BR /&gt;
Dim sSetupName As String&lt;BR /&gt;
Dim oPlotConfig As AcadPlotConfiguration&lt;BR /&gt;
&lt;BR /&gt;
'Add new plot configuration&lt;BR /&gt;
sSetupName = "My_New_Setup"&lt;BR /&gt;
Set oPlotConfig = ThisDrawing.PlotConfigurations.Add(sSetupName)&lt;BR /&gt;
&lt;BR /&gt;
'Setup desired plot parameters&lt;BR /&gt;
oPlotConfig.StandardScale = ac1_2&lt;BR /&gt;
oPlotConfig.PaperUnits = acInches&lt;BR /&gt;
oPlotConfig.PlotType = acDisplay&lt;BR /&gt;
oPlotConfig.PlotRotation = ac90degrees&lt;BR /&gt;
'etc. etc.&lt;BR /&gt;
&lt;BR /&gt;
'Copy the new plot config parameters into the active layout&lt;BR /&gt;
ThisDrawing.ActiveLayout.CopyFrom ThisDrawing.PlotConfigurations(sSetupName)</description>
      <pubDate>Wed, 01 Aug 2007 12:08:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033609#M24083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-01T12:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: creating new page setup from VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033610#M24084</link>
      <description>Hi Gray,&lt;BR /&gt;
Thanks a lot for your reply. &lt;BR /&gt;
I just find a work arround, by creating a plotconfigration and calling it fom EndOpen event handler. Here is the code.&lt;BR /&gt;
&lt;BR /&gt;
Private Sub plotcorrector()&lt;BR /&gt;
Dim myconf As AcadPlotConfiguration&lt;BR /&gt;
&lt;BR /&gt;
Set myconf = ThisDrawing.PlotConfigurations.Add("MyPPlot", False)&lt;BR /&gt;
myconf.Name = "MyPlot"&lt;BR /&gt;
myconf.RefreshPlotDeviceInfo&lt;BR /&gt;
myconf.ConfigName = "\\BPC-SECONDARY\X-WC7245 - BW - PS"&lt;BR /&gt;
Dim mx(0 To 1) As Double&lt;BR /&gt;
Dim my(0 To 1) As Double&lt;BR /&gt;
mx(0) = 0&lt;BR /&gt;
mx(1) = 0&lt;BR /&gt;
my(0) = 1&lt;BR /&gt;
my(1) = 1&lt;BR /&gt;
myconf.SetWindowToPlot mx, my&lt;BR /&gt;
myconf.PlotType = acWindow&lt;BR /&gt;
myconf.StyleSheet = "tilt.ctb"&lt;BR /&gt;
myconf.PaperUnits = acMillimeters&lt;BR /&gt;
'myconf.RefreshPlotDeviceInfo&lt;BR /&gt;
myconf.CanonicalMediaName = "A3"&lt;BR /&gt;
&lt;BR /&gt;
myconf.CenterPlot = True&lt;BR /&gt;
myconf.UseStandardScale = True&lt;BR /&gt;
&lt;BR /&gt;
            myconf.StandardScale = acScaleToFit&lt;BR /&gt;
&lt;BR /&gt;
myconf.PlotWithPlotStyles = False&lt;BR /&gt;
myconf.RefreshPlotDeviceInfo&lt;BR /&gt;
&lt;BR /&gt;
ThisDrawing.Application.Update&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Wed, 01 Aug 2007 12:40:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/creating-new-page-setup-from-vba/m-p/2033610#M24084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-01T12:40:08Z</dc:date>
    </item>
  </channel>
</rss>

