<?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 SaveAs with paperspace layout current in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3298173#M57545</link>
    <description>&lt;P&gt;I have a bit of code that batch processes from a template drawing. It all works fine until I get to the SaveAs() function. I have narrowed down the problem to have something to do with the drawing starting and saving in a paperspace layout. When I run the code with the template saved in model space it works fine but whe the current tab is a paperspace layout I get an error during the saveas() function "eInvalidInput"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using VS2008 and Autocad 2011. Is there a difference in saving with a paperspace layout current?&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2012 22:04:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-18T22:04:43Z</dc:date>
    <item>
      <title>SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3298173#M57545</link>
      <description>&lt;P&gt;I have a bit of code that batch processes from a template drawing. It all works fine until I get to the SaveAs() function. I have narrowed down the problem to have something to do with the drawing starting and saving in a paperspace layout. When I run the code with the template saved in model space it works fine but whe the current tab is a paperspace layout I get an error during the saveas() function "eInvalidInput"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using VS2008 and Autocad 2011. Is there a difference in saving with a paperspace layout current?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2012 22:04:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3298173#M57545</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-18T22:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3298613#M57546</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you show the parts of your code, that:&lt;/P&gt;&lt;P&gt;a) does the opening/loading of the drawing (so we know at least is it loaded in editor or just opened the database)&lt;/P&gt;&lt;P&gt;b) what are the steps you use to change the current layout + (at least described) what happend between change to layout and save&lt;/P&gt;&lt;P&gt;c) how do you save&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think without seeing anything you do we can't answer why "save" should not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 07:27:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3298613#M57546</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-19T07:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299107#M57547</link>
      <description>&lt;P&gt;Thanks Alfred. below is the code. This code works using the CloseAndSave Method with my template drawing saved with "Layout1" as the current space but the SaveAs method does not. If I save the template drawing with Modelspace&amp;nbsp;as the current tab the SaveAs method and the CloseAndSave method both work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The exception I get is eInvalidInput using the SaveAs method in paperspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Private Function BuildProject(ByVal drSession As DataRow) As Int32&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Specify the template to use, if the template is not found&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'the default settings are used.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim strTemplatePath As String = "MyTemplate.dwt"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim acDocMgr As DocumentCollection = Application.DocumentManager&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim acDoc As Document = acDocMgr.Add(strTemplatePath)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Using acLockDoc As DocumentLock = acDoc.LockDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModifyTemplateParameters(acDoc, drSession)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'acDoc.Database.SaveAs("C:\Programming\DotNet Projects\InsightProjects\Insight(" &amp;amp; drSession("ProjectId") &amp;amp; _&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_" &amp;amp; drSession("UnitNum") &amp;amp; ").dwg", DwgVersion.Current)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acDoc.CloseAndSave("C:\Programming\DotNet Projects\InsightProjects\Insight(" &amp;amp; drSession("ProjectId") &amp;amp; _&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_" &amp;amp; drSession("UnitNum") &amp;amp; ").dwg")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return 1&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 13:51:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299107#M57547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-19T13:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299151#M57548</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you need it to be loaded into the editor? Have you tried to just go by using "&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;new database(....)&lt;/FONT&gt;".&lt;/P&gt;&lt;P&gt;I would try that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: I have not tried your code now as of limited time, so for others and other ideas .... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 14:09:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299151#M57548</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-19T14:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299189#M57549</link>
      <description>&lt;P&gt;I will ultimately be needing to plot my layouts. Do I need it to be loaded into the editor to plot?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 14:22:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299189#M57549</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-19T14:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299245#M57550</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; I will ultimately be needing to plot my layouts.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In that case YES, you have to load it into the editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 14:34:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299245#M57550</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-19T14:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299297#M57551</link>
      <description>&lt;P&gt;Thanks Alfred,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the end of the day I have to close the drawing anyway so the CloseAndSave method will work just fine. I would like to know why the SaveAs method doesn't work in this instance though as I spent a little time trying to figure out why my code didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your input.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 14:57:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299297#M57551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-19T14:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299521#M57552</link>
      <description>&lt;P&gt;I can't recall where I found this.&amp;nbsp; Worth a try maybe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;db.SaveAs(dwgfile, True, DwgVersion.Current, db.SecurityParameters)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 16:42:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299521#M57552</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2012-01-19T16:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299539#M57553</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also I have one idea now: we had a thread (sorry that I don't find it for now) where it was a difference wether you write the filename directly into the statement or you created a variable before that stores the filename + at the .SaveAs statement use then the variable instead of the string(-calculation).&lt;/P&gt;&lt;P&gt;In other words, try this:&lt;/P&gt;&lt;PRE&gt;dim tFileName as string 
tFileName = "C:\Programming\DotNet Projects\InsightProjects\Insight(" &amp;amp; _
             drSession("ProjectId") &amp;amp; "_" &amp;amp; drSession("UnitNum") &amp;amp; ").dwg"
acDoc.Database.SaveAs(&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;tFileName&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;, DwgVersion.Current)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 16:49:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299539#M57553</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-19T16:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299599#M57554</link>
      <description>&lt;P&gt;Alfred,&lt;/P&gt;&lt;P&gt;I tried your suggestion but got the same result "eInvalidInput".&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 17:17:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3299599#M57554</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-19T17:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3301617#M57555</link>
      <description>&lt;P&gt;&lt;SPAN&gt;try more reliable&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new"&gt;acDoc.Database.SaveAs(acDoc.Name, True, DwgVersion.Current, acDoc.Database.SecurityParameters)&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2012 22:40:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3301617#M57555</guid>
      <dc:creator>cincir</dc:creator>
      <dc:date>2012-01-20T22:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3302983#M57556</link>
      <description>&lt;P&gt;That works. Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2012 16:14:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3302983#M57556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-23T16:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: SaveAs with paperspace layout current</title>
      <link>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3303005#M57557</link>
      <description>&lt;P&gt;Interesting. When I set the &lt;STRONG&gt;&lt;SPAN style="color: #660000;"&gt;bBakAndRename &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #660000;"&gt;argument to false I get the "eInvalidInput" error again.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2012 16:26:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/saveas-with-paperspace-layout-current/m-p/3303005#M57557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-23T16:26:37Z</dc:date>
    </item>
  </channel>
</rss>

