<?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: Trigger when adding new element. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953570#M68860</link>
    <description>&lt;P&gt;Hello Revitalizer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your post.. I followed Tim's code. Again, it's only working when modifying an element. But not when the element is newly added (drawn). And when i replaced:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Element.GetChangeTypeAny()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ChangeType.ConcatenateChangeTypes(Element.GetChangeTypeGeometry(), Element.GetChangeTypeElementAddition())&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like you suggested, i got this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Third party updater 'WatcherUpdater' has experienced a problem and its action had to be canceled.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached my complete code in this post. If you can have a look i would really appreciate it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M. Fadel&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2015 09:43:07 GMT</pubDate>
    <dc:creator>mohd.fadel</dc:creator>
    <dc:date>2015-12-16T09:43:07Z</dc:date>
    <item>
      <title>Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952018#M68851</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still not quite sure if i get this right. Using a &lt;STRONG&gt;Dynamic Model&lt;/STRONG&gt; &lt;STRONG&gt;Update&lt;/STRONG&gt;, the &lt;STRONG&gt;GetAddedElementIds()&lt;/STRONG&gt; function&amp;nbsp; retrieves added parameters, or added elements?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean, when i'm using GetAddedElementIds(), i'm waiting for a parameter to be added to the element, or i'm waiting for the user to draw a new element?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to set a parameter's value for newly drawn elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                foreach (ElementId id in
                  data.GetAddedElementIds())//.GetModifiedElementIds())
                {
                    &amp;nbsp;Element elem = doc.GetElement(id);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParameterSet parameters = elem.Parameters;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Parameter param in parameters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (param.Definition.Name == "TEST")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  switch (param.StorageType)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        case Autodesk.Revit.DB.StorageType.String:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!String.IsNullOrWhiteSpace(param.AsString()))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.SetValueString(elem.UniqueId.ToString());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Set(elem.UniqueId.ToString());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
                }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I'm able to set the value if i use &lt;STRONG&gt;GetModifiedElementIds() &lt;/STRONG&gt;and just try to modify an exiting element's parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.Fadel&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 13:31:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952018#M68851</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-15T13:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952167#M68852</link>
      <description>&lt;P&gt;Dear M. Fadel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simpler way of obtaining newly added elements is to subscribe to the DocumentChanged method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it does not allow you to modify the document in the same transaction as the action that triggered it, like the dynamic model update does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a comparison of the two approaches:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/06/documentchanged-versus-dynamic-model-updater.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2012/06/documentchanged-versus-dynamic-model-updater.html&lt;/A&gt;&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;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 14:47:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952167#M68852</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-12-15T14:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952232#M68853</link>
      <description>&lt;P&gt;Hello Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply. I'm aware of both approaches and how the first is read-only (that was my starting point).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to work with the IUpdater class after a long struggle (not easy to work with). But like i said, i'm only being able to &lt;STRONG&gt;GetModifiedElementIds(). &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i try &lt;STRONG&gt;GetAddedElementIds()&lt;/STRONG&gt; to simply output a message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;          foreach (ElementId id in data.GetAddedElementIds())
                {
                    System.Windows.Forms.MessageBox.Show("Hello");
                }&lt;/PRE&gt;&lt;P&gt;it's not working. Is there a special way to draw a new element (for example Column) to the Revit project?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.Fadel&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 15:17:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952232#M68853</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-15T15:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952298#M68854</link>
      <description>&lt;P&gt;Thank you for your appreciation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad you know what you are doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course it is not working!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every call to the method returns a new list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you call it several times in a row, all except the first call will return an empty list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Store the result of the first call to&amp;nbsp;GetAddedElementIds in a suitable container, and then iterate over that instead of calling it anew every time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 15:45:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952298#M68854</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-12-15T15:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952332#M68855</link>
      <description>&lt;P&gt;Oh!! I thought &lt;STRONG&gt;GetAddedElementIds()&lt;/STRONG&gt; was the final list (usable by the program).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, I have 2 questions in this case:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1- How come you used the Id directly in your code in your blog:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; foreach( ElementId id in 
      data.GetAddedElementIds() )
    {
      View view = doc.GetElement( id ) as View;
 
      if( null != view 
        &amp;amp;&amp;amp; ViewType.Elevation == view.ViewType )
      {
        TaskDialog.Show( "ElevationWatcher Updater",
          string.Format( "New elevation view '{0}'",
            view.Name ) );
      }
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2- How come the &lt;STRONG&gt;GetModifiedElementIds() &lt;/STRONG&gt;is usable as a list and the &lt;STRONG&gt;GetAddedElementIds&lt;/STRONG&gt;() is not?! Is it because there's a chance of deciding to delete the new element?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help! I'm kind of finishing up here at the office now. Will check it first thing tomorrow!:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M. Fadel&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 15:57:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952332#M68855</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-15T15:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952367#M68856</link>
      <description>&lt;P&gt;'Oh', from me too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I was just plain wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An all-too-quick assumption.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if that is not it, then in what way is it not working for yoou?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, if you are having any problems with DMU, you should always try out ChangeTypeAny and see whether that improves things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 16:09:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952367#M68856</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-12-15T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952547#M68857</link>
      <description>&lt;P&gt;Hahahah. No problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's not working is&amp;nbsp;that when i add (draw)&amp;nbsp;an &lt;STRONG&gt;&lt;U&gt;element&lt;/U&gt;&lt;/STRONG&gt; and not a &lt;STRONG&gt;&lt;U&gt;parameter&lt;/U&gt;&lt;/STRONG&gt;, my code doesn't work:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foreach (ElementId id in data.GetAddedElementIds())
                {
                    System.Windows.Forms.MessageBox.Show("Hello");
                }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if the element &lt;STRONG&gt;&lt;U&gt;already&lt;/U&gt;&lt;/STRONG&gt; exists, and i'm trying to modify a &lt;STRONG&gt;parameter&lt;/STRONG&gt; in this &lt;STRONG&gt;element&lt;/STRONG&gt; (using&lt;STRONG&gt; GetModifiedElementIds()&lt;/STRONG&gt;) it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So again, my initial question is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the &lt;STRONG&gt;GetAddedElementIds&lt;/STRONG&gt; and &lt;STRONG&gt;GetModifiedElementIds &lt;/STRONG&gt;functions at the level of adding, modifying, and&amp;nbsp;deleting parameters, or on the level of&amp;nbsp;adding, modifying, and&amp;nbsp;deleting elements?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I tried to answer myself this question. I added a new &lt;STRONG&gt;&lt;U&gt;parameter&lt;/U&gt; &lt;/STRONG&gt;to my &lt;U&gt;&lt;STRONG&gt;element&lt;/STRONG&gt; &lt;/U&gt;(because modifying a parameter worked for me) to see if the message "Hello" will work, but it didn't! So this made me wonder even more!!:p On which level do these functions work?!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And one last thing, i can't use ChangeTypeAny&amp;nbsp;because again, i'm trying to update my parameters. So i can't be using the DocumentChanged&amp;nbsp;method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M. Fadel&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 17:34:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952547#M68857</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-15T17:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952633#M68858</link>
      <description>&lt;P&gt;The element ids always refer to database elements, not to parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you can use ChangeTypeAny.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That defines your trigger, and means that it reacts to any change, including parameter modifications.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 18:16:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5952633#M68858</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-12-15T18:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953478#M68859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;may this thread help you ?&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/revit-api/set-instance-parameters-at-insertion-or-modification/m-p/5715477/highlight/true#M10776" target="_blank"&gt;http://forums.autodesk.com/t5/revit-api/set-instance-parameters-at-insertion-or-modification/m-p/5715477/highlight/true#M10776&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 08:08:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953478#M68859</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-12-16T08:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953570#M68860</link>
      <description>&lt;P&gt;Hello Revitalizer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your post.. I followed Tim's code. Again, it's only working when modifying an element. But not when the element is newly added (drawn). And when i replaced:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Element.GetChangeTypeAny()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ChangeType.ConcatenateChangeTypes(Element.GetChangeTypeGeometry(), Element.GetChangeTypeElementAddition())&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like you suggested, i got this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Third party updater 'WatcherUpdater' has experienced a problem and its action had to be canceled.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached my complete code in this post. If you can have a look i would really appreciate it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M. Fadel&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 09:43:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953570#M68860</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-16T09:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953594#M68861</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you cannot modify an Element in the "OnModified"-Updater since it would generate a circular reference.&lt;/P&gt;&lt;P&gt;Modifying would trigger the Updater again and again and again...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:03:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953594#M68861</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-12-16T10:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953605#M68862</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you think i should ommit &lt;STRONG&gt;Elmnts.AddRange(data.GetModifiedElementIds())&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did, the same error occured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.Fadel&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:15:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953605#M68862</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-16T10:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953631#M68863</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my fault.&lt;/P&gt;&lt;P&gt;You can &lt;EM&gt;indeed&lt;/EM&gt; modify Elements in the Execute method, but you cannot create new ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May it be that your ElementCategoryFilter is &lt;EM&gt;too common&lt;/EM&gt; ?&lt;/P&gt;&lt;P&gt;In this version, you monitor thousands of elements without need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:45:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953631#M68863</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-12-16T10:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953754#M68864</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's it! I tried applying a &lt;EM&gt;BuiltInCategory.OST_StructuralColumns&lt;/EM&gt; as the filter. It worked fine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should i just add all categories manually? As i understand i can't use the &lt;STRONG&gt;AllowsBoundParameters &lt;/STRONG&gt;function to get all my needed &lt;STRONG&gt;Categories&lt;/STRONG&gt; on StartUp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any easier approach to this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.Fadel&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 12:34:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953754#M68864</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-16T12:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953758#M68865</link>
      <description>&lt;P&gt;Hello again Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wanted to let you know that Revitalizer helped me out with this problem. Actually, he showed me a post you participated in a couple of months ago. I &lt;STRONG&gt;&lt;U&gt;think&lt;/U&gt; &lt;/STRONG&gt;you were right the first time! I believe this solved the issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                List&amp;lt;ElementId&amp;gt; Elmnts = new List&amp;lt;ElementId&amp;gt;();
                Elmnts.AddRange(data.GetAddedElementIds());&lt;/PRE&gt;&lt;P&gt;I'm really not able to comprehend all this. I hope i will have an in-depth understanding of this once i am done with the work at my hand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help!:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.Fadel&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 12:42:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953758#M68865</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-16T12:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953773#M68866</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that you already use this get-BuiltInCategories-one-time-approach:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/revit-api/retrieve-all-elements-on-start-up/m-p/5844763/highlight/true#M12107" target="_blank"&gt;http://forums.autodesk.com/t5/revit-api/retrieve-all-elements-on-start-up/m-p/5844763/highlight/true#M12107&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's so complicated in getting a document's categories, checking one property and casting the category's Id.IntegerValue to a BuiltInCategory ?&lt;/P&gt;&lt;P&gt;As already said, such a function would only to be run one single time in document context.&lt;/P&gt;&lt;P&gt;A throw-away macro.&lt;/P&gt;&lt;P&gt;The resulting list of BuiltInCategories (to whom a parameter could be added) is document independent, thus can be used OnStartup to initialize your MultiCategoryFilter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 12:55:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953773#M68866</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-12-16T12:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger when adding new element.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953807#M68867</link>
      <description>&lt;P&gt;Hahaha! Good memory!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was using this method.. But it got complicated once i used the &lt;STRONG&gt;DocumentOpenedEventArgs&lt;/STRONG&gt;, &lt;STRONG&gt;DocumentChangedEventArgs&lt;/STRONG&gt;, and a &lt;STRONG&gt;OnStartUp &lt;/STRONG&gt;methods. I'm not saying it didn't work! I made it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i saw Tim's solution, and found it much easier! I thought maybe it would work (appartently for specific categories:s)! This made me forget about my initial dilemna!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that i apologize! Thanks for your help yet again:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.Fadel&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 13:15:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trigger-when-adding-new-element/m-p/5953807#M68867</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2015-12-16T13:15:54Z</dc:date>
    </item>
  </channel>
</rss>

