GetChangeTypeGeometry triggered when wall moves but geometry does not change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to use Dynamic Model Update to capture when geometry is changed, but not when an object moves. The help for Element.GetChangeTypeGeometry says:
"For example, changes like cutting a hole in a wall or adjusting its height are considered to be geometric changes. However, moving a wall to a different location without modifying its shape is not considered to be a change in geometry and will not trigger the Updater."
But when the code below is used an a free-standing wall is moved without modifying its shape, the updater is triggered.
How can I get the trigger to only occur when the wall geometry changes, but not when it is moved?
public void registerUpdater()
{
Geomupdater updater = new Geomupdater(this.Application.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(updater, true);
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),
new ElementClassFilter(typeof(Wall)),
Element.GetChangeTypeGeometry());
}
public class Geomupdater : IUpdater
{
static AddInId m_appId;
static UpdaterId m_updaterId;
public Geomupdater(AddInId id)
{
m_appId = id;
m_updaterId = new UpdaterId(m_appId, new Guid("FB2BF2B1-4C06-42d4-27C1-D1B4EB593EFA"));
}
public void Execute(UpdaterData data)
{
Document doc = data.GetDocument();
foreach (ElementId id in data.GetModifiedElementIds())
{
Element e = doc.GetElement(id);
TaskDialog.Show("Modified Element",e.Category.Name + " " + e.Name + " " + e.Id.IntegerValue);
}
}
public string GetAdditionalInformation() { return "test"; }
public ChangePriority GetChangePriority() { return ChangePriority.FloorsRoofsStructuralWalls; }
public UpdaterId GetUpdaterId() { return m_updaterId; }
public string GetUpdaterName() { return "test"; }
}