<?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 Layout limits in .Net in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/layout-limits-in-net/m-p/5235739#M42816</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if there is a way to use the&amp;nbsp;interop set the limits of a Layout?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issue is that after creating&amp;nbsp;a blank layout using the LayoutManager it defaults the limits to 0,0 &amp;amp; 12,9 which causes problems when generating the thumbnail for the tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I can get it to generate a correct thumbnail by toggling display background in the options as this updates the limits of the layout object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using doc.CapturePreviewImage and assigning it to the Layout.Thumbnail so I guess the other option is have another way to generate that Bitmap all together? It seems that the&amp;nbsp;&lt;SPAN&gt;CapturePreviewImage &amp;nbsp;must use the limits as its bounding for the capture.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Aug 2014 22:31:46 GMT</pubDate>
    <dc:creator>mordend</dc:creator>
    <dc:date>2014-08-26T22:31:46Z</dc:date>
    <item>
      <title>Layout limits in .Net</title>
      <link>https://forums.autodesk.com/t5/net-forum/layout-limits-in-net/m-p/5235739#M42816</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if there is a way to use the&amp;nbsp;interop set the limits of a Layout?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issue is that after creating&amp;nbsp;a blank layout using the LayoutManager it defaults the limits to 0,0 &amp;amp; 12,9 which causes problems when generating the thumbnail for the tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I can get it to generate a correct thumbnail by toggling display background in the options as this updates the limits of the layout object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using doc.CapturePreviewImage and assigning it to the Layout.Thumbnail so I guess the other option is have another way to generate that Bitmap all together? It seems that the&amp;nbsp;&lt;SPAN&gt;CapturePreviewImage &amp;nbsp;must use the limits as its bounding for the capture.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2014 22:31:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layout-limits-in-net/m-p/5235739#M42816</guid>
      <dc:creator>mordend</dc:creator>
      <dc:date>2014-08-26T22:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Layout limits in .Net</title>
      <link>https://forums.autodesk.com/t5/net-forum/layout-limits-in-net/m-p/5256405#M42817</link>
      <description>&lt;P&gt;So I&amp;nbsp;managed to get this sorted out myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After creating the layout and copying plot settings form an existing layout I then used a&amp;nbsp;PlotSettingsValidator to set the&amp;nbsp;SetZoomToPaperOnUpdate to true and im guessing that forces an update to the limits. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; using (Transaction tr = db.TransactionManager.StartTransaction())
                {
                    Layout layout = (Layout)tr.GetObject(toLayoutID, OpenMode.ForWrite);

                    PlotSettings ps = new PlotSettings(layout.ModelType);
                    ps.CopyFrom(fromLayout);

                    PlotSettingsValidator psv = PlotSettingsValidator.Current;

                    psv.SetZoomToPaperOnUpdate(ps, true);

                    layout.UpgradeOpen();
                    layout.CopyFrom(ps);

                    tr.Commit();
                }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either way seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this will help others&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2014 15:32:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layout-limits-in-net/m-p/5256405#M42817</guid>
      <dc:creator>mordend</dc:creator>
      <dc:date>2014-09-05T15:32:53Z</dc:date>
    </item>
  </channel>
</rss>

