ColumnCheck.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* ==============================================================================
  2. * 功能描述:SagaCheck
  3. * 创 建 者:Garrett
  4. * 创建日期:2019/6/11 16:09:09
  5. * ==============================================================================*/
  6. using System;
  7. using System.Linq;
  8. using System.Text.RegularExpressions;
  9. using Autodesk.Revit.DB;
  10. using SAGA.DotNetUtils.Extend;
  11. using ServiceRevitLib.Common;
  12. using SAGA.RevitUtils.Extends;
  13. using ServiceRevitLib.Extend;
  14. namespace ServiceRevitLib.Mode
  15. {
  16. /// <summary>
  17. /// SagaCheck
  18. /// </summary>
  19. class ColumnCheck : CheckBase
  20. {
  21. public override void Check()
  22. {
  23. base.Check();
  24. #region
  25. var document = m_Doc;
  26. var elements = document.GetElements<FamilyInstance>(BuiltInCategory.OST_StructuralColumns);
  27. foreach (FamilyInstance fi in elements)
  28. {
  29. var result = new ColumnCheckResult();
  30. result.FamilyName = fi.GetFamilyName();
  31. result.Id = fi.Id.ToString();
  32. var roomBoundaries = fi.GetParameterInteger(BuiltInParameter.WALL_ATTR_ROOM_BOUNDING);
  33. if (roomBoundaries == 1)
  34. {
  35. result.Result = ResultState.Success;
  36. }
  37. else
  38. {
  39. result.Result = ResultState.Failure;
  40. result.ResultMsg = "柱的房间边界属性 未勾选";
  41. }
  42. Content.Add(result);
  43. }
  44. #endregion
  45. }
  46. }
  47. }