<?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: Delete Layout using c# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13080222#M2304</link>
    <description>&lt;P&gt;You should also get rid of the Transaction because I don't think it's needed when calling DeleteLayout(), and could be the cause of the problem.&lt;/P&gt;</description>
    <pubDate>Sat, 12 Oct 2024 03:59:31 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2024-10-12T03:59:31Z</dc:date>
    <item>
      <title>Delete Layout using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13079605#M2302</link>
      <description>&lt;P&gt;I have around a thousand files I need to change.&amp;nbsp; I update the titleblock and that is working fine.&amp;nbsp; I am trying to delete the Layout called Layout2, but it doesn't work.&amp;nbsp; This is the part of the code I'm using.&amp;nbsp; I don't have the drawing open in the editor because it saves so much time.&amp;nbsp; Does anyone know why it's not doing anything?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  public void PTDrawing(Database currentDb, MainForm control, string sheetName, string sheetType, Microsoft.Office.Interop.Excel.Worksheet tbExcel)
  {
      using (Transaction acTrans = currentDb.TransactionManager.StartTransaction())
      {
 LayoutManager.Current.DeleteLayout("Layout2");
    acTrans.Commit();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 18:36:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13079605#M2302</guid>
      <dc:creator>lvthunder</dc:creator>
      <dc:date>2024-10-11T18:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Layout using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13079636#M2303</link>
      <description>&lt;P&gt;See if this works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void PTDrawing(Database currentDb, MainForm control, string sheetName, string sheetType, Microsoft.Office.Interop.Excel.Worksheet tbExcel)
{
   Database prevWorkingDb = HostApplicationServices.WorkingDatabase;
   HostApplicationServices.WorkingDatabase = currentDb;
   try
   {
      LayoutManager.Current.DeleteLayout("Layout2");
   }
   finally
   {
      HostApplicationServices.WorkingDatabase = prevWorkingDb;
   }

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 04:01:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13079636#M2303</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-10-12T04:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Layout using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13080222#M2304</link>
      <description>&lt;P&gt;You should also get rid of the Transaction because I don't think it's needed when calling DeleteLayout(), and could be the cause of the problem.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 03:59:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13080222#M2304</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-10-12T03:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Layout using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13084120#M2305</link>
      <description>&lt;P&gt;Thanks that worked.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 20:48:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/delete-layout-using-c/m-p/13084120#M2305</guid>
      <dc:creator>lvthunder</dc:creator>
      <dc:date>2024-10-14T20:48:21Z</dc:date>
    </item>
  </channel>
</rss>

