© 2010 Autodesk
Introduction to Revit 2011 API
Revit API UI サンプル
イベント
§
§
     //' you can get the list of ids of element added/changed/modified.
     Document rvtdDoc = args.GetDocument();
     ICollection<ElementId> idsAdded = args.GetAddedElementIds();
     ICollection<ElementId> idsDeleted = args.GetDeletedElementIds();
     ICollection<ElementId> idsModified = args.GetModifiedElementIds();
     //' put it in a string to show to the user.
     string msg = “追加: ";
     foreach (ElementId id in idsAdded)
     {
         msg += id.IntegerValue.ToString() + " ";
      }
     //' register the document changed event
     application.ControlledApplication.DocumentChanged += UILabs_DocumentChanged;
イベントもサンプルに含まれております。

このサンプルはDocumentChangedイベントを監視して、ドキュメントに追加された要素を見つけています。