<?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: Automatically export all sheets as Autocad files in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9684607#M36245</link>
    <description>&lt;P&gt;Hi Klaus,&lt;/P&gt;&lt;P&gt;Firstly, thanks for accepting my answer as a solution.&lt;/P&gt;&lt;P&gt;I implemented this code to Revit DA4R (Design Automation For Revit) and it now works in the cloud.&lt;/P&gt;&lt;P&gt;Here is the link&amp;nbsp;&lt;A href="https://sheetexporter.herokuapp.com/" target="_blank" rel="noopener"&gt;Sheet Exporter on Forge&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try it, just select files from your computer than in the left panel download links will appear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Multiple file selection works.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2020 10:02:30 GMT</pubDate>
    <dc:creator>recepagah12</dc:creator>
    <dc:date>2020-08-11T10:02:30Z</dc:date>
    <item>
      <title>Automatically export all sheets as Autocad files</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9353379#M36240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just found some examples on writing ADDINs for Revit - but none how to automate Revit without user interaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to automate the following for a batch export:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Start Revit - if not started&lt;/LI&gt;&lt;LI&gt;Open a Revit file&lt;/LI&gt;&lt;LI&gt;Export all Sheets as Autocad files to a defined folder&lt;/LI&gt;&lt;LI&gt;Close Revit&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is there a way to do this without any interaction of any user?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 18:29:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9353379#M36240</guid>
      <dc:creator>klaus.kapeller</dc:creator>
      <dc:date>2020-03-02T18:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically export all sheets as Autocad files</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9353881#M36241</link>
      <description>&lt;P&gt;I think your best deal is FORGE DA4R(Design Automation for Revit). It is really good for tasks like that and you don't even have to own Revit license.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if you want to have a desktop app, you can create a IExternalDBApplication Interface that implements, every time you open a new document, it exports sheet then you can subscribe it manually once and for all.&lt;/P&gt;&lt;P&gt;In another Windows Desktop Console Application, you can implement open revit file then close it so on.&lt;/P&gt;&lt;P&gt;I wrote some code for this hope that helps. Need some polishing though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is IExternalDBApplication Interface&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class sheetExporterDB : IExternalDBApplication
    {
        public ExternalDBApplicationResult OnShutdown(ControlledApplication application)
        {
            application.DocumentOpened -= Application_DocumentOpened;
            return ExternalDBApplicationResult.Succeeded;
        }

        public ExternalDBApplicationResult OnStartup(ControlledApplication application)
        {
            application.DocumentOpened += Application_DocumentOpened;
            return ExternalDBApplicationResult.Succeeded;
        }

        private void Application_DocumentOpened(object sender, Autodesk.Revit.DB.Events.DocumentOpenedEventArgs e)
        {
            Document doc = e.Document;

            using (Transaction t = new Transaction(doc))
            {
                // Start the transaction
                t.Start("Export Sheets DWG");
                try
                {
                    var viewSheets = new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).Cast&amp;lt;ViewSheet&amp;gt;();

                    // create DWG export options
                    DWGExportOptions dwgOptions = new DWGExportOptions();
                    dwgOptions.MergedViews = true;
                    dwgOptions.SharedCoords = true;
                    dwgOptions.FileVersion = ACADVersion.R2013;

                    List&amp;lt;ElementId&amp;gt; views = new List&amp;lt;ElementId&amp;gt;();

                    foreach (var sheet in viewSheets)
                    {
                        if (!sheet.IsPlaceholder)
                        {
                            views.Add(sheet.Id);
                        }
                    }
                    doc.Export(@"D:\sheetExporterLocation","TEST.dwg", views, dwgOptions);
                }
                catch (Exception ex)
                {
                }
                // Commit the transaction
                t.Commit();
            }
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the console app&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;static void Main(string[] args)
        {
            Process p = new Process();
            ProcessStartInfo psi = new ProcessStartInfo()
            {
                WindowStyle = ProcessWindowStyle.Hidden,
                // Project Location
                FileName = @"D:\forgeWindowTest.rvt"
            };
            p.StartInfo = psi;
            p.Start();
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Recep.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 21:51:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9353881#M36241</guid>
      <dc:creator>recepagah12</dc:creator>
      <dc:date>2020-03-02T21:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically export all sheets as Autocad files</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9353908#M36242</link>
      <description>&lt;P&gt;In IExternalDBApplication, if you add doc.Close();&lt;/P&gt;&lt;P&gt;It will automatically close the document after processing. Also, I just tested with some RVT files and it works well.&lt;/P&gt;&lt;P&gt;If you have any problem please ask.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 22:01:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9353908#M36242</guid>
      <dc:creator>recepagah12</dc:creator>
      <dc:date>2020-03-02T22:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically export all sheets as Autocad files</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9628151#M36243</link>
      <description>&lt;P&gt;Thanks and sorry for do not give any replies.&lt;/P&gt;&lt;P&gt;But due to corona and holydays i was in short work and had no time to proceed with that topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully I will have time to work on t the next month...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will give you an answer&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 09:46:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9628151#M36243</guid>
      <dc:creator>klaus.kapeller</dc:creator>
      <dc:date>2020-07-10T09:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically export all sheets as Autocad files</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9682068#M36244</link>
      <description>&lt;P&gt;&lt;EM&gt;Hi and thanks a lot....it works really fine.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I added an addin manifest in C:\ProgramData\Autodesk\Revit\Addins\2019\MyFirstRevitPlugin.addin:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR /&gt;&amp;lt;RevitAddIns&amp;gt;&lt;BR /&gt;&amp;lt;AddIn Type="Application"&amp;gt;&lt;BR /&gt;&amp;lt;Name&amp;gt;Export DWGs&amp;lt;/Name&amp;gt;&lt;BR /&gt;&amp;lt;Assembly&amp;gt;D:\data\SourceCodes\dotNET\Revit\FirstPlugIn\FirstRevit\FirstRevit\bin\Debug\MyFirstRevitPlugin.dll&amp;lt;/Assembly&amp;gt;&lt;BR /&gt;&amp;lt;AddInId&amp;gt;78BD1446-1817-4842-8075-591B0424ACAB&amp;lt;/AddInId&amp;gt;&lt;BR /&gt;&amp;lt;FullClassName&amp;gt;MyFirstRevitPlugin.Application_DocumentOpened&amp;lt;/FullClassName&amp;gt;&lt;BR /&gt;&amp;lt;VendorId&amp;gt;&amp;lt;/VendorId&amp;gt;&lt;BR /&gt;&amp;lt;VendorDescription&amp;gt;&amp;lt;/VendorDescription&amp;gt;&lt;BR /&gt;&amp;lt;/AddIn&amp;gt;&lt;BR /&gt;&amp;lt;/RevitAddIns&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and it worked fine as designed.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Now I have to clarify the process with the engineers and do the implementation in our process...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Klaus&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 09:55:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9682068#M36244</guid>
      <dc:creator>klaus.kapeller</dc:creator>
      <dc:date>2020-08-10T09:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically export all sheets as Autocad files</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9684607#M36245</link>
      <description>&lt;P&gt;Hi Klaus,&lt;/P&gt;&lt;P&gt;Firstly, thanks for accepting my answer as a solution.&lt;/P&gt;&lt;P&gt;I implemented this code to Revit DA4R (Design Automation For Revit) and it now works in the cloud.&lt;/P&gt;&lt;P&gt;Here is the link&amp;nbsp;&lt;A href="https://sheetexporter.herokuapp.com/" target="_blank" rel="noopener"&gt;Sheet Exporter on Forge&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try it, just select files from your computer than in the left panel download links will appear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Multiple file selection works.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 10:02:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/automatically-export-all-sheets-as-autocad-files/m-p/9684607#M36245</guid>
      <dc:creator>recepagah12</dc:creator>
      <dc:date>2020-08-11T10:02:30Z</dc:date>
    </item>
  </channel>
</rss>

