This Revit Macro will find the bounding boxes of the section mark in a view, and the bounding box of the corresponding section view.
public void GetASectionBBox()
{
//find the bounding boxes of teh section mark and the section view
UIDocument uidoc = ActiveUIDocument;
Document doc = ActiveUIDocument.Document;
Autodesk.Revit.DB.View pView = ActiveUIDocument.Document.ActiveView;
Selection selection = uidoc.Selection;
ICollection<ElementId> selectedIds = uidoc.Selection.GetElementIds();
IList<Autodesk.Revit.DB.View> selected = new List<Autodesk.Revit.DB.View>();
foreach (ElementId id in selectedIds)
{
//TaskDialog.Show("Revit", "Start Loop"); //Made it this far
Element e = doc.GetElement(id);
//TaskDialog.Show("Made It", "Ready to start section location finding.");
BoundingBoxXYZ mybox = e.get_BoundingBox(pView);
//TaskDialog.Show(mybox.Min.ToString (), mybox.Max.ToString());
//TaskDialog.Show("Revit", e.Name.ToString()); //find the name of the section
//Parameter pr = e.LookupParameter ("Referenced View"); //works
string viewname = e.Name.ToString();
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector.OfClass(typeof(ViewSection));
foreach (ViewSection current in collector)
{
if (current.Name == viewname)
{
//Transaction tx = new Transaction(doc);
//tx.Start( "Open Section" );
uidoc.ActiveView = current;
uidoc.RefreshActiveView();
break;
//tx.Commit();
} // end if
}// end foreach ViewSection
BoundingBoxXYZ mybox2 = e.get_BoundingBox(uidoc.ActiveView);
TaskDialog.Show("Limits Before and After", mybox.Min.ToString () + "\r\n" + mybox.Max.ToString() + "\r\n\r\n\r\n" + mybox2.Min.ToString() + "\r\n" + mybox2.Max.ToString () );
//TaskDialog.Show("Limits Before and After", PointString(mybox.Min) + "\r\n" + PointString(mybox.Max) + "\r\n" + Util.PointString(mybox2.Min) + "\r\n" + Util.PointString(mybox2.Max) );
}//end foreach Element ID
}