Example #1
0
        public Result OnShutdown(Autodesk.Revit.UI.UIControlledApplication application)
        {
            WallUpdater updater = new WallUpdater(application.ActiveAddInId);

            UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId());
            return(Result.Succeeded);
        }
Example #2
0
        public Result OnStartup(Autodesk.Revit.UI.UIControlledApplication application)
        {
            Form1 form1 = new Form1();

            form1.Show();

            // Register wall updater with Revit
            WallUpdater updater = new WallUpdater(application.ActiveAddInId, form1);

            UpdaterRegistry.RegisterUpdater(updater);


            List <BuiltInCategory> builtInCats = new List <BuiltInCategory>();

            builtInCats.Add(BuiltInCategory.OST_Walls);
            builtInCats.Add(BuiltInCategory.OST_StructuralColumns);
            builtInCats.Add(BuiltInCategory.OST_Floors);
            builtInCats.Add(BuiltInCategory.OST_StructuralFoundation);
            builtInCats.Add(BuiltInCategory.OST_StructuralFraming);

            ElementMulticategoryFilter filter1 = new ElementMulticategoryFilter(builtInCats);

            UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter1, Element.GetChangeTypeElementAddition());

            return(Result.Succeeded);
        }
Example #3
0
        public Result OnStartup(Autodesk.Revit.UI.UIControlledApplication application)
        {
            // Register wall updater with Revit
            WallUpdater updater = new WallUpdater(application.ActiveAddInId);

            UpdaterRegistry.RegisterUpdater(updater);

            // Change Scope = any Wall element
            ElementClassFilter wallFilter = new ElementClassFilter(typeof(Wall));

            // Change type = element addition
            UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), wallFilter, Element.GetChangeTypeElementAddition());
            return(Result.Succeeded);
        }