RevitCore.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:RevitCore
  3. * 作者:xulisong
  4. * 创建时间: 2019/3/12 10:44:21
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using Autodesk.Revit.UI;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using Autodesk.Revit.ApplicationServices;
  14. using Autodesk.Revit.DB;
  15. using Autodesk.Revit.UI.Selection;
  16. namespace FWindSoft.Revit
  17. {
  18. /// <summary>
  19. /// revit核心类信息
  20. /// </summary>
  21. public static class RevitCore
  22. {
  23. public static void InitCore(UIApplication application)
  24. {
  25. UIApp = application;
  26. }
  27. #region 关联属性
  28. //public static UIControlledApplication UIControlledApp { get; private set; }
  29. public static UIApplication UIApp { get; private set; }
  30. public static Application App
  31. {
  32. get
  33. {
  34. return UIApp?.Application; ;
  35. }
  36. }
  37. /// <summary>
  38. /// UIdocument
  39. /// </summary>
  40. public static UIDocument UIDoc
  41. {
  42. get
  43. {
  44. return UIApp?.ActiveUIDocument;
  45. }
  46. }
  47. public static Document Doc
  48. {
  49. get
  50. {
  51. return UIDoc?.Document;
  52. }
  53. }
  54. public static Autodesk.Revit.Creation.Application AppCreater
  55. {
  56. get { return App?.Create; }
  57. }
  58. public static Autodesk.Revit.Creation.Document DocCreater
  59. {
  60. get
  61. {
  62. return Doc?.Create;
  63. }
  64. }
  65. public static Selection Selection
  66. {
  67. get { return UIDoc?.Selection; }
  68. }
  69. #endregion
  70. }
  71. }