GetChangeTypeParameter not triggered for INSTANCE_LENGTH_PARAM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to use Dynamic Model Update to detect when a family instance such as a beam changes length. The trigger below for ALL_MODEL_MARK works fine. When you change the instance mark of a beam, the updater is triggered.
But when you make the beam longer or shorter (which changes INSTANCE_LENGTH_PARAM), the updater does not trigger. Why not?
Thanks
Harry
public void registerUpdater()
{
TestUpdater updater = new TestUpdater(this.Application.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(updater, true);
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),
new ElementClassFilter(typeof(FamilyInstance)),
Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.ALL_MODEL_MARK)));
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),
new ElementClassFilter(typeof(FamilyInstance)),
Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.INSTANCE_LENGTH_PARAM)));
}
public class TestUpdater : IUpdater
{
static AddInId m_appId;
static UpdaterId m_updaterId;
public TestUpdater(AddInId id)
{
m_appId = id;
m_updaterId = new UpdaterId(m_appId, new Guid("FB2BF2B1-4C06-42d4-27C1-D1B4EB593EFA"));
}
public void Execute(UpdaterData data)
{
TaskDialog.Show("Test","Executing DMU updater");
foreach (ElementId id in data.GetModifiedElementIds())
{
Element e = data.GetDocument().GetElement(id);
TaskDialog.Show("d","Length = " + e.get_Parameter(BuiltInParameter.INSTANCE_LENGTH_PARAM).AsDouble());
}
}
public string GetAdditionalInformation() { return "test"; }
public ChangePriority GetChangePriority() { return ChangePriority.FloorsRoofsStructuralWalls; }
public UpdaterId GetUpdaterId() { return m_updaterId; }
public string GetUpdaterName() { return "test"; }
}