/// <summary> /// Deep clone, to avoid mess up the original data during offsetting the boundary. /// </summary> /// <returns>Cloned object</returns> public Trapezoid Clone() { return(new Trapezoid( Top.Clone() as Line, Vertical.Clone() as Line, Bottom.Clone() as Line, Slanted.Clone() as Line)); }
/// <summary> /// Draw the trapezoid wire-frame with Revit Model curves. /// It's for debug use, to help developer see the exact location. /// </summary> /// <param name="revitDoc">Revit DB Document</param> public void Draw(Document revitDoc) { XYZ topDir = (Top.GetEndPoint(1) - Top.GetEndPoint(0)).Normalize(); XYZ verticalDir = (Vertical.GetEndPoint(0) - Vertical.GetEndPoint(1)).Normalize(); XYZ normal = topDir.CrossProduct(verticalDir); SketchPlane sketchplane = SketchPlane.Create(revitDoc, new Plane(normal, Vertical.GetEndPoint(0))); CurveArray curves = new CurveArray(); curves.Append(Top.Clone()); curves.Append(Vertical.Clone()); curves.Append(Bottom.Clone()); curves.Append(Slanted.Clone()); revitDoc.Create.NewModelCurveArray(curves, sketchplane); }