<?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: How to trigger a Plug In with every save? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10559103#M24272</link>
    <description>&lt;P&gt;You could use the &lt;STRONG&gt;DocumentSaved&lt;/STRONG&gt; and &lt;STRONG&gt;DocumentSavedAs&lt;/STRONG&gt; to check when something is finished to save or &lt;STRONG&gt;DocumentSaving&lt;/STRONG&gt; and &lt;STRONG&gt;DocumentSavingAs&lt;/STRONG&gt; when the document is about to save (if you want to do something before the save).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check this sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace RevitAddin12.Revit
{
    public class AppSave : IExternalApplication
    {
        public Result OnStartup(UIControlledApplication application)
        {
            application.ControlledApplication.DocumentSaved += ControlledApplication_DocumentSaved;
            application.ControlledApplication.DocumentSavedAs += ControlledApplication_DocumentSavedAs;
            return Result.Succeeded;
        }

        private void ControlledApplication_DocumentSaved(object sender, Autodesk.Revit.DB.Events.DocumentSavedEventArgs e)
        {
            TaskDialog.Show("Revit", $"Saved {e.Document.PathName}");
        }
        private void ControlledApplication_DocumentSavedAs(object sender, Autodesk.Revit.DB.Events.DocumentSavedAsEventArgs e)
        {
            TaskDialog.Show("Revit", $"SavedAs {e.Document.PathName}");
        }

        public Result OnShutdown(UIControlledApplication application)
        {
            application.ControlledApplication.DocumentSaved -= ControlledApplication_DocumentSaved;
            application.ControlledApplication.DocumentSavedAs -= ControlledApplication_DocumentSavedAs;
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See ya!&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 19:52:33 GMT</pubDate>
    <dc:creator>ricaun</dc:creator>
    <dc:date>2021-08-19T19:52:33Z</dc:date>
    <item>
      <title>How to trigger a Plug In with every save?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10558369#M24270</link>
      <description>&lt;P&gt;Hey all! Is there a way to write your plugin such that it launches whenever you save your Revit model?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if I write a toy "hello world" plugin, how can I get it to launch whenever I save the model? Is this possible or not?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generally, can you program a plugin to launch under any given trigger - i.e. when you go to close Revit, when you open Revit, when you add a certain object to a file, etc&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 15:22:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10558369#M24270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-19T15:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger a Plug In with every save?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10558790#M24271</link>
      <description>&lt;P&gt;Yes via subscribing to events such as the Document.DocumentSaving event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How you can interact with the document during some events is sometimes restricted however.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 17:39:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10558790#M24271</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-08-19T17:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger a Plug In with every save?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10559103#M24272</link>
      <description>&lt;P&gt;You could use the &lt;STRONG&gt;DocumentSaved&lt;/STRONG&gt; and &lt;STRONG&gt;DocumentSavedAs&lt;/STRONG&gt; to check when something is finished to save or &lt;STRONG&gt;DocumentSaving&lt;/STRONG&gt; and &lt;STRONG&gt;DocumentSavingAs&lt;/STRONG&gt; when the document is about to save (if you want to do something before the save).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check this sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace RevitAddin12.Revit
{
    public class AppSave : IExternalApplication
    {
        public Result OnStartup(UIControlledApplication application)
        {
            application.ControlledApplication.DocumentSaved += ControlledApplication_DocumentSaved;
            application.ControlledApplication.DocumentSavedAs += ControlledApplication_DocumentSavedAs;
            return Result.Succeeded;
        }

        private void ControlledApplication_DocumentSaved(object sender, Autodesk.Revit.DB.Events.DocumentSavedEventArgs e)
        {
            TaskDialog.Show("Revit", $"Saved {e.Document.PathName}");
        }
        private void ControlledApplication_DocumentSavedAs(object sender, Autodesk.Revit.DB.Events.DocumentSavedAsEventArgs e)
        {
            TaskDialog.Show("Revit", $"SavedAs {e.Document.PathName}");
        }

        public Result OnShutdown(UIControlledApplication application)
        {
            application.ControlledApplication.DocumentSaved -= ControlledApplication_DocumentSaved;
            application.ControlledApplication.DocumentSavedAs -= ControlledApplication_DocumentSavedAs;
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See ya!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 19:52:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10559103#M24272</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2021-08-19T19:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger a Plug In with every save?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10560157#M24273</link>
      <description>&lt;P&gt;amazing! thank you! exactly what I was after!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 07:57:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-trigger-a-plug-in-with-every-save/m-p/10560157#M24273</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-20T07:57:51Z</dc:date>
    </item>
  </channel>
</rss>

