<?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 Iupdater Dynamic Model Update Dimensions in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629277#M33150</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to write C# which sets Dimension suffix's and colour style depending on the value of the Dimension.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/code-crit/m-p/9625232#M48334" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/code-crit/m-p/9625232#M48334&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now wanting those overrides to update if a dimension value changes.&amp;nbsp; I have followed this post primarily (the ribbons and buttons are off in a different .CS and the external command is the only bit which is definitely working!)&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/08/structural-dynamic-model-update-sample.html" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/2010/08/structural-dynamic-model-update-sample.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I couldn't get it to work, I looked around and tried suggestions in this post...&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/iupdater-get-family-instance-and-update-values/m-p/9039149/highlight/false" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/iupdater-get-family-instance-and-update-values/m-p/9039149/highlight/false&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also&lt;/P&gt;&lt;P&gt;&lt;A href="https://boostyourbim.wordpress.com/2013/07/13/live-link-between-parameters-in-model-detail-families/" target="_blank" rel="noopener"&gt;https://boostyourbim.wordpress.com/2013/07/13/live-link-between-parameters-in-model-detail-families/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've now hit a bit of a wall!&amp;nbsp; It runs with no errors, but nothing happens! Any suggestions gratefully received.&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;Mark&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;using System;
using System.Text;
using System.Linq;

using System.Collections.Generic;

using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Attributes;


namespace BrickDims
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class UpdateBrickDims : IExternalApplication
    {
        /// &amp;lt;summary&amp;gt;
        /// On shutdown, unregister the updater
        /// &amp;lt;/summary&amp;gt;
        /// 

        public Result OnShutdown(UIControlledApplication a)
        {
            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);
            UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId());

            return Result.Succeeded;
        }

        /// &amp;lt;summary&amp;gt;
        /// On start up, add UI buttons, register 
        /// the updater and add triggers
        /// &amp;lt;/summary&amp;gt;
        public Result OnStartup(UIControlledApplication a)
        {

            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);

            // Register the updater in the singleton 
            // UpdateRegistry class
            UpdaterRegistry.RegisterUpdater(updater);


            // Set the filter
            //ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_StructuralFraming);
            //ElementOwnerViewFilter filterView = new ElementOwnerViewFilter(doc.ActiveView.Id);
            //ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
            //LogicalAndFilter filter = new LogicalAndFilter(filterView, filterClass);
            // Add trigger 
            //UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeAny());
            if (!UpdaterRegistry.IsUpdaterRegistered(updater.GetUpdaterId()))
            {
                UpdaterRegistry.RegisterUpdater(updater, true);
                ElementCategoryFilter f = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), f, Element.GetChangeTypeAny());
            }
            return Result.Succeeded;
        }

    }

    public class BrickDimUpdater : IUpdater
    {
        public static bool m_updateActive = false;
        AddInId addinID = null;
        UpdaterId updaterID = null;

        public BrickDimUpdater(AddInId id)
        {
            addinID = id;
            // UpdaterId that is used to register and 
            // unregister updaters and triggers
            updaterID = new UpdaterId(addinID, new Guid(
              "63CDBB88-5CC4-4ac3-AD24-52DD435AAB25"));
            Console.WriteLine("Standard Numeric Format Specifiers3");
        }

        public int caseswitch = 1;

        /// &amp;lt;summary&amp;gt;
        /// Colour Code Dimensions
        /// &amp;lt;/summary&amp;gt;
        public void Execute(UpdaterData data)
        {
            TaskDialog.Show("case 2", "Check");
            if (m_updateActive == false) { return; }

            // Get access to document object
            Document doc = data.GetDocument();
            UIDocument uidoc = new UIDocument(doc);

            //using (Transaction t = new Transaction(doc, "Update Dim"))
            //{
             //   t.Start();
            try
            {
                TaskDialog.Show("case 2", "Check");
                switch (caseswitch)
                {
                    case 1:
                        // Loop through all the modified elements
                        ICollection&amp;lt;ElementId&amp;gt; modifiedCollection = data.GetModifiedElementIds();
                        foreach (ElementId elemId in modifiedCollection)
                        {
                        Dimension dim = doc.GetElement(elemId) as Dimension;
                        DimClrChecker.DimClrChngSuffix(dim, uidoc);
                        TaskDialog.Show("case 2", "Check");
                        }
                    caseswitch = 2;
                    break;

                    case 2:
                    TaskDialog.Show("case 2", "SampleUpdater");

                    caseswitch = 1;
                    break;
                }

            }
            catch (Exception ex)
            {
                TaskDialog.Show("Exception", ex.Message);
            }

                //t.Commit();
            //}
        }
        /// &amp;lt;summary&amp;gt;
        /// Set the priority
        /// &amp;lt;/summary&amp;gt;
        public ChangePriority GetChangePriority()
        {
            return ChangePriority.Annotations;
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the updater Id
        /// &amp;lt;/summary&amp;gt;
        public UpdaterId GetUpdaterId()
        {
            return updaterID;
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the auxiliary string
        /// &amp;lt;/summary&amp;gt;
        public string GetAdditionalInformation()
        {
            return "Automatically update dimension overrides";
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the updater name
        /// &amp;lt;/summary&amp;gt;
        public string GetUpdaterName()
        {
            return "Dimension Override Updater";
        }
    }

    [Transaction(TransactionMode.ReadOnly)]
    [Regeneration(RegenerationOption.Manual)]
    public class UIDynamicModelUpdateOff : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            BrickDimUpdater.m_updateActive = false;
            return Result.Succeeded;
        }
    }

    [Transaction(TransactionMode.ReadOnly)]
    [Regeneration(RegenerationOption.Manual)]
    public class UIDynamicModelUpdateOn : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            BrickDimUpdater.m_updateActive = true;
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 19:41:16 GMT</pubDate>
    <dc:creator>Mark.Ackerley</dc:creator>
    <dc:date>2020-07-10T19:41:16Z</dc:date>
    <item>
      <title>Iupdater Dynamic Model Update Dimensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629277#M33150</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to write C# which sets Dimension suffix's and colour style depending on the value of the Dimension.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/code-crit/m-p/9625232#M48334" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/code-crit/m-p/9625232#M48334&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now wanting those overrides to update if a dimension value changes.&amp;nbsp; I have followed this post primarily (the ribbons and buttons are off in a different .CS and the external command is the only bit which is definitely working!)&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/08/structural-dynamic-model-update-sample.html" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/2010/08/structural-dynamic-model-update-sample.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I couldn't get it to work, I looked around and tried suggestions in this post...&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/iupdater-get-family-instance-and-update-values/m-p/9039149/highlight/false" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/iupdater-get-family-instance-and-update-values/m-p/9039149/highlight/false&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also&lt;/P&gt;&lt;P&gt;&lt;A href="https://boostyourbim.wordpress.com/2013/07/13/live-link-between-parameters-in-model-detail-families/" target="_blank" rel="noopener"&gt;https://boostyourbim.wordpress.com/2013/07/13/live-link-between-parameters-in-model-detail-families/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've now hit a bit of a wall!&amp;nbsp; It runs with no errors, but nothing happens! Any suggestions gratefully received.&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;Mark&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;using System;
using System.Text;
using System.Linq;

using System.Collections.Generic;

using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Attributes;


namespace BrickDims
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class UpdateBrickDims : IExternalApplication
    {
        /// &amp;lt;summary&amp;gt;
        /// On shutdown, unregister the updater
        /// &amp;lt;/summary&amp;gt;
        /// 

        public Result OnShutdown(UIControlledApplication a)
        {
            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);
            UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId());

            return Result.Succeeded;
        }

        /// &amp;lt;summary&amp;gt;
        /// On start up, add UI buttons, register 
        /// the updater and add triggers
        /// &amp;lt;/summary&amp;gt;
        public Result OnStartup(UIControlledApplication a)
        {

            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);

            // Register the updater in the singleton 
            // UpdateRegistry class
            UpdaterRegistry.RegisterUpdater(updater);


            // Set the filter
            //ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_StructuralFraming);
            //ElementOwnerViewFilter filterView = new ElementOwnerViewFilter(doc.ActiveView.Id);
            //ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
            //LogicalAndFilter filter = new LogicalAndFilter(filterView, filterClass);
            // Add trigger 
            //UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeAny());
            if (!UpdaterRegistry.IsUpdaterRegistered(updater.GetUpdaterId()))
            {
                UpdaterRegistry.RegisterUpdater(updater, true);
                ElementCategoryFilter f = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), f, Element.GetChangeTypeAny());
            }
            return Result.Succeeded;
        }

    }

    public class BrickDimUpdater : IUpdater
    {
        public static bool m_updateActive = false;
        AddInId addinID = null;
        UpdaterId updaterID = null;

        public BrickDimUpdater(AddInId id)
        {
            addinID = id;
            // UpdaterId that is used to register and 
            // unregister updaters and triggers
            updaterID = new UpdaterId(addinID, new Guid(
              "63CDBB88-5CC4-4ac3-AD24-52DD435AAB25"));
            Console.WriteLine("Standard Numeric Format Specifiers3");
        }

        public int caseswitch = 1;

        /// &amp;lt;summary&amp;gt;
        /// Colour Code Dimensions
        /// &amp;lt;/summary&amp;gt;
        public void Execute(UpdaterData data)
        {
            TaskDialog.Show("case 2", "Check");
            if (m_updateActive == false) { return; }

            // Get access to document object
            Document doc = data.GetDocument();
            UIDocument uidoc = new UIDocument(doc);

            //using (Transaction t = new Transaction(doc, "Update Dim"))
            //{
             //   t.Start();
            try
            {
                TaskDialog.Show("case 2", "Check");
                switch (caseswitch)
                {
                    case 1:
                        // Loop through all the modified elements
                        ICollection&amp;lt;ElementId&amp;gt; modifiedCollection = data.GetModifiedElementIds();
                        foreach (ElementId elemId in modifiedCollection)
                        {
                        Dimension dim = doc.GetElement(elemId) as Dimension;
                        DimClrChecker.DimClrChngSuffix(dim, uidoc);
                        TaskDialog.Show("case 2", "Check");
                        }
                    caseswitch = 2;
                    break;

                    case 2:
                    TaskDialog.Show("case 2", "SampleUpdater");

                    caseswitch = 1;
                    break;
                }

            }
            catch (Exception ex)
            {
                TaskDialog.Show("Exception", ex.Message);
            }

                //t.Commit();
            //}
        }
        /// &amp;lt;summary&amp;gt;
        /// Set the priority
        /// &amp;lt;/summary&amp;gt;
        public ChangePriority GetChangePriority()
        {
            return ChangePriority.Annotations;
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the updater Id
        /// &amp;lt;/summary&amp;gt;
        public UpdaterId GetUpdaterId()
        {
            return updaterID;
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the auxiliary string
        /// &amp;lt;/summary&amp;gt;
        public string GetAdditionalInformation()
        {
            return "Automatically update dimension overrides";
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the updater name
        /// &amp;lt;/summary&amp;gt;
        public string GetUpdaterName()
        {
            return "Dimension Override Updater";
        }
    }

    [Transaction(TransactionMode.ReadOnly)]
    [Regeneration(RegenerationOption.Manual)]
    public class UIDynamicModelUpdateOff : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            BrickDimUpdater.m_updateActive = false;
            return Result.Succeeded;
        }
    }

    [Transaction(TransactionMode.ReadOnly)]
    [Regeneration(RegenerationOption.Manual)]
    public class UIDynamicModelUpdateOn : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            BrickDimUpdater.m_updateActive = true;
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:41:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629277#M33150</guid>
      <dc:creator>Mark.Ackerley</dc:creator>
      <dc:date>2020-07-10T19:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Iupdater Dynamic Model Update Dimensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629642#M33151</link>
      <description>&lt;P&gt;I see no problems off-hand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RegenerationOption has no effect and can be removed everywhere. Saves you visual complexity, rests you eyes and mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First you register the updater, then check whether it was registered, and then register it again. That seems like a bit of overkill.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would replace all calls to taskDialog by Console.Log or something else that does not interact with the user. The UI interruption may well disturb the updater transaction handling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2020 05:18:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629642#M33151</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-07-11T05:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Iupdater Dynamic Model Update Dimensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629680#M33152</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Jeremy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can tell, I was starting to get to the desperate 'throw anything and see if it helps' stage!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've stripped it right back but it's still sitting there refusing to work...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an aside, when I use Console.Write("test", "test") in debug mode, I don't get anything displayed in the VS Output (Debug).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the slightly modified stripped back code...&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;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using System.Text;
using System.Linq;

using System.Collections.Generic;

using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Attributes;


namespace BrickDims
{
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    public class UpdateBrickDims : IExternalApplication
    {
        /// &amp;lt;summary&amp;gt;
        /// On shutdown, unregister the updater
        /// &amp;lt;/summary&amp;gt;
        /// 

        public Result OnShutdown(UIControlledApplication a)
        {
            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);
            UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId());

            return Result.Succeeded;
        }

        /// &amp;lt;summary&amp;gt;
        /// On start up, add UI buttons, register 
        /// the updater and add triggers
        /// &amp;lt;/summary&amp;gt;
        public Result OnStartup(UIControlledApplication a)
        {
            // Add the UI buttons on start up
            AddButtons(a);

            BrickDimUpdater updater = new BrickDimUpdater(a.ActiveAddInId);

            // Register the updater in the singleton 
            // UpdateRegistry class
            UpdaterRegistry.RegisterUpdater(updater);


            // Set the filter
            //ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_StructuralFraming);
            //ElementOwnerViewFilter filterView = new ElementOwnerViewFilter(doc.ActiveView.Id);
            //ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
            //LogicalAndFilter filter = new LogicalAndFilter(filterView, filterClass);
            // Add trigger 
            //UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeAny());
            if (!UpdaterRegistry.IsUpdaterRegistered(updater.GetUpdaterId()))
            {
                UpdaterRegistry.RegisterUpdater(updater, true);
                ElementCategoryFilter f = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), f, Element.GetChangeTypeAny());
            }
            return Result.Succeeded;
        }

        /// &amp;lt;summary&amp;gt;
        /// Add UI buttons
        /// &amp;lt;/summary&amp;gt;
        public void AddButtons(UIControlledApplication a)
        {
            // create a ribbon panel on the Analyze tab
            RibbonPanel panel = a.CreateRibbonPanel(
              Tab.AddIns, "RST Labs");

            AddDmuCommandButtons(panel);
        }


        /// &amp;lt;summary&amp;gt;
        /// Control buttons for the Dynamic Model Update 
        /// &amp;lt;/summary&amp;gt;
        public void AddDmuCommandButtons(RibbonPanel panel)
        {
            string path = GetType().Assembly.Location;

            string sDirectory = System.IO.Path.GetDirectoryName(path);

            // create toggle buttons for radio button group 

            ToggleButtonData toggleButtonData3
              = new ToggleButtonData(
                "RSTLabsDMUOff", "Align Off", path,
                "BrickDims.UIDynamicModelUpdateOff");


            ToggleButtonData toggleButtonData4
              = new ToggleButtonData(
                "RSTLabsDMUOn", "Align On", path,
                "BrickDims.UIDynamicModelUpdateOn");

            // make dyn update on/off radio button group 

            RadioButtonGroupData radioBtnGroupData2 =
              new RadioButtonGroupData("RebarAlign");

            RadioButtonGroup radioBtnGroup2
              = panel.AddItem(radioBtnGroupData2)
                as RadioButtonGroup;

            radioBtnGroup2.AddItem(toggleButtonData3);
            radioBtnGroup2.AddItem(toggleButtonData4);
        }
    }

    public class BrickDimUpdater : IUpdater
    {
        public static bool m_updateActive = false;
        AddInId addinID = null;
        UpdaterId updaterID = null;

        public BrickDimUpdater(AddInId id)
        {
            addinID = id;
            // UpdaterId that is used to register and 
            // unregister updaters and triggers
            updaterID = new UpdaterId(addinID, new Guid(
              "63CDBB88-5CC4-4ac3-AD24-52DD435AAB25"));
            Console.WriteLine("Standard Numeric Format Specifiers3");
        }

        public int caseswitch = 1;

        /// &amp;lt;summary&amp;gt;
        /// Colour Code Dimensions
        /// &amp;lt;/summary&amp;gt;
        public void Execute(UpdaterData data)
        {
            TaskDialog.Show("case 2", "Check");
            if (m_updateActive == false) { return; }

            // Get access to document object
            Document doc = data.GetDocument();
            UIDocument uidoc = new UIDocument(doc);

            //using (Transaction t = new Transaction(doc, "Update Dim"))
            //{
            //   t.Start();
            try
            {
                TaskDialog.Show("case 2", "Check");
                switch (caseswitch)
                {
                    case 1:
                        // Loop through all the modified elements
                        ICollection&amp;lt;ElementId&amp;gt; modifiedCollection = data.GetModifiedElementIds();
                        foreach (ElementId elemId in modifiedCollection)
                        {
                            Dimension dim = doc.GetElement(elemId) as Dimension;
                            DimClrChecker.DimClrChngSuffix(dim, uidoc);
                        }
                        caseswitch = 2;
                        break;

                    case 2:
                        TaskDialog.Show("case 2", "SampleUpdater");

                        caseswitch = 1;
                        break;
                }

            }
            catch (Exception ex)
            {
                TaskDialog.Show("Exception", ex.Message);
            }

            //t.Commit();
            //}
        }
        /// &amp;lt;summary&amp;gt;
        /// Set the priority
        /// &amp;lt;/summary&amp;gt;
        public ChangePriority GetChangePriority()
        {
            return ChangePriority.Annotations;
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the updater Id
        /// &amp;lt;/summary&amp;gt;
        public UpdaterId GetUpdaterId()
        {
            return updaterID;
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the auxiliary string
        /// &amp;lt;/summary&amp;gt;
        public string GetAdditionalInformation()
        {
            return "Automatically update dimension overrides";
        }

        /// &amp;lt;summary&amp;gt;
        /// Return the updater name
        /// &amp;lt;/summary&amp;gt;
        public string GetUpdaterName()
        {
            return "Dimension Override Updater";
        }
    }

    [Transaction(TransactionMode.ReadOnly)]
    [Regeneration(RegenerationOption.Manual)]
    public class UIDynamicModelUpdateOff : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            BrickDimUpdater.m_updateActive = false;
            return Result.Succeeded;
        }
    }

    [Transaction(TransactionMode.ReadOnly)]
    [Regeneration(RegenerationOption.Manual)]
    public class UIDynamicModelUpdateOn : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            BrickDimUpdater.m_updateActive = true;
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2020 07:28:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629680#M33152</guid>
      <dc:creator>Mark.Ackerley</dc:creator>
      <dc:date>2020-07-11T07:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Iupdater Dynamic Model Update Dimensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629720#M33153</link>
      <description>&lt;P&gt;Well, scrap the Console stuff if it does not work anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, I use Debug.Print to log messages on the VS debug console.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You still have a taskDialog call in your Execute method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As already pointed out, that may well seriously disrupt behaviour.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2020 08:55:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9629720#M33153</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-07-11T08:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Iupdater Dynamic Model Update Dimensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9630190#M33154</link>
      <description>&lt;P&gt;Thanks Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies, that definitely didn't help!&amp;nbsp; Also, I didn't have all the bits of start up / shut down code in the main external ribbon, so now it works great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;Mark&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2020 19:57:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/iupdater-dynamic-model-update-dimensions/m-p/9630190#M33154</guid>
      <dc:creator>Mark.Ackerley</dc:creator>
      <dc:date>2020-07-11T19:57:11Z</dc:date>
    </item>
  </channel>
</rss>

