Beispiel #1
0
        public static Rectangle Outline(View view)
        {
            var v = (Autodesk.Revit.DB.View)view.InternalElement;

            if (v == null)
            {
                throw new ArgumentNullException(nameof(view));
            }

            var o   = v.Outline;
            var pt1 = new Autodesk.Revit.DB.XYZ(o.Min.U, o.Min.V, 0);
            var pt2 = new Autodesk.Revit.DB.XYZ(o.Max.U, o.Min.V, 0);
            var pt3 = new Autodesk.Revit.DB.XYZ(o.Max.U, o.Max.V, 0);
            var pt4 = new Autodesk.Revit.DB.XYZ(o.Min.U, o.Max.V, 0);

            return(Rectangle.ByCornerPoints(pt1.ToPoint(), pt2.ToPoint(), pt3.ToPoint(), pt4.ToPoint()));
        }