RegisterUpdater Method (IUpdater, Boolean)


Registers an updater application-wide, which means the updater may get triggered in any open document.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2011

Syntax

C#
public static void RegisterUpdater(
	IUpdater updater,
	bool isOptional
)
Visual Basic
Public Shared Sub RegisterUpdater ( _
	updater As IUpdater, _
	isOptional As Boolean _
)
Visual C++
public:
static void RegisterUpdater(
	IUpdater^ updater, 
	bool isOptional
)

Parameters

updater
Type: Autodesk.Revit.DB IUpdater
Updater to be registered
isOptional
Type: System Boolean
This argument controls whether the updater should be required next time a document is open in which the updater had been previously used. If a non-optional updater is not found (i.e. currently not registered), the end user will be presented with a warning and choices to resolve the situation.

Remarks

By registering an updater application-wide, any previous registration explicitly made for particular documents will be voided. That means the updater will no longer be connected with just those documents, and the methodIsUpdaterRegistered(id,document) will also return False. Consequently, any attempt to either register or unregister this updater to (or from, respectively) a document will cause an exception to be thrown.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException Updater with the the same Id has already been registered on the application level. -or- Updater's Id is not valid.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException Method is not allowed during execution of a dynamic update. -or- The updater's owner's AddIn does not match the currently active AddIn, i.e. IUpdater.GetUpdaterId().GetAddInId() differs from the addInId field in the manifest file of the currently executing external application.

See Also