ParseCore.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:ParseCore
  3. * 作者:xulisong
  4. * 创建时间: 2019/6/13 18:03:03
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using JBIM;
  13. using JBIM.Component;
  14. using RevitToJBim.Common;
  15. namespace RevitToJBim.ComponentParse
  16. {
  17. /*
  18. * 核心解析类不解析关系
  19. */
  20. /// <summary>
  21. /// 核心解析类
  22. /// </summary>
  23. public class ParseCore
  24. {
  25. public static BimObject GetObject(object obj)
  26. {
  27. return null;
  28. }
  29. public static Connector CreateConnector(Autodesk.Revit.DB.Connector connector)
  30. {
  31. var result= new Connector();
  32. result.SourceId = RevitIdGenerator.GetConnectorId(connector);
  33. switch (connector.Domain)
  34. {
  35. case Autodesk.Revit.DB.Domain.DomainHvac:
  36. {
  37. result.Domain = ConnectorDomain.DomainHvac.ToString();
  38. break;
  39. }
  40. case Autodesk.Revit.DB.Domain.DomainPiping:
  41. {
  42. result.Domain = ConnectorDomain.DomainPiping.ToString();
  43. break;
  44. }
  45. }
  46. result.IsConnected = connector.IsConnected;
  47. result.Description = connector.Description;
  48. result.Origin = BimConverter.ConvertToXYZ(connector.Origin);
  49. return result;
  50. }
  51. public static MepSystem CreateConnector(Autodesk.Revit.DB.MEPSystem mepSystem)
  52. {
  53. var result= new MepSystem();
  54. result.Name = mepSystem.Name;
  55. result.SourceId = mepSystem.Id.ToString();
  56. return result;
  57. }
  58. public static MepSystemType CreateConnector(Autodesk.Revit.DB.MEPSystemType mepSystemType)
  59. {
  60. var result = new MepSystemType();
  61. result.Name = mepSystemType.Name;
  62. result.SourceId = mepSystemType.Id.ToString();
  63. return result;
  64. }
  65. }
  66. }