private void RevitServicesUpdater_ElementsModified(IEnumerable <string> updated) { var updatedIds = updated.Select( x => { Element ret; DocumentManager.Instance.CurrentDBDocument.TryGetElement(x, out ret); return(ret); }).Select(x => x.Id); if (!updatedIds.Any()) { return; } var nodes = ElementBinder.GetNodesFromElementIds( updatedIds, CurrentWorkspace, EngineController); foreach (var node in nodes) { node.OnNodeModified(true); } }
void RevitServicesUpdater_ElementsUpdated(object sender, ElementUpdateEventArgs e) { //Element addition is not handled by this class. if (e.Operation == ElementUpdateEventArgs.UpdateType.Added) { return; } if (!e.Elements.Any()) { return; } bool dynamoTransaction = e.Transactions.Contains(TransactionWrapper.TransactionName); var nodes = ElementBinder.GetNodesFromElementIds( e.Elements, CurrentWorkspace, EngineController); foreach (var node in nodes) { //Don't re-execute the element construction node, if //this element is modified due to a Dynamo transaction. if (dynamoTransaction && IsConstructorNode(node)) { continue; } node.OnNodeModified(forceExecute: true); } }
private void RevitServicesUpdater_ElementsDeleted( Document document, IEnumerable <ElementId> deleted) { if (!deleted.Any()) { return; } var nodes = ElementBinder.GetNodesFromElementIds( deleted, CurrentWorkspace, EngineController); foreach (var node in nodes) { node.OnNodeModified(forceExecute: true); } }