CurveLoopExtension.cs 949 B

1234567891011121314151617181920212223242526272829303132
  1. /* ==============================================================================
  2. * 功能描述:CurveLoopExtension
  3. * 创 建 者:Garrett
  4. * 创建日期:2019/10/9 16:08:11
  5. * ==============================================================================*/
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using Autodesk.Revit.DB;
  12. namespace SAGA.MBI.RevitExport.Entity
  13. {
  14. public static class CurveLoopExtension
  15. {
  16. public static List<Autodesk.Revit.DB.XYZ> GetPolygon(this CurveLoop curveLoop)
  17. {
  18. List<Autodesk.Revit.DB.XYZ> polygon = new List<Autodesk.Revit.DB.XYZ>();
  19. foreach (Curve curve in curveLoop)
  20. {
  21. var points = curve.Tessellate();
  22. points.RemoveAt(points.Count - 1);
  23. polygon.AddRange(points);
  24. }
  25. return polygon;
  26. }
  27. }
  28. }