Apr 24, 2024

How to Create IUpdater in Revit with pyRevit (Create Custom Features)

IUpdater (Dynamic Model Update)

Dynamic model update offers the ability for a Revit API application to modify the Revit model as a reaction to changes happening in the model when those changes are about to be committed at the end of a transaction. Revit API applications can create updaters by implementing the IUpdater interface and registering it with the UpdaterRegistry class. Registering includes specifying what changes in the model should trigger the updater.


Resources

Revit API Dev Guide - IUpdater

pyRevit doc-updater


Create pyRevit Hook


Hook Base

# -*- coding: utf-8 -*-

#⬇️ Imports
from datetime import datetime
from Autodesk.Revit.DB import (BuiltInCategory,
                               BuiltInParameter,
                               UnitUtils,
                               UnitTypeId,
                               ElementId,
                               WorksharingUtils,
                               FamilyInstance)

#📦 Variables
sender = __eventsender__
args   = __eventargs__

doc = args.GetDocument()

#👉 Get ElementIds for Modified/Deleted/New
modified_el_ids = args.GetModifiedElementIds()
deleted_el_ids  = args.GetDeletedElementIds()
new_el_ids      = args.GetAddedElementIds()

modified_el = [doc.GetElement(e_id) for e_id in modified_el_ids]


Feature #1: Track Coordinates


Feature #2: Track LastEdited Timestamp + Name


Feature #3: Track Mirrored Windows and Doors


Error: Third-Party IUpdater not Registered

Solution: How to get rid of the the Error





Join Newsletter

📩 You will be added to Revit API Newsletter

Join Us!

which is already read by 7400+ people!

Ready to become Revit Hero for your office? Learn Revit API!

Join this comprehensive course that will guide you step by step on how to create your dream tools for Revit that save time.