DocExtend.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* ==============================================================================
  2. * 功能描述:DocExtend
  3. * 创 建 者:Garrett
  4. * 创建日期:2018/6/11 16:00:53
  5. * ==============================================================================*/
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text.RegularExpressions;
  11. using Autodesk.Revit.DB;
  12. using SAGA.DotNetUtils;
  13. using SAGA.RevitUtils.Extends;
  14. using ServiceRevitLib.Common;
  15. namespace ServiceRevitLib.Extend
  16. {
  17. /// <summary>
  18. /// DocExtend
  19. /// </summary>
  20. public static class DocExtend
  21. {
  22. /// <summary>
  23. /// 获取所有的Docment中,设备或者部件
  24. /// </summary>
  25. /// <param name="doc"></param>
  26. /// <param name="bic"></param>
  27. /// <returns></returns>
  28. public static List<Element> GetEqEcElements(this Document doc)
  29. {
  30. List<Element> elements = new List<Element>();
  31. //elements.AddRange(doc.GetElements(typeof(Wall)));
  32. elements.AddRange(doc.GetElements(typeof(FamilyInstance)));
  33. return elements.Where(t=>t.IsMbiEquipment()).ToList();
  34. }
  35. }
  36. }