lixiaojun
2022-11-23 b5c20e5143555a1bdd450a1e660216b90c93b6f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace IStation.Bimface
{
    /// <summary>
    ///  rvt 模型配置项
    /// </summary>
    public class RvtModelConfig
    {
        public RvtModelConfig()
        {
            //设置 null,在序列化的时候忽略该字段,不出现在序列化后的字符串中
            this.texture = null;
            this.exportDwg = null;
            this.exportDrawing = null;
            this.exportPdf = null;
            this.viewName = null;
            this.displaylevel = null;
            this.exportDwgInstance = null;
            this.exportHiddenObjects = null;
            this.exportSystemType = null;
            this.exportProperties = null;
            this.unit = null;
            this.exportSchedule = null;
        }
 
        /// <summary>
        ///  转换时是否添加材质。默认为 false
        /// </summary>
        public bool? texture { get; set; }
 
        /// <summary>
        ///  rvt2md是否导出dwg文件。默认为 false
        /// </summary>
        public bool? exportDwg { get; set; }
 
        /// <summary>
        ///  dwg2md是否导出mdv(矢量化图纸);取值为true时,exportDwg自动设置为true。默认为 false
        /// </summary>
        public bool? exportDrawing { get; set; }
 
        /// <summary>
        ///  dwg2md是否导出pdf文件。默认为 false
        /// </summary>
        public bool? exportPdf { get; set; }
 
        /// <summary>
        ///  转换使用的3D视图。默认为 {3D}
        /// </summary>
        public string viewName { get; set; }
 
        /// <summary>
        ///  设置转换的精细度,fine(精细),medium(中等),coarse(粗略)。默认为 fine
        /// </summary>
        public string displaylevel { get; set; }
 
        /// <summary>
        /// 是否导出dwg实例。默认为 false
        /// </summary>
        public bool? exportDwgInstance { get; set; }
 
        /// <summary>
        /// 是否导出三维视图中隐藏的构件。默认为 false
        /// </summary>
        public bool? exportHiddenObjects { get; set; }
 
        /// <summary>
        /// 是否在userData中加入mepSystemType。默认为 false
        /// </summary>
        public bool? exportSystemType { get; set; }
 
        /// <summary>
        /// 是否在导出NWD的属性db文件。默认为 false
        /// </summary>
        public bool? exportProperties { get; set; }
 
        /// <summary>
        ///  设置转换使用的单位,取值"ft"\"feet"\"英尺"采用revit默认的英尺为单位,默认以毫米为单位。默认为空
        /// </summary>
        public string unit { get; set; }
 
        /// <summary>
        /// 是否使用明细表内容。默认为 false
        /// </summary>
        public bool? exportSchedule { get; set; }
 
        /// <summary>
        /// 获取JSON字典
        /// </summary>
        /// <returns></returns>
        public virtual Dictionary<string, object> GetJsonDict()
        {
            var dic = new Dictionary<string, object>();
            if (this.texture != null)
                dic.Add("texture", this.texture);
            if (this.exportDwg != null)
                dic.Add("exportDwg", this.exportDwg);
            if (this.exportDrawing != null)
                dic.Add("exportDrawing", this.exportDrawing);
            if (this.exportPdf != null)
                dic.Add("exportPdf", this.exportPdf);
            if (!string.IsNullOrEmpty(this.viewName))
                dic.Add("viewName", this.viewName);
            if (!string.IsNullOrEmpty(this.displaylevel))
                dic.Add("displaylevel", this.displaylevel);
            if (this.exportDwgInstance != null)
                dic.Add("exportDwgInstance", this.exportDwgInstance);
            if (this.exportHiddenObjects != null)
                dic.Add("exportHiddenObjects", this.exportHiddenObjects);
            if (this.exportSystemType != null)
                dic.Add("exportSystemType", this.exportSystemType);
            if (this.exportProperties != null)
                dic.Add("exportProperties", this.exportProperties);
            if (!string.IsNullOrEmpty(this.unit))
                dic.Add("unit", this.unit);
            if (this.exportSchedule != null)
                dic.Add("exportSchedule", this.exportSchedule);
            return dic;
        }
    }
}