|
|
|
|
モデルの要素を監視し、変更をすることを可能にしてるのがアップデーターをいうオブジェクトです。アップデータオブジェクトの定義クラスはIUpdater インターフェースを実装します。
|
|
|
|
IUpdaterインターフェスには実装しなければならないメソッドがあります。そのうちExecuteメソッドはイベントを取得した時に行う処理を実装します。
|
|
|
|
>>>>>>
|
|
|
|
This facility is
offered through implementation of updaters. The updater interface
offers the ability to implement a method that is informed of the scope of
changes that triggered the changes.
|
|
|
|
To subscribe to an
updater, we need to assign some triggers which work in combination of both
update scope and update type. Update scope refers to changes in explicit list
of element ids in document or implicit list of elements communicated via
elementfilter. Change Type refers to changes including element addition,
deletion , modification of geometry, parameters, or any property of element.
|
|
|
|
Dynamic model
update’s ability to modify the model as a reaction to changes in the model is
made possible using the concept of Updaters. Updaters are classes which
implement IUpdater interface. So as our next step, we shall create Updater class and implement the IUpdater
interace in it. This interface implementation includes some methods like -
|
|
GetUpdaterId
– This method returns the unique id of the updater which includes the
application Id and a GUID for this updater. This is used when Revit remembers
the details about the updater which drives a set of elements in the document
and is called once during the registration of the Updater.
|
|
GetUpdaterName
– This method returns the name by which the updater can be identified by the
user, in case there is any problem with the Updater at runtime.
|
|
GetAdditionalInformation
– This method returns the auxiliary strings which are displayed in situations
when the updater (that was used to drive the document) is not present or not
loaded.
|
|
GetChangePriority
– This method identifies the nature of the changes the Updater will be
performing. It is used to identify the order of execution of updaters and
called once during the registration of the Updater.
|
|
And Execute
– this method is updated of the scope of the changes that triggered the
update and allows API users to make changes of its own to the elements in the
document.
|
|
|
|
If a document is
modified by an Updater, the document will store the unique Id of the updater.
If the user later opens the document and the Updater is not present, Revit
will warn the user that the 3rd party updater which previously edited the
document is not available.
|
|
|