Not sure if it's a good answer, but I did find a way to do it. Basically find the element that corresponds to a given view, and then iterating through views that are on sheets and checking agaisnt them. The slowdown occurs when iterating through the views and looking for the element (section mark, callout, elvation marker,...) The FilteredElementCollector with the view override can be really slow when it has to open a lot of views and look through them. The benefit is that once you've done it once, doing it again for another view is actually pretty fast. So first time takes minutes, beyond that it takes seconds.
public void ReferenceViews()
{
Document doc = this.ActiveUIDocument.Document;
View view = doc.ActiveView;
FilteredElementCollector viewersCollector = new FilteredElementCollector(doc);
viewersCollector.OfCategory(BuiltInCategory.OST_Viewers);
Element elem = null;
foreach(Element e in viewersCollector)
{
if(e.Name == view.Name)
elem = e;
}
if(elem != null)
{
DateTime start = DateTime.Now;
FilterableValueProvider provider = new ParameterValueProvider(new ElementId(BuiltInParameter.VIEWPORT_SHEET_NUMBER));
FilterRule rule = new FilterStringRule(provider, new FilterStringGreater(), string.Empty, false);
ElementParameterFilter epf = new ElementParameterFilter(rule, false);
FilteredElementCollector viewCol = new FilteredElementCollector(doc).WherePasses(epf);
viewCol.OfClass(typeof(View));
StringBuilder sb = new StringBuilder();
foreach(View v in viewCol)
{
if(v.Id.IntegerValue == view.Id.IntegerValue || v.IsTemplate || v.ViewType == ViewType.DrawingSheet || v.ViewType == ViewType.ColumnSchedule)
continue;
try
{
ICollection<ElementId> col = new FilteredElementCollector(doc, v.Id).ToElementIds();
if(col.Contains(elem.Id))
sb.AppendLine("View: " + v.Name);
}
catch{}
}
TaskDialog.Show("Test", "Time Elapsed: " + (DateTime.Now - start).ToString() + "\n" + sb.ToString());
}
}