tx
2025-04-22 e0b138b3e057de6f57021e6c8963868f5c5acc5a
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
using WW.Cad.Base;
using WW.Cad.Drawing;
using WW.Cad.Drawing.GDI;
using WW.Cad.IO;
using WW.Cad.Model;
using WW.Math;
using WW.Cad.Model.Entities;
using WW.Actions;
using WW.Cad.Model.Tables;
using WW.Cad.Model.Objects;
 
namespace TProduct.PumpGraph.Dxf
{
    public partial class LxpFeatChart7
    {
 
        //标题栏
        private void DrawFrameTtileText()
        {
            if (_dwgObjectDict == null)
                return;
            // 设备名称
            if (_dwgObjectDict.ContainsKey("ItemName"))
            {
                Point3D pt1 = new Point3D(-3, 198, 0d);
 
                DxfMText frame_label = new DxfMText(_dwgObjectDict["ItemName"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
            //设备位号
            if (_dwgObjectDict.ContainsKey("ItemCode"))
            {
                Point3D pt1 = new Point3D(70 - 5, 198, 0d);
 
                DxfMText frame_label = new DxfMText(_dwgObjectDict["ItemCode"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
 
            //流量
            if (_dwgObjectDict.ContainsKey("DesignPointQ"))
            {
                Point3D pt1 = new Point3D(125, 198, 0d);
 
                DxfMText frame_label = new DxfMText(string.Format("{0}m³/h", _dwgObjectDict["DesignPointQ"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
 
                var font_gbenor = new DxfTextStyle("gbenor", "gbenor.shx");
                //font_gbenor.FontStyle = System.Drawing.FontStyle.
                font_gbenor.BigFontFilename = "bigfont.shx";
                _dxfFileModel.TextStyles.Add(font_gbenor);
 
                if (font_gbenor != null)
                    frame_label.Style = font_gbenor;
                else if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
 
 
            //转速
            if (_dwgObjectDict.ContainsKey("WorkSpeed"))
            {
                Point3D pt1 = new Point3D(70, 190, 0d);
 
                DxfMText frame_label = new DxfMText(string.Format("{0}r/min", _dwgObjectDict["WorkSpeed"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
 
            //扬程
            if (_dwgObjectDict.ContainsKey("DesignPointH"))
            {
                Point3D pt1 = new Point3D(125, 190, 0d);
 
                DxfMText frame_label = new DxfMText(string.Format("{0}m", _dwgObjectDict["DesignPointH"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
            //输送介质
            if (_dwgObjectDict.ContainsKey("JieZhiName"))
            {
                Point3D pt1 = new Point3D(-3, 182, 0d);
 
                DxfMText frame_label = new DxfMText(_dwgObjectDict["JieZhiName"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
 
            //粘度
            if (_dwgObjectDict.ContainsKey("JieZhiViscosity"))
            {
                Point3D pt1 = new Point3D(70, 182, 0d);
 
                DxfMText frame_label = new DxfMText(string.Format("{0}cp", _dwgObjectDict["JieZhiViscosity"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
            //比重
            if (_dwgObjectDict.ContainsKey("JieZhiBiZhong"))
            {
                Point3D pt1 = new Point3D(125, 182, 0d);
 
                DxfMText frame_label = new DxfMText(_dwgObjectDict["JieZhiBiZhong"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                // frame_label.ReferenceRectangleHeight = 55;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
            //型号
            if (_dwgObjectDict.ContainsKey("ProductName"))
            {//字典里面信息优先度更高
                _productName = _dwgObjectDict["ProductName"].Replace("-2900", "").Replace("-1475", ""); ;
            }
 
 
            if (!string.IsNullOrEmpty(_productName))
            {
                Point3D pt1 = new Point3D(105 + 18, -62, 0d);
                DxfMText axisLabel = new DxfMText(_productName, pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    axisLabel.Style = _frameTextFont;
                axisLabel.AttachmentPoint = AttachmentPoint.MiddleCenter;
                axisLabel.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(axisLabel);
 
 
 
                Point3D pt2 = new Point3D(-3, 190, 0d);
                DxfMText frame_label = new DxfMText(_productName, pt2, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    frame_label.Style = _frameTextFont;
                frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
                frame_label.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(frame_label);
            }
 
            if (!string.IsNullOrEmpty(this._kindName))
            {
                Point3D pt = new Point3D(58, -28, 0d);
                DxfMText axisLabel = new DxfMText(this._kindName, pt, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    axisLabel.Style = _frameTextFont;
                axisLabel.AttachmentPoint = AttachmentPoint.MiddleLeft;
                axisLabel.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(axisLabel);
            }
            else if (!string.IsNullOrEmpty(this._catalogName))
            {
                Point3D pt = new Point3D(78, -28, 0d);
                DxfMText axisLabel = new DxfMText(_catalogName, pt, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
                if (_frameTextFont != null)
                    axisLabel.Style = _frameTextFont;
                axisLabel.AttachmentPoint = AttachmentPoint.MiddleCenter;
                axisLabel.Color = _frameTextColor;
                _dxfFileModel.Entities.Add(axisLabel);
            }
        }
 
 
 
    }
}