DetailCurveExtension.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using Autodesk.Revit.DB;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace FWindSoft.Revit
  8. {
  9. public static class DetailCurveExtension
  10. {
  11. public static DetailCurve NewDetailCurve(this View view ,Curve curve, Color color ,
  12. int lineWeight)
  13. {
  14. DetailCurve result = view.Document.Create.NewDetailCurve(view, curve);
  15. result.SetLineStyle(color, lineWeight,null);
  16. return result;
  17. }
  18. public static List<DetailCurve> NewDetailCurve(this View view,CurveArray curves,
  19. Color color ,int lineWeight)
  20. {
  21. var listLines = view.Document.Create.NewDetailCurveArray(view, curves).OfType<DetailCurve>().ToList();
  22. foreach (var detailCurve in listLines)
  23. {
  24. if (detailCurve == null)
  25. continue;
  26. detailCurve.SetLineStyle(color, lineWeight,null);
  27. }
  28. return listLines;
  29. }
  30. }
  31. }