<?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: Add Plot Config Not saving to current Dwg in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3070572#M60515</link>
    <description>&lt;P&gt;Please accept my apologies… I missed very simple and basic step of adding the new plot setting to current “Transaction”.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;CommandMethod("AddMyPlot")&amp;gt; _
            Public Sub AddPlotSetting_test()
        Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database

        Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction
            Dim pl As PlotSettings = New PlotSettings(True)
            Dim layoutId As ObjectId = LayoutManager.Current.GetLayoutId(LayoutManager.Current.CurrentLayout)
            Dim activeLyt As Layout = currentTransaction.GetObject(layoutId, OpenMode.ForRead)
            pl.CopyFrom(activeLyt)

            pl.PlotSettingsName = "Test"

            'set other setting

            Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current
            psv.RefreshLists(pl)

            pl.AddToPlotSettingsDictionary(CurrentDatabase)
            currentTransaction.AddNewlyCreatedDBObject(pl, True)
            psv.RefreshLists(pl)

            currentTransaction.Commit()
        End Using
    End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2011 06:04:24 GMT</pubDate>
    <dc:creator>Virupaksha_aithal</dc:creator>
    <dc:date>2011-06-24T06:04:24Z</dc:date>
    <item>
      <title>Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3056868#M60509</link>
      <description>&lt;P&gt;The Pagesetup isn't showing up in the Pagesetup dialog.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I close the drawing and open it up it's visible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing here? Still new with this transaction concept...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  &amp;lt;CommandMethod("aps")&amp;gt; _
Public Sub AddPlotSetting()
       

        'TODO: Finish Cleaning Print Function


        Dim s_PlotSettingsFile As String = "c:\test.dwg
        Dim s_PageSetupName As String = "catdog"
        Dim s_MediaName As String = "11 x 17"
        Dim s_PlotDeviceName As String = "\\rdops1\RDO0071"
        Dim s_StyleSheetName As String = "Monochrome.ctb"
        Dim d_PaperHeight As Double = 11
        Dim d_PaperWidth As Double = 17
        Dim is_PlotStyles As Boolean = True
        Dim int_PlotRotation As PlotRotation = PlotRotation.Degrees000
        Dim int_PlotType As Autodesk.AutoCAD.DatabaseServices.PlotType = Autodesk.AutoCAD.DatabaseServices.PlotType.Extents
        Dim int_StandardScale As Integer = StdScaleType.ScaleToFit
        Dim is_PlotCentered As Boolean = True

        Dim myPoint As New Autodesk.AutoCAD.Geometry.Point2d(2, 4)

        Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database
      
        Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction
       
            'TODO: Confirm New Print Object is Created 
            'Create PlotSetting
            Dim pl As PlotSettings = New PlotSettings(True)


            'Set the PageSetup Name
            pl.PlotSettingsName = s_PageSetupName

            'Create PlotSettingsValidator
            Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current

            'Set Plot Type
            psv.SetPlotType(pl, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents)

            'set plot scale
            psv.SetUseStandardScale(pl, True)
            psv.SetStdScaleType(pl, StdScaleType.ScaleToFit)
            'psv.SetStdScale(pl, 0.0)

            'Center the plot
            psv.SetPlotCentered(pl, True)

            'Rotation
            psv.SetPlotRotation(pl, PlotRotation.Degrees000)
            psv.SetPlotOrigin(pl, myPoint)

            'Set Media Size
            psv.SetCanonicalMediaName(pl, "Letter")
            'psv.SetClosestMediaName(pl, d_PaperWidth, d_PaperHeight, PlotPaperUnit.Inches, True)

            'TODO: Validate StyleSheetName
            psv.SetCurrentStyleSheet(pl, s_StyleSheetName)

            '' Set the plot device to use
            psv.SetPlotConfigurationName(pl, s_PlotDeviceName, "Letter")

            'Make Default PageSetup Yes/No?
            ' psv.SetDefaultPlotConfig(pl)

            'Add to Plot Settings to Drawing Database
            pl.AddToPlotSettingsDictionary(CurrentDatabase)

            currentTransaction.Commit()
        End Using


    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2011 17:52:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3056868#M60509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-13T17:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3058536#M60510</link>
      <description>&lt;P&gt;Let me Clarify... The pagesetup does indeed add but it doesn't show up in the pagesetup window.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I switch viewports then type pagesetup the pagesetup shows up after I see this message&lt;/P&gt;&lt;P&gt;"Restoring cached viewports﻿"&lt;/P&gt;&lt;P&gt;But it only works when it Restores cached viewports....&lt;/P&gt;&lt;P&gt;How do I refresh the Autocad viewport in .NET? I tried Regen not luck there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2011 17:44:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3058536#M60510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-14T17:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3060952#M60511</link>
      <description>&lt;P&gt;Try coping “PlotSettings” from current plot setting and then try to modify its values as you require. Please refer below code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;CommandMethod("aps_test")&amp;gt; _
        Public Sub AddPlotSetting_test()
            Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database

            Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction
                Dim pl As PlotSettings = New PlotSettings(True)
                Dim layoutId As ObjectId = LayoutManager.Current.GetLayoutId(LayoutManager.Current.CurrentLayout)
                Dim activeLyt As Layout = currentTransaction.GetObject(layoutId, OpenMode.ForRead)
                pl.CopyFrom(activeLyt)

                pl.PlotSettingsName = "Test"

                'set other setting

                Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current
                psv.RefreshLists(pl)

                pl.AddToPlotSettingsDictionary(CurrentDatabase)

                currentTransaction.Commit()
            End Using
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Virupaksha Aithal&lt;/P&gt;&lt;P&gt;Autodesk Developer Network&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2011 08:54:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3060952#M60511</guid>
      <dc:creator>Virupaksha_aithal</dc:creator>
      <dc:date>2011-06-16T08:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3062302#M60512</link>
      <description>&lt;P&gt;I get mixed results from this code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One-time it worked. On another drawing it errors out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a new drawing it doesn't work sometimes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;On my latest try... it just doesn't show it exists to the user GUI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used your code exactly as shown.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 122 is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;pl.CopyFrom(activeLyt)﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Maybe I should ask more about how the Plotsettings objects are structured in the drawing.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;When I add a new plot setting should I use this method... maybe?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;lytobjid being the LayoutObjectID from Modelspace&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;-Dim pl As PlotSettings = lytobjID.GetObject(OpenMode.ForWrite)﻿&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;or use&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;-or pl.copyfrom(CurrentLayout)?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Does this copy from an existing layout that already exists... does this assume that a pagesetup already exists?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;PRE&gt;Autodesk.AutoCAD.Runtime.Exception was unhandled by user code
  Message="eWrongObjectType"
  Source="acdbmgd"
  StackTrace:
       at Autodesk.AutoCAD.Runtime.RXObject.CopyFrom(RXObject source)
       at ClassAutocad2011.clsPlotting.AddPlotSetting_test() in C:\Visual Studio Projects\ClassAutocad2011\ClassAutocad2011\Autocad Main\Autocad Library\Classes\clsPlotting.vb:line 122
       at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
       at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
       at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
       at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
  InnerException: &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I ran this code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; &amp;lt;CommandMethod("aps_test")&amp;gt; _
        Public Sub AddPlotSetting_test()
        Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database

        Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction
            Dim pl As PlotSettings = New PlotSettings(True)
            Dim layoutId As ObjectId = LayoutManager.Current.GetLayoutId(LayoutManager.Current.CurrentLayout)
            Dim activeLyt As Layout = currentTransaction.GetObject(layoutId, OpenMode.ForRead)
            pl.CopyFrom(activeLyt)

            pl.PlotSettingsName = "Test"

            'set other setting

            Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current
            psv.RefreshLists(pl)

            pl.AddToPlotSettingsDictionary(CurrentDatabase)

            currentTransaction.Commit()
        End Using
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2011 22:56:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3062302#M60512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-16T22:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3064730#M60513</link>
      <description>&lt;P&gt;I tested the code provided in my previous response. Code works fine consistently. I am testing against AutoCAD 2012.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steps followed at my end:&lt;/P&gt;
&lt;P&gt;Start AutoCAD 2012&lt;/P&gt;
&lt;P&gt;Netload the .net application.&lt;/P&gt;
&lt;P&gt;Issue command “aps_test”&lt;/P&gt;
&lt;P&gt;Issue command “pagesetup” to verify the adding of &amp;nbsp;“PlotSettings”.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;EM&gt;pl.copyfrom(CurrentLayout)?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;“CopyFrom” API makes sure that the new “PlotSettings” is initialized correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2011 11:07:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3064730#M60513</guid>
      <dc:creator>Virupaksha_aithal</dc:creator>
      <dc:date>2011-06-20T11:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3065126#M60514</link>
      <description>&lt;P&gt;Hi Virupaksha,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for taking the time to respond to my question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your reference I attached my sample project solution stripped down to the bare essentials.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done the following.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Disable my Class2011Autocad from the registry from Autoloading.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running Autocad 2011&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.208.0.0 (English Version 3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My DLL's are: (I'm using the ones included in c:\ObjectARX 2011\inc)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AcDbMgd .NET 18.1.0.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AcMgd .NET 18.1.0.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've set copy local to "FALSE"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did notice that the DLL's in the (C:\Program Files\Autodesk\AutoCAD 2011﻿)&lt;/P&gt;&lt;P&gt;AcDbMgd .NET 18.1.115.0&lt;/P&gt;&lt;P&gt;AcMgd &amp;nbsp;.Net &amp;nbsp;18.1.208.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Opended Autocad 2011.&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;NETLOAD&amp;nbsp;TestPlotCode.dll﻿&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Typed showmsg -Success!&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;then typed addmyplot -Command recognized&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;then typed pagesetup&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It doesn't show in the pagesetup manager. (See image 1)&lt;/P&gt;&lt;P&gt;But when I press new pagesetup it shows in the list of available options. (see image2)&lt;/P&gt;&lt;P&gt;As you can see.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does work... but not intially. This is not the the way it is intended to work is it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IMAGE 1&lt;/P&gt;&lt;P&gt;&lt;IMG align="center" title="PAGESETUPMANAGER.png" alt="PAGESETUPMANAGER.png" src="http://forums.autodesk.com/t5/image/serverpage/image-id/9358i4B72EE5EAEC5035A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the pagesetup does show.&amp;nbsp;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IMAGE 2&lt;/P&gt;&lt;P&gt;&lt;IMG align="center" title="NEWPAGESETUP.png" alt="NEWPAGESETUP.png" src="http://forums.autodesk.com/t5/image/serverpage/image-id/9360iF7DBF0E2A5A7832A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IMAGE 3&lt;IMG align="center" title="afterswitchingtabs.png" alt="afterswitchingtabs.png" src="http://forums.autodesk.com/t5/image/serverpage/image-id/9364iFF517C2671CCD589/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Then the pagesetup does show. (see image3)﻿&lt;/P&gt;&lt;P&gt;When I click on layout 1 and then back at model tab.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again thank you so much for looking into this problem!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:56:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3065126#M60514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-20T15:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3070572#M60515</link>
      <description>&lt;P&gt;Please accept my apologies… I missed very simple and basic step of adding the new plot setting to current “Transaction”.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;CommandMethod("AddMyPlot")&amp;gt; _
            Public Sub AddPlotSetting_test()
        Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database

        Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction
            Dim pl As PlotSettings = New PlotSettings(True)
            Dim layoutId As ObjectId = LayoutManager.Current.GetLayoutId(LayoutManager.Current.CurrentLayout)
            Dim activeLyt As Layout = currentTransaction.GetObject(layoutId, OpenMode.ForRead)
            pl.CopyFrom(activeLyt)

            pl.PlotSettingsName = "Test"

            'set other setting

            Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current
            psv.RefreshLists(pl)

            pl.AddToPlotSettingsDictionary(CurrentDatabase)
            currentTransaction.AddNewlyCreatedDBObject(pl, True)
            psv.RefreshLists(pl)

            currentTransaction.Commit()
        End Using
    End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2011 06:04:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3070572#M60515</guid>
      <dc:creator>Virupaksha_aithal</dc:creator>
      <dc:date>2011-06-24T06:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add Plot Config Not saving to current Dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3071168#M60516</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Thank you so much Virupaksha!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;That resolved the issue.&lt;/P&gt;&lt;P&gt;Being someone learning the Vb.NET object model from scratch and coming from VBA this is a life saver!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for future reference those who have this problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't forget.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000" size="4"&gt;&lt;STRONG&gt;currentTransaction.AddNewlyCreatedDBObject(pl, True)﻿&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again the steps are: (If I understand it correctly)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;1. Open Drawing Transaction&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;' Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;FONT color="#808080"&gt;' Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction﻿&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;FONT color="#808080"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;2. Create New PlotSetting with&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;FONT color="#808080"&gt;'Dim pl As PlotSettings = New PlotSettings(True)﻿&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;FONT color="#808080"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;3. Get (Active/Current) Layout ID (Model/Paper Space)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;'Dim layoutId As ObjectId = LayoutManager.Current.GetLayoutId(LayoutManager.Current.CurrentLayout)﻿&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;'Dim activeLyt As Layout = currentTransaction.GetObject(layoutId, OpenMode.ForRead)﻿&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;4. Use CopyFrom property of the plotsetting to intialize it on the Layout&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;(“CopyFrom” API makes sure that the new “PlotSettings” is initialized correctly.﻿)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;'pl.CopyFrom(activeLyt)﻿&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;4.B Use Plot Settings Validator&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;'Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current﻿&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;5. Add to the PlotSettings Dictionary (Adds to the Drawing Database)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;'pl.AddToPlotSettingsDictionary(CurrentDatabase)﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;6. AddNewlyCreatedDBOject to the Transaction (Adds it to the Transaction)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;' currentTransaction.AddNewlyCreatedDBObject(pl, True)﻿&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;7. Refresh the The Plotsettings with Plotsettings Validator&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;' psv.RefreshLists(pl)﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;8. Commit Current Transaction&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;' currentTransaction.Commit()﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#888888"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2011 14:28:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/add-plot-config-not-saving-to-current-dwg/m-p/3071168#M60516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-24T14:28:14Z</dc:date>
    </item>
  </channel>
</rss>

