Message 1 of 2
Create a plane based on CurveElement (Line)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using ElementTransformUtils.MirrorElement method to mirror some elements and obviously I need a plane for that. The requirement is that the user selects a curve element (most likely a simple line) and I have to create a plane based on this line, so I do the following:
var startPoint = curveElement.GeometryCurve.GetEndPoint(0);
var endPoint = curveElement.GeometryCurve.GetEndPoint(1);
var plane = Plane.CreateByThreePoints(startPoint, endPoint, new XYZ(endPoint.X, endPoint.Y, endPoint.Z + 10));
This works just fine, but I am curious if there's a better way to do it. Technically, the user always operates on XY plane, so I always add something to Z (see the code above) in order to create the mirror plane, but what about the 3D view? I imagine that a simple line is not sufficient to create a mirror plane in 3D, but a line + source element to copy should probably be doable by using normal and origin? How would you approach this in the Revit API?