Message 1 of 4
Error "Third party updater "WatchUpdaterWidows" has experienced a problem and its action had to be canceled." when use DMU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to use DMU in my code and it works (I need to type parameters and write to the element instance) But when I change something in the type (not related to the geometry) everything breaks and this error pops up.
class WatchUpdaterWidows : IUpdater
{
static AddInId _appId;
static UpdaterId _updaterId;
public WatchUpdaterWidows(AddInId id)
{
_appId = id;
_updaterId = new UpdaterId(_appId, new Guid(
"fafbf6b2-4c06-42d4-97c1-d1b4eb593eff"));
}
public void Execute(UpdaterData data)
{
Document doc = data.GetDocument();
Application app = doc.Application;
foreach (ElementId id in data.GetModifiedElementIds())
{
var listWindows = new List<Element>();
FamilyInstance familyInstance = doc.GetElement(id) as FamilyInstance;
listWindows.Add(familyInstance);
new WindowParamertSet(listWindows, doc, WindowParamertSet.UseCase.SetError);
//if (familyInstance != null)
//{
// if (data.IsChangeTriggered(id, Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.LOAD_COMMENTS))))
// {
// break;
// }
//}
}
}
public string GetAdditionalInformation()
{
return "Constrol.Com";
}
public ChangePriority GetChangePriority()
{
return ChangePriority.DoorsOpeningsWindows;
}
public UpdaterId GetUpdaterId()
{
return _updaterId;
}
public string GetUpdaterName()
{
return "WatchUpdaterWidows";
}
}
} public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
Document doc = uidoc.Document;
if (null == updater)
{
var updater = new WatchUpdaterWidows(app.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(updater);
ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Windows);
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeGeometry());
}
else
{
UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId());
updater = null;
}
return Result.Succeeded;
}
}
}Waht's wrong?
Developer Advocacy and Support +