I want to be able to mirror all of the elements in a drafting view according to the midpoint of the x value extents of the drawing. xMidpoint in the example below is what I’m trying to get.
I have Revit 2012 available.
int xMidpoint;
Plane plane = new Plane(new XYZ(1,0,0), new XYZ(xMidpoint,0,0));
ElementTransformUtils.MirrorElements(document, idsOfElementsToMirror, plane);
After browsing the Revit API for a while I came up with the code below for finding the midpoint. It uses the bounding extents of each element to find the maximum and minimum x values in the drawing.