<?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: UpdateCurrentPaper in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791012#M50985</link>
    <description>Yes, and UpdateScreen too. Only UpdateCurrentPaper seems to work.</description>
    <pubDate>Wed, 27 Feb 2013 06:41:41 GMT</pubDate>
    <dc:creator>FRFR1426</dc:creator>
    <dc:date>2013-02-27T06:41:41Z</dc:date>
    <item>
      <title>UpdateCurrentPaper</title>
      <link>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3785198#M50983</link>
      <description>&lt;P&gt;I change the paper format on a layout with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PlotSettingsValidator.SetPlotConfigurationName(layout, deviceName, media)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But the paper doesn't update when I reduce the size (A0 to A1 for example). I've found that I have to call:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;plSetVal.SetZoomToPaperOnUpdate(layout, true);
UpdateCurrentPaper(LayoutManager.Current.UnmanagedObject, true);&lt;/PRE&gt;&lt;P&gt;In order to force the update. AcApLayoutManager::updateCurrentPaper is not exposed in the .NET API, so I had to P/Invoke it. On AutoCAD 2013, I've found it in accore.dll, but I'm not able to found it on AutoCAD&amp;nbsp;2010. Someone knows where I can found it? Or a workaround? The doc says that the update may be triggered after the call to SetZoomToPaperOnUpdate by a notification, but how to force the sending of this kind of notification without updateCurrentPaper?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2013 16:24:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3785198#M50983</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2013-02-20T16:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateCurrentPaper</title>
      <link>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3790859#M50984</link>
      <description>&lt;P&gt;Have you tried to call:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Editor.Regen()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2013 22:29:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3790859#M50984</guid>
      <dc:creator>hyperpics</dc:creator>
      <dc:date>2013-02-26T22:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateCurrentPaper</title>
      <link>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791012#M50985</link>
      <description>Yes, and UpdateScreen too. Only UpdateCurrentPaper seems to work.</description>
      <pubDate>Wed, 27 Feb 2013 06:41:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791012#M50985</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2013-02-27T06:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateCurrentPaper</title>
      <link>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791092#M50986</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1027563"&gt;@FRFR1426&lt;/a&gt; wrote:&lt;BR /&gt;...AcApLayoutManager::updateCurrentPaper is not exposed in the .NET API, so I had to P/Invoke it. On AutoCAD 2013, I've found it in accore.dll, but I'm not able to found it on AutoCAD&amp;nbsp;2010. Someone knows where I can found it? Or a workaround?...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It is look like you have to write wrapper (with ObjectARX C++) for this method.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 09:28:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791092#M50986</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-02-27T09:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateCurrentPaper</title>
      <link>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791417#M50987</link>
      <description>&lt;P&gt;I have used the following code to update the paper size and other properties of a plot settings object for a layout without any problems.&amp;nbsp; Maybe it will help you.&amp;nbsp; If not, then the only other option is to P/Invoke the method you mention.&amp;nbsp; I do remember having some strange issues with getting the paper size to display correctly when I was working on my AU handouts, but did manage to work around it though and did not need to P/Invoke any extra functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.PlottingServices

' Creates a new page setup or edits the page set if it exists
&amp;lt;CommandMethod("CreateOrEditPageSetup")&amp;gt; _
Public Shared Sub CreateOrEditPageSetup()
    ' Get the current document and database, and start a transaction
    Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
    Dim acCurDb As Database = acDoc.Database

    Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()

        Dim plSets As DBDictionary = _
            acTrans.GetObject(acCurDb.PlotSettingsDictionaryId, OpenMode.ForRead)
        Dim vStyles As DBDictionary = _
            acTrans.GetObject(acCurDb.VisualStyleDictionaryId, OpenMode.ForRead)

        Dim acPlSet As PlotSettings
        Dim createNew As Boolean = False

        ' Reference the Layout Manager
        Dim acLayoutMgr As LayoutManager = LayoutManager.Current

        ' Get the current layout and output its name in the Command Line window
        Dim acLayout As Layout = _
            acTrans.GetObject(acLayoutMgr.GetLayoutId(acLayoutMgr.CurrentLayout), _
                              OpenMode.ForRead)

        ' Check to see if the page setup exists
        If plSets.Contains("MyPageSetup") = False Then
            createNew = True

            ' Create a new PlotSettings object: 
            '    True - model space, False - named layout
            acPlSet = New PlotSettings(acLayout.ModelType)
            acPlSet.CopyFrom(acLayout)

            acPlSet.PlotSettingsName = "MyPageSetup"
            acPlSet.AddToPlotSettingsDictionary(acCurDb)
            acTrans.AddNewlyCreatedDBObject(acPlSet, True)
        Else
            acPlSet = plSets.GetAt("MyPageSetup").GetObject(OpenMode.ForWrite)
        End If

        ' Update the PlotSettings object
        Try
            Dim acPlSetVdr As PlotSettingsValidator = PlotSettingsValidator.Current

            ' Set the Plotter and page size
            acPlSetVdr.SetPlotConfigurationName(acPlSet, _
                                                "DWF6 ePlot.pc3", _
                                                "ANSI_B_(17.00_x_11.00_Inches)")

            ' Set to plot to the current display
            If acLayout.ModelType = False Then
                acPlSetVdr.SetPlotType(acPlSet, _
                                       DatabaseServices.PlotType.Layout)
            Else
                acPlSetVdr.SetPlotType(acPlSet, _
                                       DatabaseServices.PlotType.Extents)

                acPlSetVdr.SetPlotCentered(acPlSet, True)
            End If

            ' Use SetPlotWindowArea with PlotType.Window
            'acPlSetVdr.SetPlotWindowArea(plSet, _
            '                             New Extents2d(New Point2d(0.0, 0.0), _
            '                             New Point2d(9.0, 12.0)))

            ' Use SetPlotViewName with PlotType.View
            'acPlSetVdr.SetPlotViewName(plSet, "MyView")

            ' Set the plot offset
            acPlSetVdr.SetPlotOrigin(acPlSet, _
                                     New Point2d(0, 0))

            ' Set the plot scale
            acPlSetVdr.SetUseStandardScale(acPlSet, True)
            acPlSetVdr.SetStdScaleType(acPlSet, StdScaleType.ScaleToFit)
            acPlSetVdr.SetPlotPaperUnits(acPlSet, PlotPaperUnit.Inches)
            acPlSet.ScaleLineweights = True

            ' Specify if plot styles should be displayed on the layout
            acPlSet.ShowPlotStyles = True

            ' Rebuild plotter, plot style, and canonical media lists 
            ' (must be called before setting the plot style)
            acPlSetVdr.RefreshLists(acPlSet)

            ' Specify the shaded viewport options
            acPlSet.ShadePlot = PlotSettingsShadePlotType.AsDisplayed

            acPlSet.ShadePlotResLevel = ShadePlotResLevel.Normal

            ' Specify the plot options
            acPlSet.PrintLineweights = True
            acPlSet.PlotTransparency = False
            acPlSet.PlotPlotStyles = True
            acPlSet.DrawViewportsFirst = True

            ' Use only on named layouts - Hide paperspace objects option
            ' plSet.PlotHidden = True

            ' Specify the plot orientation
            acPlSetVdr.SetPlotRotation(acPlSet, PlotRotation.Degrees000)

            ' Set the plot style
            If acCurDb.PlotStyleMode = True Then
                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "acad.ctb")
            Else
                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "acad.stb")
            End If

            ' Zoom to show the whole paper
            acPlSetVdr.SetZoomToPaperOnUpdate(acPlSet, True)
        Catch es As Autodesk.AutoCAD.Runtime.Exception
            MsgBox(es.Message)
        End Try

        ' Save the changes made
        acTrans.Commit()

        If createNew = True Then
            acPlSet.Dispose()
        End If
    End Using
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 15:27:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/updatecurrentpaper/m-p/3791417#M50987</guid>
      <dc:creator>hyperpics</dc:creator>
      <dc:date>2013-02-27T15:27:05Z</dc:date>
    </item>
  </channel>
</rss>

