<?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: Monitoring parameter changes using DMU mechanism in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10978599#M20667</link>
    <description>&lt;P&gt;In your code, you collected all the FamilyParameter ids and ask the DMU to watch modifications on them, which actually didn't work.&lt;/P&gt;&lt;P&gt;Maybe you can give DMU the id of Document.OwnerFamily. I have no idea if it will work. You can have a try.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 03:16:48 GMT</pubDate>
    <dc:creator>Kennan.Chen</dc:creator>
    <dc:date>2022-03-02T03:16:48Z</dc:date>
    <item>
      <title>Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10955806#M20660</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;I have encountered some problems recently.&lt;/P&gt;&lt;P&gt;I created some family parameters and displayed them in Revit's properties window&lt;/P&gt;&lt;P&gt;using (Transaction trans = new Transaction(doc))&lt;BR /&gt;{&lt;BR /&gt;trans.Start("Add Parameter");&lt;BR /&gt;familyMgr = doc.FamilyManager;&lt;BR /&gt;BuiltInParameterGroup paraGroup = BuiltInParameterGroup.PG_TEXT;&lt;BR /&gt;ParameterType paraType = ParameterType.Text;&lt;BR /&gt;bool isInstance = false;&lt;BR /&gt;paramAdded = familyMgr.AddParameter(paraName, paraGroup, paraType, isInstance);&lt;/P&gt;&lt;P&gt;string value = Paras[key];&lt;BR /&gt;familyMgr.Set(paramAdded, value);&lt;/P&gt;&lt;P&gt;trans.Commit();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Now I want to implement some functions: if someone modifies the parameter value I defined in the properties window, I can quickly capture this operation and obtain the modified value.&lt;/P&gt;&lt;P&gt;I consider using DMU to realize this function, but I have no way to start. Can you give me some ideas.&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 07:17:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10955806#M20660</guid>
      <dc:creator>846081597</dc:creator>
      <dc:date>2022-02-17T07:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10955949#M20661</link>
      <description>&lt;P&gt;Yes, DMU is a viable option. Read about it here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.31" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.31&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 08:48:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10955949#M20661</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-02-17T08:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10958041#M20662</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi jeremy,&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I added a trigger, I encountered two problems&lt;/P&gt;&lt;PRE&gt; &lt;SPAN class=""&gt;UpdaterRegistry&lt;/SPAN&gt;.AddTrigger(
&amp;nbsp; &amp;nbsp; &amp;nbsp; updater.GetUpdaterId(), ElementFilter,
&amp;nbsp; &amp;nbsp; &amp;nbsp; Element.GetChangeTypeParameter(ElementId) );&lt;/PRE&gt;&lt;P&gt;First, I won't write ElementFilter for all family parameters in the current document.&lt;/P&gt;&lt;P&gt;Second, Element.GetChangeTypeParameter need an ID, but I don't know which family parameter the user will modify. I can't determine which ID it is.&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 02:20:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10958041#M20662</guid>
      <dc:creator>846081597</dc:creator>
      <dc:date>2022-02-18T02:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10958404#M20663</link>
      <description>&lt;P&gt;You can subscribe to all changes instead of parameter changes only. Try it out with any subset of elements you want first. You can expand it later, once you have it working at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 08:13:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10958404#M20663</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-02-18T08:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10976712#M20664</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello jeremy&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;I wrote a section of parameter trigger based on the information you gave me&lt;/P&gt;&lt;P&gt;However, I did not trigger the parameter trigger after modifying the family parameters in the family document.&lt;/P&gt;&lt;P&gt;Can you help me find the reason。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public class ParameterUpdater : IUpdater&lt;BR /&gt;{&lt;BR /&gt;internal ParameterUpdater(AddInId addinID)&lt;BR /&gt;{&lt;BR /&gt;m_updaterId = new UpdaterId(addinID, new Guid("FBF3F6B2-4C06-42d4-97C1-D1B4EB593EFF"));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;internal void Register(Document doc)&lt;BR /&gt;{&lt;BR /&gt;if (!UpdaterRegistry.IsUpdaterRegistered(m_updaterId))&lt;BR /&gt;UpdaterRegistry.RegisterUpdater(this, doc);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;internal void AddTriggerForUpdater(Document doc, List&amp;lt;ElementId&amp;gt; idsToWatch)&lt;BR /&gt;{&lt;BR /&gt;if (idsToWatch.Count == 0)&lt;BR /&gt;return;&lt;/P&gt;&lt;P&gt;UpdaterRegistry.AddTrigger(m_updaterId, doc, idsToWatch, Element.GetChangeTypeAny());&lt;BR /&gt;}&lt;BR /&gt;public void Execute(UpdaterData data)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;MessageBox.Show("enter change");&lt;/P&gt;&lt;P&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public UpdaterId GetUpdaterId()&lt;BR /&gt;{&lt;BR /&gt;return m_updaterId;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public string GetUpdaterName()&lt;BR /&gt;{&lt;BR /&gt;return "Parameter Updater";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public string GetAdditionalInformation()&lt;BR /&gt;{&lt;BR /&gt;return "Automatically add a family parameter";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public ChangePriority GetChangePriority()&lt;BR /&gt;{&lt;BR /&gt;return ChangePriority.Structure;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private UpdaterId m_updaterId = null;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]&lt;BR /&gt;public class Command : IExternalCommand&lt;BR /&gt;{&lt;BR /&gt;public Document doc;&lt;BR /&gt;public Autodesk.Revit.ApplicationServices.Application app;&lt;BR /&gt;private static List&amp;lt;ElementId&amp;gt; idsToWatch = new List&amp;lt;ElementId&amp;gt;();&lt;BR /&gt;private static ParameterUpdater m_parameterUpdater = null;&lt;BR /&gt;private AddInId m_thisAppId;&lt;/P&gt;&lt;P&gt;public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)&lt;BR /&gt;{&lt;BR /&gt;doc = commandData.Application.ActiveUIDocument.Document;&lt;/P&gt;&lt;P&gt;m_thisAppId = commandData.Application.ActiveAddInId;//MessageBox.Show(m_thisAppId.GetGUID().ToString());&lt;BR /&gt;if (m_parameterUpdater == null)&lt;BR /&gt;{&lt;BR /&gt;using (Transaction tran = new Transaction(doc, "Register Section Updater"))&lt;BR /&gt;{&lt;BR /&gt;tran.Start();&lt;BR /&gt;m_parameterUpdater = new ParameterUpdater(m_thisAppId);&lt;BR /&gt;m_parameterUpdater.Register(doc);&lt;/P&gt;&lt;P&gt;tran.Commit();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;FamilyParameterSet parameters = doc.FamilyManager.Parameters;&lt;BR /&gt;foreach(FamilyParameter para in parameters)&lt;BR /&gt;{&lt;BR /&gt;idsToWatch.Add(para.Id); //MessageBox.Show(para.Definition.Name);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;UpdaterRegistry.RemoveAllTriggers(m_parameterUpdater.GetUpdaterId());&lt;BR /&gt;m_parameterUpdater.AddTriggerForUpdater(doc, idsToWatch);&lt;/P&gt;&lt;P&gt;doc.DocumentClosing += UnregisterSectionUpdaterOnClose;&lt;/P&gt;&lt;P&gt;return Result.Succeeded;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 08:21:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10976712#M20664</guid>
      <dc:creator>846081597</dc:creator>
      <dc:date>2022-03-01T08:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10976860#M20665</link>
      <description>&lt;P&gt;How about watching the Document.OwnerFamily?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 10:11:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10976860#M20665</guid>
      <dc:creator>Kennan.Chen</dc:creator>
      <dc:date>2022-03-01T10:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10978566#M20666</link>
      <description>&lt;P&gt;Hello Kennan.Chen&lt;/P&gt;&lt;P&gt;Sorry, I'm a novice in secondary development. I don't know how to use&amp;nbsp;&lt;SPAN&gt;Document.OwnerFamily.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I mainly want to capture the user's modification of family parameters. I defined several family parameters with the revit api interface. If the user can modify the family parameters I defined, I can capture this operation and obtain the modified values.&lt;/P&gt;&lt;P&gt;When I modified the family parameters, I found that the program did not enter the execute function of &lt;SPAN&gt;ParameterUpdate&lt;/SPAN&gt; at all.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ParameterUpdater.AddTrigger(m_updaterId,doc, List&amp;lt;ElementId&amp;gt;,Element.GetChangeTypeAny())&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 02:38:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10978566#M20666</guid>
      <dc:creator>846081597</dc:creator>
      <dc:date>2022-03-02T02:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10978599#M20667</link>
      <description>&lt;P&gt;In your code, you collected all the FamilyParameter ids and ask the DMU to watch modifications on them, which actually didn't work.&lt;/P&gt;&lt;P&gt;Maybe you can give DMU the id of Document.OwnerFamily. I have no idea if it will work. You can have a try.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 03:16:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10978599#M20667</guid>
      <dc:creator>Kennan.Chen</dc:creator>
      <dc:date>2022-03-02T03:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10980868#M20668</link>
      <description>&lt;P&gt;Hello Kennan.Chen&lt;/P&gt;&lt;P&gt;Thank you for your help. I've tried and still can't. now I doubt whether DMU can't be used for family parameters at all,I really can't find anything wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 03:02:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10980868#M20668</guid>
      <dc:creator>846081597</dc:creator>
      <dc:date>2022-03-03T03:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring parameter changes using DMU mechanism</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10983401#M20669</link>
      <description>&lt;P&gt;I tried to use controlledapplication_ Documentchanged has succeeded. Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 08:46:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/monitoring-parameter-changes-using-dmu-mechanism/m-p/10983401#M20669</guid>
      <dc:creator>846081597</dc:creator>
      <dc:date>2022-03-04T08:46:28Z</dc:date>
    </item>
  </channel>
</rss>

