Hi,
Thank you Jeremy and respresso for bringing this topic to my attention.
I was not aware this question was raised a few years ago.
I maybe have a workaround for this question, something similar i assume.
Select some views in the Project Browser to know if the views are placed on sheet(s).
Then, run a macro or IExternalcommand to execute the command, something like inserted (macro)code as an example;
If view is placed on Sheet, then show the sheetnumber, sheetname or whatever data you interested in of the ViewSheet that is referenced to the selected views in the Project Browser.
Hope this is useful for you or point you to the right direction.
public void GetViewSheetFromView()
{
UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
string data = "";
ICollection<ElementId> selectedIds = uidoc.Selection.GetElementIds();
foreach (ElementId selectedid in selectedIds)
{
View e = doc.GetElement(selectedid) as View;
foreach (View v in new FilteredElementCollector(doc).OfClass(typeof(View)).Cast<View>().Where(q => q.Id.Equals(e.Id)))
{
string thisSheet = "";
foreach (ViewSheet vs in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>())
{
foreach (ElementId eid in vs.GetAllPlacedViews())
{
View ev = doc.GetElement(eid) as View;
if(ev.Id == v.Id)
{
thisSheet += vs.SheetNumber + " - " + vs.Name + Environment.NewLine ;
break;
}
}
}
if (thisSheet != "")
{
data += v.ViewType + ": " + v.Name + " " + Environment.NewLine + thisSheet.TrimEnd(' ',',') + Environment.NewLine;
}
else
{
data += v.ViewType + ": " + v.Name + " " + Environment.NewLine + thisSheet.TrimEnd(' ',',');
data += " NOT ON SHEET " + Environment.NewLine + "\n" ;
}
}
}
TaskDialog.Show("View Report", data);
}
