How to run addin after Revit Command (opposite of PostCommand)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all.
I have developed a small addin that if invoked after creating a section opens its view. It is inelegant but effective: it filters the ids of the views and the greater is the last view created.
FilteredElementCollector elementos = new FilteredElementCollector(doc); ICollection<ElementId> elementosIds = elementos.OfCategory(BuiltInCategory.OST_Views).ToElementIds(); List<int> idsNumero = new List<int>(); foreach(ElementId e in elementosIds) { idsNumero.Add(e.IntegerValue); } int ultimo = idsNumero.Max(); ElementId ultimoId = new ElementId(ultimo); View vistaNueva = doc.GetElement(ultimoId) as View; uidoc.ActiveView = vistaNueva; return Result.Succeeded;
The idea is that after executing the section command, the addin is automatically executed.
I need the opposite of PostCommand, first the command of Revit and then my code, is it possible?
Thanks 😉
Link copied