<?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: Changing Current Layout and Plot Page Setup Programatically in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4326832#M48775</link>
    <description>&lt;P&gt;Awesome~!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Document doc = Application.DocumentManager.Add("acad");
DocumentLock docLock = doc.LockDocument();
Database db = doc.Database;

using (Transaction tr = db.TransactionManager.StartTransaction())
{
	LayoutManager lm = LayoutManager.Current;
	Layout layoutObj;
	DBDictionary layoutDict;

	using (layoutDict = tr.GetObject(db.LayoutDictionaryId, OpenMode.ForRead) as DBDictionary)
	{
		foreach (System.Collections.DictionaryEntry de in layoutDict)
		{
			using (layoutObj = tr.GetObject((ObjectId)(de.Value), OpenMode.ForRead) as Layout)
			{
				lm.CurrentLayout = layoutObj.LayoutName;
			}
		}
	}

	tr.Commit();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One down!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I need to figure out how to change the page setup programmatically, so I can batch print multiple drawings at once!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2013 12:26:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-11T12:26:11Z</dc:date>
    <item>
      <title>Changing Current Layout and Plot Page Setup Programatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4324991#M48773</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I failed to implement auto-batch-plotting(printing), I decided to do it semi-automatically.&lt;/P&gt;&lt;P&gt;I am going to open each drawing and change the current layout to paperspace1 and set the plot page settings, and then close and save the document.&lt;/P&gt;&lt;P&gt;So now, my problem is chainging current layout of the opened document and manipulating plot page settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even a little hint or sample code snippet would be very appreciated. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI, I am currently using Object ARX 2007 with C#.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jake&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2013 06:05:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4324991#M48773</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-10T06:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Current Layout and Plot Page Setup Programatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4325621#M48774</link>
      <description>&lt;P&gt;There is plenty of code here for changing layouts. &amp;nbsp;Try keyword search "layoutname".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is some vb code here &lt;A target="_blank" href="https://forums.autodesk.com/t5/NET/Layouts-and-Viewports/td-p/3128748"&gt;http://forums.autodesk.com/t5/NET/Layouts-and-Viewports/td-p/3128748&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2013 14:17:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4325621#M48774</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2013-07-10T14:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Current Layout and Plot Page Setup Programatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4326832#M48775</link>
      <description>&lt;P&gt;Awesome~!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Document doc = Application.DocumentManager.Add("acad");
DocumentLock docLock = doc.LockDocument();
Database db = doc.Database;

using (Transaction tr = db.TransactionManager.StartTransaction())
{
	LayoutManager lm = LayoutManager.Current;
	Layout layoutObj;
	DBDictionary layoutDict;

	using (layoutDict = tr.GetObject(db.LayoutDictionaryId, OpenMode.ForRead) as DBDictionary)
	{
		foreach (System.Collections.DictionaryEntry de in layoutDict)
		{
			using (layoutObj = tr.GetObject((ObjectId)(de.Value), OpenMode.ForRead) as Layout)
			{
				lm.CurrentLayout = layoutObj.LayoutName;
			}
		}
	}

	tr.Commit();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One down!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I need to figure out how to change the page setup programmatically, so I can batch print multiple drawings at once!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2013 12:26:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4326832#M48775</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-11T12:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Current Layout and Plot Page Setup Programatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4327027#M48776</link>
      <description>&lt;P&gt;Glad you found it. &amp;nbsp;IMO Kean Walmsley has the best examples for plotting - this is 1 of them&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://through-the-interface.typepad.com/through_the_interface/2007/10/previewing-an-1.html"&gt;http://through-the-interface.typepad.com/through_the_interface/2007/10/previewing-an-1.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search plotting at that site for others - they are c# for the most part.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2013 14:14:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/changing-current-layout-and-plot-page-setup-programatically/m-p/4327027#M48776</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2013-07-11T14:14:11Z</dc:date>
    </item>
  </channel>
</rss>

