I would like to be able to flip a live section using the Revit 2017 API. It would be the equivalent of the UI feature seen in my images below.
I've tried using the built-in ElementTransformUtils.MirrorElement
but that will only create a second section marker with a second section view. Is there any way that I can achieve this using the Revit API?
I got a solution to my post How can I flip a section using the Revit 2017 API on the Revit API forum. It turns out that I overlooked the plural ElementTransformUtils.MirrorElements
function which I assumed was almost exactly the same as the singular ElementTransformUtils.MirrorElement
except for doing multiple element mirrors instead of a single mirror. The plural ElementTransformUtils.MirrorElements
has a bool mirrorCopies
parameter that you can set to false
which will force the original section to be mirrored instead of just making mirrored copy of the original. Here are the two function signatures side-by-side:
void MirrorElement(
Document document,
ElementId elementToMirror,
Plane plane
);
IList<ElementId> MirrorElements(
Document document,
ICollection<ElementId> elementsToMirror,
Plane plane,
bool mirrorCopies
);
My code ends up looking like this (with elementsToMirror
only containing a single element):
ElementTransformUtils.MirrorElements(document, elementsToMirror, mirrorPlane, false);