ColumnCheck.cs 1.8 KB

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