qyx 4 天前
父节点
当前提交
a2724615bf
共有 100 个文件被更改,包括 17709 次插入0 次删除
  1. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/.vs/Thumbnail/v16/.suo
  2. 20
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail.sln
  3. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail.v11.suo
  4. 241
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Form1.Designer.cs
  5. 143
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Form1.cs
  6. 120
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Form1.resx
  7. 167
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/MainClass.cs
  8. 36
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Properties/AssemblyInfo.cs
  9. 86
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Properties/Settings.Designer.cs
  10. 21
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Properties/Settings.settings
  11. 93
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Thumbnail.csproj
  12. 8
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Thumbnail.csproj.user
  13. 27
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/app.config
  14. 3
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Drawing1.dwl
  15. 7
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Drawing1.dwl2
  16. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail.dll
  17. 27
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail.dll.config
  18. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail.pdb
  19. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail_selewindow.dll
  20. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail显示坐标.dll
  21. 114
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/acad.err
  22. 2433
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/getThumbnail.cs
  23. 4
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttributes.cs
  24. 4
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs
  25. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  26. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  27. 0
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  28. 0
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  29. 0
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
  30. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.Form1.resources
  31. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.AssemblyReference.cache
  32. 1
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.CoreCompileInputs.cache
  33. 36
    0
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.FileListAbsolute.txt
  34. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.GenerateResource.cache
  35. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.dll
  36. 二进制
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.pdb
  37. 二进制
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/.suo
  38. 二进制
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/000.testlog
  39. 二进制
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/testlog.manifest
  40. 25
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools.sln
  41. 53
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/App.config
  42. 158
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.Designer.cs
  43. 277
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.cs
  44. 123
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.resx
  45. 263
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Attributeget.cs
  46. 2636
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CMCgis_Basicfunction.cs
  47. 1103
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ChPLContradiction.cs
  48. 171
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.Designer.cs
  49. 352
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.cs
  50. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.resx
  51. 95
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckContourLine.cs
  52. 147
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.Designer.cs
  53. 101
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.cs
  54. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.resx
  55. 422
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckPLOverlay.cs
  56. 154
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.Designer.cs
  57. 113
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.cs
  58. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.resx
  59. 479
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Connect.cs
  60. 173
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ContourLineFix.cs
  61. 856
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutContourLine.cs
  62. 244
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.Designer.cs
  63. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.cs
  64. 143
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.resx
  65. 131
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.Designer.cs
  66. 76
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.cs
  67. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.resx
  68. 193
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneralization.cs
  69. 150
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.Designer.cs
  70. 93
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.cs
  71. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.resx
  72. 149
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeletePts.cs
  73. 153
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnnck.cs
  74. 170
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.Designer.cs
  75. 101
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.cs
  76. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.resx
  77. 97
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.Designer.cs
  78. 38
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.cs
  79. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.resx
  80. 351
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinters.cs
  81. 398
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd.cs
  82. 176
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.Designer.cs
  83. 94
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.cs
  84. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.resx
  85. 288
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ElePtCheck.cs
  86. 124
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.Designer.cs
  87. 85
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.cs
  88. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.resx
  89. 71
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRound.cs
  90. 156
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDenck.cs
  91. 170
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.Designer.cs
  92. 100
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.cs
  93. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.resx
  94. 612
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/FeatureOverlap.cs
  95. 114
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.Designer.cs
  96. 159
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.cs
  97. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.resx
  98. 331
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/HCTools.csproj
  99. 10
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/HCTools.csproj.user
  100. 0
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.Designer.cs

二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/.vs/Thumbnail/v16/.suo 查看文件


+ 20
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail.sln 查看文件

@@ -0,0 +1,20 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 2012
4
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thumbnail", "Thumbnail\Thumbnail.csproj", "{325D619D-651B-42EA-BA93-01121126A2AF}"
5
+EndProject
6
+Global
7
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
8
+		Debug|Any CPU = Debug|Any CPU
9
+		Release|Any CPU = Release|Any CPU
10
+	EndGlobalSection
11
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
12
+		{325D619D-651B-42EA-BA93-01121126A2AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13
+		{325D619D-651B-42EA-BA93-01121126A2AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
14
+		{325D619D-651B-42EA-BA93-01121126A2AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
15
+		{325D619D-651B-42EA-BA93-01121126A2AF}.Release|Any CPU.Build.0 = Release|Any CPU
16
+	EndGlobalSection
17
+	GlobalSection(SolutionProperties) = preSolution
18
+		HideSolutionNode = FALSE
19
+	EndGlobalSection
20
+EndGlobal

二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail.v11.suo 查看文件


+ 241
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Form1.Designer.cs 查看文件

@@ -0,0 +1,241 @@
1
+namespace Thumbnail
2
+{
3
+    partial class Form1
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.label1 = new System.Windows.Forms.Label();
32
+            this.label2 = new System.Windows.Forms.Label();
33
+            this.label3 = new System.Windows.Forms.Label();
34
+            this.textBox_files = new System.Windows.Forms.TextBox();
35
+            this.textBox_tk = new System.Windows.Forms.TextBox();
36
+            this.textBox_iplfiles = new System.Windows.Forms.TextBox();
37
+            this.button_files = new System.Windows.Forms.Button();
38
+            this.button_tk = new System.Windows.Forms.Button();
39
+            this.button_iplfiles = new System.Windows.Forms.Button();
40
+            this.button_ok = new System.Windows.Forms.Button();
41
+            this.label4 = new System.Windows.Forms.Label();
42
+            this.comboBox_blc = new System.Windows.Forms.ComboBox();
43
+            this.label5 = new System.Windows.Forms.Label();
44
+            this.label6 = new System.Windows.Forms.Label();
45
+            this.textBox_tkn = new System.Windows.Forms.TextBox();
46
+            this.textBox_tfh = new System.Windows.Forms.TextBox();
47
+            this.SuspendLayout();
48
+            // 
49
+            // label1
50
+            // 
51
+            this.label1.AutoSize = true;
52
+            this.label1.Location = new System.Drawing.Point(39, 17);
53
+            this.label1.Name = "label1";
54
+            this.label1.Size = new System.Drawing.Size(157, 15);
55
+            this.label1.TabIndex = 0;
56
+            this.label1.Text = "待替换文件所在位置:";
57
+            // 
58
+            // label2
59
+            // 
60
+            this.label2.AutoSize = true;
61
+            this.label2.Location = new System.Drawing.Point(39, 68);
62
+            this.label2.Name = "label2";
63
+            this.label2.Size = new System.Drawing.Size(127, 15);
64
+            this.label2.TabIndex = 1;
65
+            this.label2.Text = "截图表所在位置:";
66
+            // 
67
+            // label3
68
+            // 
69
+            this.label3.AutoSize = true;
70
+            this.label3.Location = new System.Drawing.Point(39, 118);
71
+            this.label3.Name = "label3";
72
+            this.label3.Size = new System.Drawing.Size(157, 15);
73
+            this.label3.TabIndex = 2;
74
+            this.label3.Text = "替换后文件保存位置:";
75
+            // 
76
+            // textBox_files
77
+            // 
78
+            this.textBox_files.Location = new System.Drawing.Point(207, 12);
79
+            this.textBox_files.Name = "textBox_files";
80
+            this.textBox_files.Size = new System.Drawing.Size(260, 25);
81
+            this.textBox_files.TabIndex = 3;
82
+            // 
83
+            // textBox_tk
84
+            // 
85
+            this.textBox_tk.Location = new System.Drawing.Point(207, 61);
86
+            this.textBox_tk.Name = "textBox_tk";
87
+            this.textBox_tk.Size = new System.Drawing.Size(260, 25);
88
+            this.textBox_tk.TabIndex = 4;
89
+            // 
90
+            // textBox_iplfiles
91
+            // 
92
+            this.textBox_iplfiles.Location = new System.Drawing.Point(207, 108);
93
+            this.textBox_iplfiles.Name = "textBox_iplfiles";
94
+            this.textBox_iplfiles.Size = new System.Drawing.Size(260, 25);
95
+            this.textBox_iplfiles.TabIndex = 5;
96
+            // 
97
+            // button_files
98
+            // 
99
+            this.button_files.Location = new System.Drawing.Point(499, 7);
100
+            this.button_files.Name = "button_files";
101
+            this.button_files.Size = new System.Drawing.Size(75, 30);
102
+            this.button_files.TabIndex = 6;
103
+            this.button_files.Text = "选 择";
104
+            this.button_files.UseVisualStyleBackColor = true;
105
+            this.button_files.Click += new System.EventHandler(this.button_files_Click);
106
+            // 
107
+            // button_tk
108
+            // 
109
+            this.button_tk.Location = new System.Drawing.Point(499, 56);
110
+            this.button_tk.Name = "button_tk";
111
+            this.button_tk.Size = new System.Drawing.Size(75, 30);
112
+            this.button_tk.TabIndex = 7;
113
+            this.button_tk.Text = "选 择";
114
+            this.button_tk.UseVisualStyleBackColor = true;
115
+            this.button_tk.Click += new System.EventHandler(this.button_tk_Click);
116
+            // 
117
+            // button_iplfiles
118
+            // 
119
+            this.button_iplfiles.Location = new System.Drawing.Point(499, 103);
120
+            this.button_iplfiles.Name = "button_iplfiles";
121
+            this.button_iplfiles.Size = new System.Drawing.Size(75, 30);
122
+            this.button_iplfiles.TabIndex = 8;
123
+            this.button_iplfiles.Text = "选 择";
124
+            this.button_iplfiles.UseVisualStyleBackColor = true;
125
+            this.button_iplfiles.Click += new System.EventHandler(this.button_iplfiles_Click);
126
+            // 
127
+            // button_ok
128
+            // 
129
+            this.button_ok.Location = new System.Drawing.Point(253, 295);
130
+            this.button_ok.Name = "button_ok";
131
+            this.button_ok.Size = new System.Drawing.Size(75, 31);
132
+            this.button_ok.TabIndex = 9;
133
+            this.button_ok.Text = "确  定";
134
+            this.button_ok.UseVisualStyleBackColor = true;
135
+            this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
136
+            // 
137
+            // label4
138
+            // 
139
+            this.label4.AutoSize = true;
140
+            this.label4.Location = new System.Drawing.Point(39, 258);
141
+            this.label4.Name = "label4";
142
+            this.label4.Size = new System.Drawing.Size(97, 15);
143
+            this.label4.TabIndex = 10;
144
+            this.label4.Text = "选择比例尺:";
145
+            // 
146
+            // comboBox_blc
147
+            // 
148
+            this.comboBox_blc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
149
+            this.comboBox_blc.FormattingEnabled = true;
150
+            this.comboBox_blc.Items.AddRange(new object[] {
151
+            "1:500",
152
+            "1:1000",
153
+            "1:2000",
154
+            "1:5000",
155
+            "1:10000"});
156
+            this.comboBox_blc.Location = new System.Drawing.Point(207, 250);
157
+            this.comboBox_blc.Name = "comboBox_blc";
158
+            this.comboBox_blc.Size = new System.Drawing.Size(172, 23);
159
+            this.comboBox_blc.TabIndex = 11;
160
+            // 
161
+            // label5
162
+            // 
163
+            this.label5.AutoSize = true;
164
+            this.label5.Location = new System.Drawing.Point(39, 163);
165
+            this.label5.Name = "label5";
166
+            this.label5.Size = new System.Drawing.Size(187, 15);
167
+            this.label5.TabIndex = 12;
168
+            this.label5.Text = "结合表图框所在图层名称:";
169
+            // 
170
+            // label6
171
+            // 
172
+            this.label6.AutoSize = true;
173
+            this.label6.Location = new System.Drawing.Point(39, 206);
174
+            this.label6.Name = "label6";
175
+            this.label6.Size = new System.Drawing.Size(202, 15);
176
+            this.label6.TabIndex = 13;
177
+            this.label6.Text = "结合表图幅号所在图层名称:";
178
+            // 
179
+            // textBox_tkn
180
+            // 
181
+            this.textBox_tkn.Location = new System.Drawing.Point(253, 163);
182
+            this.textBox_tkn.Name = "textBox_tkn";
183
+            this.textBox_tkn.Size = new System.Drawing.Size(126, 25);
184
+            this.textBox_tkn.TabIndex = 14;
185
+            // 
186
+            // textBox_tfh
187
+            // 
188
+            this.textBox_tfh.Location = new System.Drawing.Point(253, 206);
189
+            this.textBox_tfh.Name = "textBox_tfh";
190
+            this.textBox_tfh.Size = new System.Drawing.Size(126, 25);
191
+            this.textBox_tfh.TabIndex = 15;
192
+            // 
193
+            // Form1
194
+            // 
195
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
196
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
197
+            this.ClientSize = new System.Drawing.Size(644, 346);
198
+            this.Controls.Add(this.textBox_tfh);
199
+            this.Controls.Add(this.textBox_tkn);
200
+            this.Controls.Add(this.label6);
201
+            this.Controls.Add(this.label5);
202
+            this.Controls.Add(this.comboBox_blc);
203
+            this.Controls.Add(this.label4);
204
+            this.Controls.Add(this.button_ok);
205
+            this.Controls.Add(this.button_iplfiles);
206
+            this.Controls.Add(this.button_tk);
207
+            this.Controls.Add(this.button_files);
208
+            this.Controls.Add(this.textBox_iplfiles);
209
+            this.Controls.Add(this.textBox_tk);
210
+            this.Controls.Add(this.textBox_files);
211
+            this.Controls.Add(this.label3);
212
+            this.Controls.Add(this.label2);
213
+            this.Controls.Add(this.label1);
214
+            this.Name = "Form1";
215
+            this.Text = "接图表替换";
216
+            this.Load += new System.EventHandler(this.Form1_Load);
217
+            this.ResumeLayout(false);
218
+            this.PerformLayout();
219
+
220
+        }
221
+
222
+        #endregion
223
+
224
+        private System.Windows.Forms.Label label1;
225
+        private System.Windows.Forms.Label label2;
226
+        private System.Windows.Forms.Label label3;
227
+        private System.Windows.Forms.TextBox textBox_files;
228
+        private System.Windows.Forms.TextBox textBox_tk;
229
+        private System.Windows.Forms.TextBox textBox_iplfiles;
230
+        private System.Windows.Forms.Button button_files;
231
+        private System.Windows.Forms.Button button_tk;
232
+        private System.Windows.Forms.Button button_iplfiles;
233
+        private System.Windows.Forms.Button button_ok;
234
+        private System.Windows.Forms.Label label4;
235
+        private System.Windows.Forms.ComboBox comboBox_blc;
236
+        private System.Windows.Forms.Label label5;
237
+        private System.Windows.Forms.Label label6;
238
+        private System.Windows.Forms.TextBox textBox_tkn;
239
+        private System.Windows.Forms.TextBox textBox_tfh;
240
+    }
241
+}

+ 143
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Form1.cs 查看文件

@@ -0,0 +1,143 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace Thumbnail
13
+{
14
+    public partial class Form1 : Form
15
+    {
16
+        public Form1()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void Form1_Load(object sender, EventArgs e)
22
+        {
23
+            textBox_files.Text = Properties.Settings.Default.files;
24
+            textBox_tk.Text = Properties.Settings.Default.jtb;
25
+            textBox_iplfiles.Text = Properties.Settings.Default.svpath;
26
+            textBox_tkn.Text = Properties.Settings.Default.tk;
27
+            textBox_tfh.Text = Properties.Settings.Default.tfh;
28
+        }
29
+
30
+        private void button_files_Click(object sender, EventArgs e)
31
+        {
32
+            FolderBrowserDialog open = new FolderBrowserDialog();
33
+            open.Description = "请选择文件夹";
34
+            if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK)
35
+                textBox_files.Text = open.SelectedPath;
36
+        }
37
+
38
+        private void button_tk_Click(object sender, EventArgs e)
39
+        {
40
+            OpenFileDialog open = new OpenFileDialog();
41
+            open.Title = "请选择文件";
42
+            if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK)
43
+                textBox_tk.Text = open.FileName;
44
+        }
45
+
46
+        private void button_iplfiles_Click(object sender, EventArgs e)
47
+        {
48
+            FolderBrowserDialog open = new FolderBrowserDialog();
49
+            open.Description = "请选择文件夹";
50
+            if (open.ShowDialog() == DialogResult.OK)
51
+                textBox_iplfiles.Text = open.SelectedPath;
52
+        }
53
+
54
+        private void button_ok_Click(object sender, EventArgs e)
55
+        {
56
+            if (string.IsNullOrEmpty(textBox_files.Text))
57
+            {
58
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择待替换文件所在位置");
59
+                return;
60
+            }
61
+            if (string.IsNullOrEmpty(textBox_tk.Text))
62
+            {
63
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择截图表所在位置");
64
+                return;
65
+            }
66
+            if (string.IsNullOrEmpty(textBox_iplfiles.Text))
67
+            {
68
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择替换后文件保存位置");
69
+                return;
70
+            }
71
+            if (string.IsNullOrEmpty(textBox_tkn.Text))
72
+            {
73
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入结合表图框所在图层");
74
+                return;
75
+            }
76
+            if (string.IsNullOrEmpty(textBox_tfh.Text))
77
+            {
78
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入结合表图幅号所在图层");
79
+                return;
80
+            }
81
+            if (string.IsNullOrEmpty(comboBox_blc.Text))
82
+            {
83
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
84
+                return;
85
+            }
86
+            getThumbnail getthumbnail = new getThumbnail();
87
+            string blctext = comboBox_blc.Text;
88
+            int blcindex = blctext.LastIndexOf(':');
89
+            string strblc = blctext.Substring(blcindex + 1);
90
+            double blc = Convert.ToDouble(strblc);
91
+
92
+            getThumbnail.bl = blc / 500.0;
93
+            getThumbnail.tc_tfh = textBox_tfh.Text.Trim();
94
+            getThumbnail.tc_tk = textBox_tkn.Text.Trim();
95
+
96
+            #region 外图框与接图表距离
97
+            //if (blc == 500)
98
+            //{
99
+            //    getThumbnail.jtk = 1;
100
+            //}
101
+            //if (blc == 1000)
102
+            //{
103
+            //    getThumbnail.jtk = 1;
104
+            //}
105
+            //if (blc == 2000)
106
+            //{
107
+            //    getThumbnail.jtk = 2;
108
+            //}
109
+            //if (blc == 5000)
110
+            //{
111
+            //    getThumbnail.jtk = 4;
112
+            //}
113
+            //if (blc == 10000)
114
+            //{
115
+            //    getThumbnail.jtk = 8;
116
+            //}
117
+            //if (blc == 20000)
118
+            //{
119
+            //    getThumbnail.jtk = 16;
120
+            //}
121
+            #endregion
122
+            getthumbnail.openDwg(textBox_files.Text, textBox_tk.Text, textBox_iplfiles.Text);
123
+
124
+            Properties.Settings.Default.files = textBox_files.Text;
125
+            Properties.Settings.Default.jtb = textBox_tk.Text;
126
+            Properties.Settings.Default.svpath = textBox_iplfiles.Text;
127
+            Properties.Settings.Default.tk = textBox_tkn.Text;
128
+            Properties.Settings.Default.tfh = textBox_tfh.Text;
129
+            Properties.Settings.Default.Save();
130
+            this.Close();
131
+
132
+            //getThumbnail getthumbnail = new getThumbnail();
133
+            //getThumbnail.bl = 4;
134
+            //getThumbnail.tc_tfh = "0";
135
+            //getThumbnail.tc_tk = "TK";
136
+            //getthumbnail.openDwg("F://2022//2022-11//接图表替换//t//1", "F://2022//2022-11//接图表替换//t//新建文件夹//Drawing2.dwg",
137
+            //    "F://2022//2022-11//接图表替换//t");
138
+            //getthumbnail.openDwg("F://2022//2022-11//接图表替换//重新套图框/雅砻江牙根二级水电站可研阶段库区地形地类图(含水下)-2000",
139
+            //    "F://2022//2022-11//接图表替换//2000库区分幅结合表-CGCS2000-102.dwg",
140
+            //    "F://2022//2022-11//接图表替换//重新套图框");
141
+        }
142
+    }
143
+}

+ 120
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Form1.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 167
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/MainClass.cs 查看文件

@@ -0,0 +1,167 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.EditorInput;
3
+using GrxCAD.Internal;
4
+using GrxCAD.Runtime;
5
+using Microsoft.Win32;
6
+using System;
7
+using System.Collections.Generic;
8
+using System.IO;
9
+using System.Linq;
10
+using System.Management;
11
+using System.Security.Cryptography;
12
+using System.Text;
13
+using System.Threading.Tasks;
14
+using System.Windows.Forms;
15
+
16
+[assembly: ExtensionApplication(typeof(Thumbnail.MainClass))]
17
+namespace Thumbnail
18
+{
19
+    public class MainClass : IExtensionApplication
20
+    {
21
+        public void Initialize()
22
+        {
23
+        }
24
+
25
+        public void Terminate()
26
+        {
27
+        }
28
+
29
+
30
+        public static string Flag = "";      //标记不同命令
31
+        public int num = 1; //0超过期限,-1空
32
+        public int slf_flag = 0;
33
+
34
+        //加密
35
+        private static string Encrypt(string str, string key)
36
+        {
37
+            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
38
+            byte[] inputByteArray = Encoding.Default.GetBytes(str);
39
+            des.Key = ASCIIEncoding.ASCII.GetBytes(key);// 密钥
40
+            des.IV = ASCIIEncoding.ASCII.GetBytes(key);// 初始化向量
41
+            MemoryStream ms = new MemoryStream();
42
+            CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
43
+            cs.Write(inputByteArray, 0, inputByteArray.Length);
44
+            cs.FlushFinalBlock();
45
+            var retB = Convert.ToBase64String(ms.ToArray());
46
+            return retB;
47
+        }
48
+
49
+        //解密
50
+        private static string Decrypt(string pToDecrypt, string key)
51
+        {
52
+            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
53
+            byte[] inputByteArray = Convert.FromBase64String(pToDecrypt);
54
+            des.Key = ASCIIEncoding.ASCII.GetBytes(key);
55
+            des.IV = ASCIIEncoding.ASCII.GetBytes(key);
56
+            MemoryStream ms = new MemoryStream();
57
+            CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
58
+            cs.Write(inputByteArray, 0, inputByteArray.Length);
59
+            // 如果两次密钥不一样,这一步可能会引发异常
60
+            cs.FlushFinalBlock();
61
+            return System.Text.Encoding.Default.GetString(ms.ToArray());
62
+        }
63
+
64
+        //日期加密并放到注册表中
65
+        private void AddRecord()
66
+        {
67
+            string byte2string = null;
68
+            ManagementClass mc = new ManagementClass("Win32_Processor");
69
+            ManagementObjectCollection moc = mc.GetInstances();
70
+            string strCpuID = null;
71
+            foreach (ManagementObject mo in moc)
72
+            {
73
+                strCpuID = mo.Properties["ProcessorId"].Value.ToString();
74
+                break;
75
+            }
76
+            byte[] from = Encoding.Default.GetBytes(strCpuID);
77
+            MD5CryptoServiceProvider makemd5 = new MD5CryptoServiceProvider();
78
+            byte[] target = makemd5.ComputeHash(from);
79
+            for (int i = 0; i < target.Length; i++)
80
+            {
81
+                byte2string += target[i].ToString("x");
82
+            }
83
+
84
+            Document acDoc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
85
+            Editor ed = acDoc.Editor;
86
+            PromptStringOptions options = new PromptStringOptions("机器码:" + byte2string + "\n输入注册码:");
87
+            options.AllowSpaces = true;
88
+            options.UseDefaultValue = true;
89
+            options.DefaultValue = "";
90
+
91
+            string encrypted = Encrypt(byte2string, "vnf4s3ru");
92
+            string userInput = ed.GetString(options).StringResult;
93
+            if (userInput == "")
94
+            {
95
+                num = -1;
96
+                return;
97
+            }
98
+            string jm = Decrypt(userInput, "vnf4s3ru");
99
+            string zcm = jm.Split(',')[0];
100
+            string zcm_encrypted = Encrypt(zcm, "vnf4s3ru");
101
+            string work_days = jm.Split(',')[1];
102
+            if (zcm_encrypted == encrypted)
103
+            {
104
+                string dt = DateTime.Now.ToString().Trim();
105
+                dt = dt + ',' + work_days;
106
+                string dt_ecpt = Encrypt(dt, "vnf4s3ru");
107
+                Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software", true).CreateSubKey("CADplugins").CreateSubKey("Register.INI").CreateSubKey(dt_ecpt);
108
+                MessageBox.Show("注册成功!");
109
+            }
110
+            else
111
+            {
112
+                MessageBox.Show("注册失败!\n zcm_encrypted =" + zcm_encrypted.ToString() + "\nencrypted=" + encrypted.ToString() + "\nzcm=" + zcm.ToString() + "\njm=" + jm.ToString());
113
+                MessageBox.Show("注册失败!");
114
+                num = -1;
115
+            }
116
+        }
117
+
118
+        public void Verify()
119
+        {
120
+            Microsoft.Win32.RegistryKey retkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE", true).CreateSubKey("CADplugins").CreateSubKey("Register.INI");
121
+            //判断注册表中相应位置的subkey数量,如果为零的话则需要注册
122
+            if (retkey.SubKeyCount == 0)
123
+            {
124
+                AddRecord();
125
+            }
126
+            //如果不为零,判断日期是否在期限内
127
+            else
128
+            {
129
+                //转换为日期格式后检查当前日期之间和输入注册码的日期之间的间隔
130
+                string encrypted = retkey.GetSubKeyNames()[0];
131
+                string mw = Decrypt(encrypted, "vnf4s3ru");
132
+                string dt = mw.Split(',')[0];
133
+                int wkdays = Convert.ToInt32(mw.Split(',')[1]);
134
+                TimeSpan ts = DateTime.Now - DateTime.Parse(dt);
135
+                //如果超过期限,则删除所有subkey,显示注册码窗口
136
+                if (ts.Days > wkdays || ts.Days < 0)
137
+                {
138
+                    MessageBox.Show("超出有效期,请重新注册!");
139
+                    num = 0;
140
+                    foreach (string strRNum in retkey.GetSubKeyNames())
141
+                    {
142
+                        retkey.DeleteSubKey(strRNum);
143
+                    }
144
+                    AddRecord();
145
+                }
146
+                else
147
+                {
148
+                    num = 1;
149
+                }
150
+            }
151
+        }
152
+
153
+
154
+        [CommandMethod("JTB")]
155
+        public void thum()
156
+        {
157
+            Verify();
158
+
159
+            if (num == 1)
160
+            {
161
+                Form1 Frm = new Form1();
162
+                Frm.Show();
163
+            }
164
+        }
165
+
166
+    }
167
+}

+ 36
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Properties/AssemblyInfo.cs 查看文件

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的常规信息通过以下
6
+// 特性集控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("Thumbnail")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("Thumbnail")]
13
+[assembly: AssemblyCopyright("Copyright ©  2022")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+// 将 ComVisible 设置为 false 使此程序集中的类型
18
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19
+// 则将该类型上的 ComVisible 特性设置为 true。
20
+[assembly: ComVisible(false)]
21
+
22
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23
+[assembly: Guid("6461e815-2e03-4e8d-857f-e261a539e0d0")]
24
+
25
+// 程序集的版本信息由下面四个值组成:
26
+//
27
+//      主版本
28
+//      次版本 
29
+//      生成号
30
+//      修订号
31
+//
32
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33
+// 方法是按如下所示使用“*”:
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 86
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Properties/Settings.Designer.cs 查看文件

@@ -0,0 +1,86 @@
1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     此代码由工具生成。
4
+//     运行时版本:4.0.30319.42000
5
+//
6
+//     对此文件的更改可能会导致不正确的行为,并且如果
7
+//     重新生成代码,这些更改将会丢失。
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+namespace Thumbnail.Properties {
12
+    
13
+    
14
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
16
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17
+        
18
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19
+        
20
+        public static Settings Default {
21
+            get {
22
+                return defaultInstance;
23
+            }
24
+        }
25
+        
26
+        [global::System.Configuration.UserScopedSettingAttribute()]
27
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
29
+        public string files {
30
+            get {
31
+                return ((string)(this["files"]));
32
+            }
33
+            set {
34
+                this["files"] = value;
35
+            }
36
+        }
37
+        
38
+        [global::System.Configuration.UserScopedSettingAttribute()]
39
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
41
+        public string jtb {
42
+            get {
43
+                return ((string)(this["jtb"]));
44
+            }
45
+            set {
46
+                this["jtb"] = value;
47
+            }
48
+        }
49
+        
50
+        [global::System.Configuration.UserScopedSettingAttribute()]
51
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
53
+        public string svpath {
54
+            get {
55
+                return ((string)(this["svpath"]));
56
+            }
57
+            set {
58
+                this["svpath"] = value;
59
+            }
60
+        }
61
+        
62
+        [global::System.Configuration.UserScopedSettingAttribute()]
63
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
65
+        public string tk {
66
+            get {
67
+                return ((string)(this["tk"]));
68
+            }
69
+            set {
70
+                this["tk"] = value;
71
+            }
72
+        }
73
+        
74
+        [global::System.Configuration.UserScopedSettingAttribute()]
75
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
77
+        public string tfh {
78
+            get {
79
+                return ((string)(this["tfh"]));
80
+            }
81
+            set {
82
+                this["tfh"] = value;
83
+            }
84
+        }
85
+    }
86
+}

+ 21
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Properties/Settings.settings 查看文件

@@ -0,0 +1,21 @@
1
+<?xml version='1.0' encoding='utf-8'?>
2
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Thumbnail.Properties" GeneratedClassName="Settings">
3
+  <Profiles />
4
+  <Settings>
5
+    <Setting Name="files" Type="System.String" Scope="User">
6
+      <Value Profile="(Default)" />
7
+    </Setting>
8
+    <Setting Name="jtb" Type="System.String" Scope="User">
9
+      <Value Profile="(Default)" />
10
+    </Setting>
11
+    <Setting Name="svpath" Type="System.String" Scope="User">
12
+      <Value Profile="(Default)" />
13
+    </Setting>
14
+    <Setting Name="tk" Type="System.String" Scope="User">
15
+      <Value Profile="(Default)" />
16
+    </Setting>
17
+    <Setting Name="tfh" Type="System.String" Scope="User">
18
+      <Value Profile="(Default)" />
19
+    </Setting>
20
+  </Settings>
21
+</SettingsFile>

+ 93
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Thumbnail.csproj 查看文件

@@ -0,0 +1,93 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{325D619D-651B-42EA-BA93-01121126A2AF}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>Thumbnail</RootNamespace>
11
+    <AssemblyName>Thumbnail</AssemblyName>
12
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+    <TargetFrameworkProfile />
15
+  </PropertyGroup>
16
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
+    <DebugSymbols>true</DebugSymbols>
18
+    <DebugType>full</DebugType>
19
+    <Optimize>false</Optimize>
20
+    <OutputPath>bin\Debug\</OutputPath>
21
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
+    <ErrorReport>prompt</ErrorReport>
23
+    <WarningLevel>4</WarningLevel>
24
+  </PropertyGroup>
25
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
+    <DebugType>pdbonly</DebugType>
27
+    <Optimize>true</Optimize>
28
+    <OutputPath>bin\Release\</OutputPath>
29
+    <DefineConstants>TRACE</DefineConstants>
30
+    <ErrorReport>prompt</ErrorReport>
31
+    <WarningLevel>4</WarningLevel>
32
+  </PropertyGroup>
33
+  <ItemGroup>
34
+    <Reference Include="gmap">
35
+      <HintPath>..\..\..\..\..\2024\04\浩辰\GstarCAD2021_Development_Tool\浩辰CAD2021_grxsdk\inc\gmap.dll</HintPath>
36
+      <Private>False</Private>
37
+    </Reference>
38
+    <Reference Include="gmdb">
39
+      <HintPath>..\..\..\..\..\2024\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc\gmdb.dll</HintPath>
40
+      <Private>False</Private>
41
+    </Reference>
42
+    <Reference Include="GrxCAD.Interop">
43
+      <HintPath>..\..\..\..\..\2024\04\浩辰\GstarCAD2021_Development_Tool\浩辰CAD2021_grxsdk\inc-x64\GrxCAD.Interop.dll</HintPath>
44
+      <EmbedInteropTypes>True</EmbedInteropTypes>
45
+    </Reference>
46
+    <Reference Include="System" />
47
+    <Reference Include="System.Core" />
48
+    <Reference Include="System.Drawing" />
49
+    <Reference Include="System.Management" />
50
+    <Reference Include="System.Windows.Forms" />
51
+    <Reference Include="System.Xml.Linq" />
52
+    <Reference Include="System.Data.DataSetExtensions" />
53
+    <Reference Include="Microsoft.CSharp" />
54
+    <Reference Include="System.Data" />
55
+    <Reference Include="System.Xml" />
56
+  </ItemGroup>
57
+  <ItemGroup>
58
+    <Compile Include="Form1.cs">
59
+      <SubType>Form</SubType>
60
+    </Compile>
61
+    <Compile Include="Form1.Designer.cs">
62
+      <DependentUpon>Form1.cs</DependentUpon>
63
+    </Compile>
64
+    <Compile Include="getThumbnail.cs" />
65
+    <Compile Include="MainClass.cs" />
66
+    <Compile Include="Properties\AssemblyInfo.cs" />
67
+    <Compile Include="Properties\Settings.Designer.cs">
68
+      <AutoGen>True</AutoGen>
69
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
70
+      <DependentUpon>Settings.settings</DependentUpon>
71
+    </Compile>
72
+  </ItemGroup>
73
+  <ItemGroup>
74
+    <EmbeddedResource Include="Form1.resx">
75
+      <DependentUpon>Form1.cs</DependentUpon>
76
+    </EmbeddedResource>
77
+  </ItemGroup>
78
+  <ItemGroup>
79
+    <None Include="app.config" />
80
+    <None Include="Properties\Settings.settings">
81
+      <Generator>SettingsSingleFileGenerator</Generator>
82
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
83
+    </None>
84
+  </ItemGroup>
85
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
86
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
87
+       Other similar extension points exist, see Microsoft.Common.targets.
88
+  <Target Name="BeforeBuild">
89
+  </Target>
90
+  <Target Name="AfterBuild">
91
+  </Target>
92
+  -->
93
+</Project>

+ 8
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Thumbnail.csproj.user 查看文件

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
4
+    <StartAction>Program</StartAction>
5
+    <StartProgram>E:\浩辰CAD 2020\gcad.exe</StartProgram>
6
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
7
+  </PropertyGroup>
8
+</Project>

+ 27
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/app.config 查看文件

@@ -0,0 +1,27 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <configSections>
4
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5
+            <section name="Thumbnail.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6
+        </sectionGroup>
7
+    </configSections>
8
+    <userSettings>
9
+        <Thumbnail.Properties.Settings>
10
+            <setting name="files" serializeAs="String">
11
+                <value />
12
+            </setting>
13
+            <setting name="jtb" serializeAs="String">
14
+                <value />
15
+            </setting>
16
+            <setting name="svpath" serializeAs="String">
17
+                <value />
18
+            </setting>
19
+            <setting name="tk" serializeAs="String">
20
+                <value />
21
+            </setting>
22
+            <setting name="tfh" serializeAs="String">
23
+                <value />
24
+            </setting>
25
+        </Thumbnail.Properties.Settings>
26
+    </userSettings>
27
+</configuration>

+ 3
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Drawing1.dwl 查看文件

@@ -0,0 +1,3 @@
1
+1
2
+DESKTOP-LEPG50N 
3
+2025年4月16日  14:56:20

+ 7
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Drawing1.dwl2 查看文件

@@ -0,0 +1,7 @@
1
+<?xml version="1.0" encoding="UTF-8">
2
+<whprops>
3
+<username>1</username>
4
+<machinename>DESKTOP-LEPG50N </machinename>
5
+<fullname></fullname>
6
+<datetime>2025年4月16日  14:56:20</datetime>
7
+</whprops>

二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail.dll 查看文件


+ 27
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail.dll.config 查看文件

@@ -0,0 +1,27 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <configSections>
4
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5
+            <section name="Thumbnail.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6
+        </sectionGroup>
7
+    </configSections>
8
+    <userSettings>
9
+        <Thumbnail.Properties.Settings>
10
+            <setting name="files" serializeAs="String">
11
+                <value />
12
+            </setting>
13
+            <setting name="jtb" serializeAs="String">
14
+                <value />
15
+            </setting>
16
+            <setting name="svpath" serializeAs="String">
17
+                <value />
18
+            </setting>
19
+            <setting name="tk" serializeAs="String">
20
+                <value />
21
+            </setting>
22
+            <setting name="tfh" serializeAs="String">
23
+                <value />
24
+            </setting>
25
+        </Thumbnail.Properties.Settings>
26
+    </userSettings>
27
+</configuration>

二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail.pdb 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail_selewindow.dll 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/Thumbnail显示坐标.dll 查看文件


+ 114
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/bin/Debug/acad.err 查看文件

@@ -0,0 +1,114 @@
1
+
2
+
3
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x0000 Exception at a836507eh
4
+
5
+11/30/2022 at 14:18:02.977  ͼÐÎ: Drawing2.dwg
6
+-------------
7
+
8
+
9
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x0000 Exception at a8365e88h
10
+
11
+11/30/2022 at 14:27:28.945  ͼÐÎ: Drawing2.dwg
12
+-------------
13
+
14
+
15
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x0000 Exception at 9e8bd5a3h
16
+
17
+11/30/2022 at 15:32:57.998  ͼÐÎ: Drawing2.dwg
18
+-------------
19
+
20
+
21
+ÄÚ²¿´íÎó:  !dbobji.cpp@8615: eNotOpenForWrite
22
+
23
+12/01/2022 at 14:31:23.597  ͼÐÎ: Drawing2.dwg
24
+-------------
25
+
26
+
27
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0xc695f000 Exception at 9e887fddh
28
+
29
+12/02/2022 at 10:51:22.889  ͼÐÎ: Drawing2.dwg
30
+-------------
31
+
32
+
33
+ÄÚ²¿´íÎó:  !dbobji.cpp@8615: eNotOpenForWrite
34
+
35
+12/02/2022 at 14:24:10.162  ͼÐÎ: Drawing2.dwg
36
+-------------
37
+
38
+
39
+ÄÚ²¿´íÎó:  !dbobji.cpp@8615: eNotOpenForWrite
40
+
41
+12/02/2022 at 17:25:37.651  ͼÐÎ: Drawing2.dwg
42
+-------------
43
+
44
+
45
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x77d88828 Exception at 7d5b37b5h
46
+
47
+12/05/2022 at 15:26:47.083  ͼÐÎ: Drawing3.dwg
48
+-------------
49
+
50
+
51
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x87688828 Exception at 7d5b37b5h
52
+
53
+12/05/2022 at 15:33:29.418  ͼÐÎ: Drawing3.dwg
54
+-------------
55
+
56
+
57
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x3d388828 Exception at 7d5b37b5h
58
+
59
+12/05/2022 at 15:37:10.236  ͼÐÎ: Drawing3.dwg
60
+-------------
61
+
62
+
63
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x2ac88828 Exception at 7d5b37b5h
64
+
65
+12/05/2022 at 15:42:25.982  ͼÐÎ: Drawing3.dwg
66
+-------------
67
+
68
+
69
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0x4bf88828 Exception at 7d5b37b5h
70
+
71
+12/05/2022 at 15:57:20.359  ͼÐÎ: Drawing3.dwg
72
+-------------
73
+
74
+
75
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0xc9a88828 Exception at 7d5b37b5h
76
+
77
+12/05/2022 at 16:00:09.198  ͼÐÎ: Drawing3.dwg
78
+-------------
79
+
80
+
81
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0xf49d6828 Exception at 7d5b37b5h
82
+
83
+12/05/2022 at 16:04:38.335  ͼÐÎ: Drawing3.dwg
84
+-------------
85
+
86
+
87
+ÖÂÃü´íÎó:  Unhandled Access Violation Reading 0xe5a88828 Exception at 7d5b37b5h
88
+
89
+12/05/2022 at 16:12:30.329  ͼÐÎ: Drawing3.dwg
90
+-------------
91
+
92
+
93
+ÄÚ²¿´íÎó:  !dbinsert.cpp@860: eNoDatabase
94
+
95
+12/06/2022 at 13:40:35.497  ͼÐÎ: Drawing2.dwg
96
+-------------
97
+
98
+
99
+ÄÚ²¿´íÎó:  !dbinsert.cpp@860: eNoDatabase
100
+
101
+12/06/2022 at 13:43:00.459  ͼÐÎ: Drawing2.dwg
102
+-------------
103
+
104
+
105
+ÄÚ²¿´íÎó:  !dbinsert.cpp@860: eNoDatabase
106
+
107
+12/06/2022 at 13:48:47.485  ͼÐÎ: Drawing2.dwg
108
+-------------
109
+
110
+
111
+ÄÚ²¿´íÎó:  !dbinsert.cpp@860: eNoDatabase
112
+
113
+12/06/2022 at 13:52:02.195  ͼÐÎ: Drawing2.dwg
114
+-------------

+ 2433
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/getThumbnail.cs
文件差异内容过多而无法显示
查看文件


+ 4
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttributes.cs 查看文件

@@ -0,0 +1,4 @@
1
+// <autogenerated />
2
+using System;
3
+using System.Reflection;
4
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]

+ 4
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs 查看文件

@@ -0,0 +1,4 @@
1
+// <autogenerated />
2
+using System;
3
+using System.Reflection;
4
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/DesignTimeResolveAssemblyReferences.cache 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache 查看文件


+ 0
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs 查看文件


+ 0
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 查看文件


+ 0
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.Form1.resources 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.AssemblyReference.cache 查看文件


+ 1
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.CoreCompileInputs.cache 查看文件

@@ -0,0 +1 @@
1
+62f47f122ed5bba33de470ff262dff7385a93a56

+ 36
- 0
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.FileListAbsolute.txt 查看文件

@@ -0,0 +1,36 @@
1
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\bin\Debug\Thumbnail.dll
2
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\bin\Debug\Thumbnail.pdb
3
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.dll
4
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.pdb
5
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.Form1.resources
6
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.GenerateResource.Cache
7
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.Reg.resources
8
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.AssemblyReference.cache
9
+F:\2022-11\牙根2000\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.CoreCompileInputs.cache
10
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\bin\Debug\Thumbnail.dll
11
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\bin\Debug\Thumbnail.pdb
12
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.AssemblyReference.cache
13
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.Form1.resources
14
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.Reg.resources
15
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.GenerateResource.cache
16
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.CoreCompileInputs.cache
17
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.dll
18
+F:\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.pdb
19
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\bin\Debug\Thumbnail.dll
20
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\bin\Debug\Thumbnail.pdb
21
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.Form1.resources
22
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.Reg.resources
23
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.GenerateResource.cache
24
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.CoreCompileInputs.cache
25
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.dll
26
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.pdb
27
+F:\2022\2022-11\接图表替换\Thumbnail\Thumbnail\obj\Debug\Thumbnail.csproj.AssemblyReference.cache
28
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\obj\Debug\Thumbnail.Form1.resources
29
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\obj\Debug\Thumbnail.csproj.GenerateResource.cache
30
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\obj\Debug\Thumbnail.csproj.CoreCompileInputs.cache
31
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\obj\Debug\Thumbnail.dll
32
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\obj\Debug\Thumbnail.pdb
33
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\bin\Debug\Thumbnail.dll
34
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\bin\Debug\Thumbnail.pdb
35
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\bin\Debug\Thumbnail.dll.config
36
+F:\2022\2022-11\接图表替换\Thumbnail_HC\Thumbnail\obj\Debug\Thumbnail.csproj.AssemblyReference.cache

二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.GenerateResource.cache 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.dll 查看文件


二进制
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.pdb 查看文件


二进制
加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/.suo 查看文件


二进制
加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/000.testlog 查看文件


二进制
加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/testlog.manifest 查看文件


+ 25
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools.sln 查看文件

@@ -0,0 +1,25 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio Version 16
4
+VisualStudioVersion = 16.0.33130.400
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HCTools", "HCTools\HCTools.csproj", "{ABB97F2C-1CCA-4782-B144-A796879EBE66}"
7
+EndProject
8
+Global
9
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
+		Debug|Any CPU = Debug|Any CPU
11
+		Release|Any CPU = Release|Any CPU
12
+	EndGlobalSection
13
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
14
+		{ABB97F2C-1CCA-4782-B144-A796879EBE66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15
+		{ABB97F2C-1CCA-4782-B144-A796879EBE66}.Debug|Any CPU.Build.0 = Debug|Any CPU
16
+		{ABB97F2C-1CCA-4782-B144-A796879EBE66}.Release|Any CPU.ActiveCfg = Release|Any CPU
17
+		{ABB97F2C-1CCA-4782-B144-A796879EBE66}.Release|Any CPU.Build.0 = Release|Any CPU
18
+	EndGlobalSection
19
+	GlobalSection(SolutionProperties) = preSolution
20
+		HideSolutionNode = FALSE
21
+	EndGlobalSection
22
+	GlobalSection(ExtensibilityGlobals) = postSolution
23
+		SolutionGuid = {26C276F7-933E-4026-8DCF-62A02D00430D}
24
+	EndGlobalSection
25
+EndGlobal

+ 53
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/App.config 查看文件

@@ -0,0 +1,53 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+    <configSections>
4
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5
+            <section name="HCTools.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6
+        </sectionGroup>
7
+    </configSections>
8
+    <startup> 
9
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
10
+    </startup>
11
+  <runtime>
12
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
13
+      <dependentAssembly>
14
+        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
15
+        <bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
16
+      </dependentAssembly>
17
+    </assemblyBinding>
18
+  </runtime>
19
+  <userSettings>
20
+    <HCTools.Properties.Settings>
21
+      <setting name="TFName" serializeAs="String">
22
+        <value />
23
+      </setting>
24
+      <setting name="Note2" serializeAs="String">
25
+        <value>2000国家大地坐标系,1985国家高程基准,等高距为1m。
26
+GB/T20257.1-2007 国家基本比例尺地图图式 第一部分
27
+1:500 1:1000 1:2000 地形图图式
28
+xxxx年xx月测制</value>
29
+      </setting>
30
+      <setting name="CTY" serializeAs="String">
31
+        <value>测图员 </value>
32
+      </setting>
33
+      <setting name="JCY" serializeAs="String">
34
+        <value>检查员 </value>
35
+      </setting>
36
+      <setting name="TDY" serializeAs="String">
37
+        <value>土调员 </value>
38
+      </setting>
39
+      <setting name="SDY" serializeAs="String">
40
+        <value>数调员 </value>
41
+      </setting>
42
+      <setting name="DH" serializeAs="String">
43
+        <value>0</value>
44
+      </setting>
45
+      <setting name="svpath" serializeAs="String">
46
+        <value />
47
+      </setting>
48
+      <setting name="secret" serializeAs="String">
49
+        <value />
50
+      </setting>
51
+    </HCTools.Properties.Settings>
52
+  </userSettings>
53
+</configuration>

+ 158
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.Designer.cs 查看文件

@@ -0,0 +1,158 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class AttributeForm
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.components = new System.ComponentModel.Container();
33
+            this.dataGridView_Info = new System.Windows.Forms.DataGridView();
34
+            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
35
+            this.缩放至ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36
+            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
37
+            this.button_cancelshow = new System.Windows.Forms.Button();
38
+            this.button_show = new System.Windows.Forms.Button();
39
+            this.button1 = new System.Windows.Forms.Button();
40
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Info)).BeginInit();
41
+            this.contextMenuStrip1.SuspendLayout();
42
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
43
+            this.splitContainer1.Panel1.SuspendLayout();
44
+            this.splitContainer1.Panel2.SuspendLayout();
45
+            this.splitContainer1.SuspendLayout();
46
+            this.SuspendLayout();
47
+            // 
48
+            // dataGridView_Info
49
+            // 
50
+            this.dataGridView_Info.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
51
+            this.dataGridView_Info.ContextMenuStrip = this.contextMenuStrip1;
52
+            this.dataGridView_Info.Dock = System.Windows.Forms.DockStyle.Fill;
53
+            this.dataGridView_Info.Location = new System.Drawing.Point(0, 0);
54
+            this.dataGridView_Info.Name = "dataGridView_Info";
55
+            this.dataGridView_Info.RowHeadersWidth = 51;
56
+            this.dataGridView_Info.RowTemplate.Height = 27;
57
+            this.dataGridView_Info.Size = new System.Drawing.Size(1010, 451);
58
+            this.dataGridView_Info.TabIndex = 0;
59
+            this.dataGridView_Info.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_Info_CellClick);
60
+            this.dataGridView_Info.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_Info_RowHeaderMouseClick);
61
+            this.dataGridView_Info.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.dataGridView_Info_SortCompare);
62
+            // 
63
+            // contextMenuStrip1
64
+            // 
65
+            this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
66
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
67
+            this.缩放至ToolStripMenuItem});
68
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
69
+            this.contextMenuStrip1.Size = new System.Drawing.Size(124, 28);
70
+            // 
71
+            // 缩放至ToolStripMenuItem
72
+            // 
73
+            this.缩放至ToolStripMenuItem.Name = "缩放至ToolStripMenuItem";
74
+            this.缩放至ToolStripMenuItem.Size = new System.Drawing.Size(123, 24);
75
+            this.缩放至ToolStripMenuItem.Text = "缩放至";
76
+            this.缩放至ToolStripMenuItem.Click += new System.EventHandler(this.缩放至ToolStripMenuItem_Click);
77
+            // 
78
+            // splitContainer1
79
+            // 
80
+            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
81
+            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
82
+            this.splitContainer1.Name = "splitContainer1";
83
+            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
84
+            // 
85
+            // splitContainer1.Panel1
86
+            // 
87
+            this.splitContainer1.Panel1.Controls.Add(this.dataGridView_Info);
88
+            // 
89
+            // splitContainer1.Panel2
90
+            // 
91
+            this.splitContainer1.Panel2.Controls.Add(this.button_cancelshow);
92
+            this.splitContainer1.Panel2.Controls.Add(this.button_show);
93
+            this.splitContainer1.Panel2.Controls.Add(this.button1);
94
+            this.splitContainer1.Size = new System.Drawing.Size(1010, 499);
95
+            this.splitContainer1.SplitterDistance = 451;
96
+            this.splitContainer1.TabIndex = 1;
97
+            // 
98
+            // button_cancelshow
99
+            // 
100
+            this.button_cancelshow.Location = new System.Drawing.Point(788, 5);
101
+            this.button_cancelshow.Name = "button_cancelshow";
102
+            this.button_cancelshow.Size = new System.Drawing.Size(107, 33);
103
+            this.button_cancelshow.TabIndex = 2;
104
+            this.button_cancelshow.Text = "取消显示选中";
105
+            this.button_cancelshow.UseVisualStyleBackColor = true;
106
+            this.button_cancelshow.Click += new System.EventHandler(this.button_cancelshow_Click);
107
+            // 
108
+            // button_show
109
+            // 
110
+            this.button_show.Location = new System.Drawing.Point(685, 5);
111
+            this.button_show.Name = "button_show";
112
+            this.button_show.Size = new System.Drawing.Size(80, 33);
113
+            this.button_show.TabIndex = 1;
114
+            this.button_show.Text = "显示选中";
115
+            this.button_show.UseVisualStyleBackColor = true;
116
+            this.button_show.Click += new System.EventHandler(this.button_show_Click);
117
+            // 
118
+            // button1
119
+            // 
120
+            this.button1.Location = new System.Drawing.Point(924, 5);
121
+            this.button1.Name = "button1";
122
+            this.button1.Size = new System.Drawing.Size(75, 33);
123
+            this.button1.TabIndex = 0;
124
+            this.button1.Text = "导 出";
125
+            this.button1.UseVisualStyleBackColor = true;
126
+            this.button1.Click += new System.EventHandler(this.button1_Click);
127
+            // 
128
+            // AttributeForm
129
+            // 
130
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
131
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
132
+            this.ClientSize = new System.Drawing.Size(1010, 499);
133
+            this.Controls.Add(this.splitContainer1);
134
+            this.Name = "AttributeForm";
135
+            this.Text = "属性表";
136
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AttributeForm_FormClosed);
137
+            this.Load += new System.EventHandler(this.AttributeForm_Load);
138
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Info)).EndInit();
139
+            this.contextMenuStrip1.ResumeLayout(false);
140
+            this.splitContainer1.Panel1.ResumeLayout(false);
141
+            this.splitContainer1.Panel2.ResumeLayout(false);
142
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
143
+            this.splitContainer1.ResumeLayout(false);
144
+            this.ResumeLayout(false);
145
+
146
+        }
147
+
148
+        #endregion
149
+
150
+        private System.Windows.Forms.DataGridView dataGridView_Info;
151
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
152
+        private System.Windows.Forms.ToolStripMenuItem 缩放至ToolStripMenuItem;
153
+        private System.Windows.Forms.SplitContainer splitContainer1;
154
+        private System.Windows.Forms.Button button1;
155
+        private System.Windows.Forms.Button button_cancelshow;
156
+        private System.Windows.Forms.Button button_show;
157
+    }
158
+}

+ 277
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.cs 查看文件

@@ -0,0 +1,277 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.ComponentModel;
8
+using System.Data;
9
+using System.Drawing;
10
+using System.IO;
11
+using System.Linq;
12
+using System.Text;
13
+using System.Threading.Tasks;
14
+using System.Windows.Forms;
15
+
16
+namespace HCTools
17
+{
18
+    public partial class AttributeForm : Form
19
+    {
20
+        private List<List<string>> info_all = new List<List<string>>();//obj信息
21
+        private List<ObjectId> objid_all = new List<ObjectId>();
22
+        public AttributeForm()
23
+        {
24
+            InitializeComponent();
25
+        }
26
+
27
+        public void GetInfo(List<List<string>> info_all, List<ObjectId> objid_all)
28
+        {
29
+            this.info_all = info_all;
30
+            this.objid_all = objid_all;
31
+        }
32
+
33
+        private void AttributeForm_Load(object sender, EventArgs e)
34
+        {
35
+            this.dataGridView_Info.ColumnCount = 9;
36
+
37
+            this.dataGridView_Info.Columns[0].HeaderText = "ID";
38
+            this.dataGridView_Info.Columns[1].HeaderText = "名称";
39
+            this.dataGridView_Info.Columns[2].HeaderText = "图层";
40
+            this.dataGridView_Info.Columns[3].HeaderText = "类型";
41
+            this.dataGridView_Info.Columns[4].HeaderText = "X";
42
+            this.dataGridView_Info.Columns[5].HeaderText = "Y";
43
+            this.dataGridView_Info.Columns[6].HeaderText = "Z";
44
+            this.dataGridView_Info.Columns[7].HeaderText = "长度(m)";
45
+            this.dataGridView_Info.Columns[8].HeaderText = "面积(m²)";
46
+
47
+            this.dataGridView_Info.AllowUserToAddRows = false;
48
+            this.dataGridView_Info.AllowUserToResizeRows = false;
49
+            this.dataGridView_Info.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
50
+            this.dataGridView_Info.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
51
+            //this.dataGridView_Info.RowHeadersVisible = false;
52
+            this.dataGridView_Info.ReadOnly = true;
53
+
54
+            for (int i = 0; i < info_all.Count; i++)
55
+            {
56
+                dataGridView_Info.Rows.Add();
57
+            }
58
+            for (int i = 0; i < this.dataGridView_Info.Rows.Count; i++)
59
+            {
60
+                this.dataGridView_Info[0, i].Value = info_all[i][0];
61
+                this.dataGridView_Info[1, i].Value = info_all[i][1];
62
+                this.dataGridView_Info[2, i].Value = info_all[i][2];
63
+                this.dataGridView_Info[3, i].Value = info_all[i][3];
64
+                this.dataGridView_Info[4, i].Value = info_all[i][4];
65
+                this.dataGridView_Info[5, i].Value = info_all[i][5];
66
+                this.dataGridView_Info[6, i].Value = info_all[i][6];
67
+                this.dataGridView_Info[7, i].Value = info_all[i][7];
68
+                this.dataGridView_Info[8, i].Value = info_all[i][8];
69
+            }
70
+        }
71
+
72
+        private void dataGridView_Info_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
73
+        {
74
+            int column = e.Column.Index;
75
+            int row1 = e.RowIndex1;
76
+            int row2 = e.RowIndex2;
77
+            if (column == 0|| column == 4 || column == 5 || column == 6)
78
+            {
79
+                double value1 = Convert.ToDouble(e.CellValue1.ToString().Replace("_", ""));
80
+                double value2 = Convert.ToDouble(e.CellValue2.ToString().Replace("_", ""));
81
+                if (value1 > value2)
82
+                    e.SortResult = 1;
83
+                else if (value2 == value1)
84
+                    e.SortResult = 0;
85
+                else e.SortResult = -1;
86
+                e.Handled = true;
87
+            }
88
+        }
89
+
90
+        private void 缩放至ToolStripMenuItem_Click(object sender, EventArgs e)
91
+        {
92
+            DataGridViewRow row = this.dataGridView_Info.CurrentRow;
93
+            ObjectId id = objid_all[Convert.ToInt32(row.Cells[0].Value) - 1];
94
+            Entity current_entity = BasicFunction.GetDBObject(id);
95
+            current_entity.Highlight();//高亮显示实体 
96
+
97
+            //缩放至实体
98
+            ZoomToExtent(current_entity.GeometricExtents);
99
+        }
100
+
101
+        /// <summary>
102
+        /// 缩放至指定范围
103
+        /// </summary>
104
+        /// <param name="extent"></param>
105
+        public static void ZoomToExtent(Extents3d extent)
106
+        {
107
+            try
108
+            {
109
+                Point3d pMin = extent.MinPoint;
110
+                Point3d pMax = extent.MaxPoint;
111
+                //获取当前文档及数据库
112
+                Document acDoc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
113
+                Database acCurDb = acDoc.Database;
114
+
115
+                // 启动事务
116
+                using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
117
+                {
118
+                    using (ViewTableRecord acView = acDoc.Editor.GetCurrentView())
119
+                    {
120
+                        //设置视图的高
121
+                        acView.Height = Math.Abs(pMin.Y - pMax.Y);
122
+                        //设置视图的宽
123
+                        acView.Width = Math.Abs(pMin.X - pMax.X);
124
+                        // 设置视图中心
125
+                        acView.CenterPoint = new Point2d((pMin.X + pMax.X) / 2, (pMin.Y + pMax.Y) / 2);
126
+                        // 更新当前视图
127
+                        acDoc.Editor.SetCurrentView(acView);
128
+                    }
129
+                    // 提交更改
130
+                    acTrans.Commit();
131
+                }
132
+            }
133
+            catch (Exception)
134
+            {
135
+
136
+                throw;
137
+            }
138
+        }
139
+
140
+        private void button1_Click(object sender, EventArgs e)
141
+        {
142
+            SaveFileDialog saveFileDialog = new SaveFileDialog();
143
+            saveFileDialog.Filter = "Text Files|*.txt";
144
+            saveFileDialog.Title = "保存txt文件";
145
+            saveFileDialog.FileName = "导出数据.txt";
146
+
147
+            if (saveFileDialog.ShowDialog() == DialogResult.OK)
148
+            {
149
+                // 使用 StreamWriter 写入文件
150
+                using (StreamWriter writer = new StreamWriter(saveFileDialog.FileName, false, Encoding.UTF8))
151
+                {
152
+                    // 写入列标题
153
+                    for (int i = 0; i < dataGridView_Info.Columns.Count; i++)
154
+                    {
155
+                        writer.Write(dataGridView_Info.Columns[i].HeaderText);
156
+                        if (i < dataGridView_Info.Columns.Count - 1)
157
+                        {
158
+                            writer.Write("\t");
159
+                        }
160
+                    }
161
+                    writer.WriteLine();
162
+
163
+                    // 写入数据
164
+                    //判断是否有被选中数据,有的话导出选中的
165
+                    int flag = 0;
166
+                    foreach (DataGridViewRow row in dataGridView_Info.Rows)
167
+                    {
168
+                        if (row.Selected == true)
169
+                            flag = 1;
170
+                    }
171
+                    if (flag == 0)
172
+                    {
173
+                        for (int i = 0; i < dataGridView_Info.Rows.Count; i++)
174
+                        {
175
+                            for (int j = 0; j < dataGridView_Info.Columns.Count; j++)
176
+                            {
177
+                                writer.Write(dataGridView_Info.Rows[i].Cells[j].Value.ToString());
178
+                                if (j < dataGridView_Info.Columns.Count - 1)
179
+                                {
180
+                                    writer.Write("\t");
181
+                                }
182
+                            }
183
+                            writer.WriteLine();
184
+                        }
185
+                    }
186
+                    else if (flag == 1)
187
+                    {
188
+                        for (int i = 0; i < dataGridView_Info.Rows.Count; i++)
189
+                        {
190
+                            if (dataGridView_Info.Rows[i].Selected == true)
191
+                            {
192
+                                for (int j = 0; j < dataGridView_Info.Columns.Count; j++)
193
+                                {
194
+                                    writer.Write(dataGridView_Info.Rows[i].Cells[j].Value.ToString());
195
+                                    if (j < dataGridView_Info.Columns.Count - 1)
196
+                                    {
197
+                                        writer.Write("\t");
198
+                                    }
199
+                                }
200
+                                writer.WriteLine();
201
+                            }
202
+                        }
203
+                    }
204
+                }
205
+
206
+                MessageBox.Show("数据导出成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
207
+            }
208
+        }
209
+
210
+        private void button_show_Click(object sender, EventArgs e)
211
+        {
212
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
213
+            Editor ed = doc.Editor;
214
+            PromptSelectionResult selectionResult = ed.SelectImplied();
215
+            if (selectionResult.Status == PromptStatus.OK)
216
+            {
217
+                SelectionSet selectionSet = selectionResult.Value;
218
+                using (Transaction trans = doc.TransactionManager.StartTransaction())
219
+                {
220
+                    foreach (SelectedObject selectedObject in selectionSet)
221
+                    {
222
+                        ObjectId objectId = selectedObject.ObjectId;
223
+                        for (int i = 0; i < objid_all.Count; i++)
224
+                        {
225
+                            if (objectId == objid_all[i])
226
+                                this.dataGridView_Info.Rows[i].Selected = true;
227
+                        }
228
+                    }
229
+                    trans.Commit();
230
+                }
231
+                foreach (DataGridViewRow row in dataGridView_Info.Rows)
232
+                {   
233
+                    row.Visible = row.Selected;
234
+                }
235
+            }
236
+        }
237
+
238
+        private void button_cancelshow_Click(object sender, EventArgs e)
239
+        {
240
+            foreach (DataGridViewRow row in dataGridView_Info.Rows)
241
+            {
242
+                row.Visible = true;
243
+            }
244
+        }
245
+
246
+        private void AttributeForm_FormClosed(object sender, FormClosedEventArgs e)
247
+        {
248
+            info_all.Clear();
249
+            objid_all.Clear();
250
+        }
251
+
252
+        private void dataGridView_Info_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
253
+        {
254
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
255
+            Editor ed = doc.Editor;
256
+            List<ObjectId> ids = new List<ObjectId>(); 
257
+            for(int i =0; i<this.dataGridView_Info.Rows.Count;i++)
258
+            {
259
+                if (this.dataGridView_Info.Rows[i].Selected == true)
260
+                {
261
+                    ids.Add(objid_all[i]);
262
+                }
263
+            }
264
+            ObjectId[] objid = ids.ToArray();
265
+            ed.SetImpliedSelection(objid);
266
+        }
267
+
268
+        private void dataGridView_Info_CellClick(object sender, DataGridViewCellEventArgs e)
269
+        {
270
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
271
+            Editor ed = doc.Editor;
272
+            List<ObjectId> ids = new List<ObjectId>();
273
+            ObjectId[] objid = ids.ToArray();
274
+            ed.SetImpliedSelection(objid);
275
+        }
276
+    }
277
+}

+ 123
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.resx 查看文件

@@ -0,0 +1,123 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+</root>

+ 263
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Attributeget.cs 查看文件

@@ -0,0 +1,263 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using System;
5
+using System.Collections.Generic;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace HCTools
11
+{
12
+    class Attributeget
13
+    {
14
+        private static List<ObjectId> objid_all = new List<ObjectId>();
15
+        public void attribt()
16
+        {
17
+            //存放所有图层名
18
+            List<string> alllayername = new List<string>();
19
+            List<List<string>> info_all = new List<List<string>>();
20
+
21
+            Database db = HostApplicationServices.WorkingDatabase;
22
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
23
+
24
+            using (Transaction trans = db.TransactionManager.StartTransaction())
25
+            {
26
+                LayerTable layertable = trans.GetObject(db.LayerTableId, OpenMode.ForRead) as LayerTable;
27
+                foreach (ObjectId objid in layertable)
28
+                {
29
+                    LayerTableRecord layertablerecord = trans.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
30
+                    alllayername.Add(layertablerecord.Name);
31
+                }
32
+                alllayername.Sort();
33
+                trans.Commit();
34
+            }
35
+
36
+            int num = 0;
37
+            for (int i = 0; i < alllayername.Count; i++)
38
+            {
39
+                List<List<string>> info = Getlyobjinfo(alllayername[i], num);
40
+                num = num + info.Count;
41
+                for (int j = 0; j < info.Count; j++)
42
+                {
43
+                    string id = info[j][0];
44
+                    string name = info[j][1];
45
+                    string type = info[j][2];
46
+                    string X = info[j][3];
47
+                    string Y = info[j][4];
48
+                    string Z = info[j][5];
49
+                    string lenth = info[j][6];
50
+                    string area = info[j][7];
51
+                    List<string> temp = new List<string>();
52
+                    temp.Add(id);
53
+                    temp.Add(name);
54
+                    temp.Add(alllayername[i]);
55
+                    temp.Add(type);
56
+                    temp.Add(X);
57
+                    temp.Add(Y);
58
+                    temp.Add(Z);
59
+                    temp.Add(lenth);
60
+                    temp.Add(area);
61
+                    info_all.Add(temp);
62
+                }
63
+            }
64
+
65
+            AttributeForm Frm = new AttributeForm();
66
+            Frm.GetInfo(info_all,objid_all);
67
+            Frm.Show();
68
+        }
69
+
70
+        private static List<List<string>> Getlyobjinfo(string layername, int num)
71
+        {
72
+            List<List<string>> info = new List<List<string>>();//图层中obj信息
73
+
74
+            Database database = HostApplicationServices.WorkingDatabase;
75
+            using (Transaction traction = database.TransactionManager.StartTransaction())
76
+            {
77
+                // 获得当前文档的编辑器  
78
+                Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
79
+                // 创建一个 TypedValue 数组,用于定义过滤条件
80
+                TypedValue[] typedvalue = new TypedValue[1];
81
+                typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, layername), 0);
82
+                // 赋值过滤条件给 SelectionFilter 对象
83
+                SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
84
+                // 要求在图形区域中手动选择对象
85
+                PromptSelectionResult psr = editor.SelectAll(selectionfilter);
86
+
87
+                if (psr.Status == PromptStatus.OK)
88
+                {
89
+                    SelectionSet selectionset = psr.Value;
90
+                    ObjectId[] obj = new ObjectId[selectionset.Count];
91
+                    obj = selectionset.GetObjectIds();
92
+
93
+                    for (int i = 0; i < obj.Length; i++)
94
+                    {
95
+                        //获取实体
96
+                        ObjectId objid = obj[i];
97
+                        Entity entity = (Entity)traction.GetObject(objid, OpenMode.ForRead);
98
+                        objid_all.Add(objid);
99
+
100
+                        if (entity is Polyline)
101
+                        {
102
+                            num++;
103
+                            Polyline pll = (Polyline)entity;
104
+                            string name = "无";
105
+                            string type = "多段线";
106
+                            double X = pll.StartPoint.X;
107
+                            double Y = pll.StartPoint.Y;
108
+                            double Z = pll.Elevation;
109
+                            double length = pll.Length;
110
+                            string area;
111
+                            if(pll.Closed)
112
+                            {
113
+                                area = pll.Area.ToString("0.000");
114
+                            }
115
+                            else
116
+                            {
117
+                                area = "无";
118
+                            }
119
+                            List<string> temp = new List<string>();
120
+                            temp.Add(num.ToString());
121
+                            temp.Add(name);
122
+                            temp.Add(type);
123
+                            temp.Add(X.ToString("0.000"));
124
+                            temp.Add(Y.ToString("0.000"));
125
+                            temp.Add(Z.ToString("0.000"));
126
+                            temp.Add(length.ToString("0.000"));
127
+                            temp.Add(area);
128
+                            info.Add(temp);
129
+                        }
130
+                        if (entity is Polyline2d)
131
+                        {
132
+                            num++;
133
+                            Polyline2d pll = (Polyline2d)entity;
134
+                            string name = "无";
135
+                            string type = "二维多段线";
136
+                            double X = pll.StartPoint.X;
137
+                            double Y = pll.StartPoint.Y;
138
+                            double Z = pll.Elevation;
139
+                            double length = pll.Length;
140
+                            string area;
141
+                            if (pll.Closed)
142
+                            {
143
+                                area = pll.Area.ToString("0.000");
144
+                            }
145
+                            else
146
+                            {
147
+                                area = "无";
148
+                            }
149
+                            List<string> temp = new List<string>();
150
+                            temp.Add(num.ToString());
151
+                            temp.Add(name);
152
+                            temp.Add(type);
153
+                            temp.Add(X.ToString("0.000"));
154
+                            temp.Add(Y.ToString("0.000"));
155
+                            temp.Add(Z.ToString("0.000"));
156
+                            temp.Add(length.ToString("0.000"));
157
+                            temp.Add(area);
158
+                            info.Add(temp);
159
+                        }
160
+                        else if (entity is Line)
161
+                        {
162
+                            num++;
163
+                            Line line = (Line)entity;
164
+                            string name = "无";
165
+                            string type = "直线";
166
+                            double X = line.StartPoint.X;
167
+                            double Y = line.StartPoint.Y;
168
+                            double Z = line.StartPoint.Z;
169
+                            double length = line.Length;
170
+                            string area;
171
+                            if (line.Closed)
172
+                            {
173
+                                area = line.Area.ToString("0.000");
174
+                            }
175
+                            else
176
+                            {
177
+                                area = "无";
178
+                            }
179
+                            List<string> temp = new List<string>();
180
+                            temp.Add(num.ToString());
181
+                            temp.Add(name);
182
+                            temp.Add(type);
183
+                            temp.Add(X.ToString("0.000"));
184
+                            temp.Add(Y.ToString("0.000"));
185
+                            temp.Add(Z.ToString("0.000"));
186
+                            temp.Add(length.ToString("0.000"));
187
+                            temp.Add(area);
188
+                            info.Add(temp);
189
+                        }
190
+                        else if (entity is DBText)
191
+                        {
192
+                            num++;
193
+                            DBText txt = (DBText)entity;
194
+                            string name = txt.TextString;
195
+                            string type = "文字";
196
+                            double X = txt.Position.X;
197
+                            double Y = txt.Position.Y;
198
+                            double Z = txt.Position.Z;
199
+                            string length = "无";
200
+                            string area = "无";
201
+                            List<string> temp = new List<string>();
202
+                            temp.Add(num.ToString());
203
+                            temp.Add(name);
204
+                            temp.Add(type);
205
+                            temp.Add(X.ToString("0.000"));
206
+                            temp.Add(Y.ToString("0.000"));
207
+                            temp.Add(Z.ToString("0.000"));
208
+                            temp.Add(length);
209
+                            temp.Add(area);
210
+                            info.Add(temp);
211
+                        }
212
+                        else if (entity is BlockReference)
213
+                        {
214
+                            num++;
215
+                            BlockReference blk = (BlockReference)entity;
216
+                            string name = blk.Name;
217
+                            string type = "块参照";
218
+                            double X = blk.Position.X;
219
+                            double Y = blk.Position.Y;
220
+                            double Z = blk.Position.Z;
221
+                            string length = "无";
222
+                            string area = "无";
223
+                            List<string> temp = new List<string>();
224
+                            temp.Add(num.ToString());
225
+                            temp.Add(name);
226
+                            temp.Add(type);
227
+                            temp.Add(X.ToString("0.000"));
228
+                            temp.Add(Y.ToString("0.000"));
229
+                            temp.Add(Z.ToString("0.000"));
230
+                            temp.Add(length);
231
+                            temp.Add(area);
232
+                            info.Add(temp);
233
+                        }
234
+                        else if(entity is Hatch)
235
+                        {
236
+                            num++;
237
+                            Hatch hc = (Hatch)entity;
238
+                            string name = hc.PatternName;
239
+                            string type = "图案填充";
240
+                            double X = hc.Origin.X;
241
+                            double Y = hc.Origin.Y;
242
+                            double Z = 0;
243
+                            string length = "无";
244
+                            string area = hc.Area.ToString();
245
+                            List<string> temp = new List<string>();
246
+                            temp.Add(num.ToString());
247
+                            temp.Add(name);
248
+                            temp.Add(type);
249
+                            temp.Add(X.ToString("0.000"));
250
+                            temp.Add(Y.ToString("0.000"));
251
+                            temp.Add(Z.ToString("0.000"));
252
+                            temp.Add(length);
253
+                            temp.Add(area);
254
+                            info.Add(temp);
255
+                        }
256
+                    }
257
+                }
258
+                traction.Commit();
259
+            }
260
+            return info;
261
+        }
262
+    }
263
+}

+ 2636
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CMCgis_Basicfunction.cs
文件差异内容过多而无法显示
查看文件


+ 1103
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ChPLContradiction.cs
文件差异内容过多而无法显示
查看文件


+ 171
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.Designer.cs 查看文件

@@ -0,0 +1,171 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class Chaginfos
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.btn_BrowseSave = new System.Windows.Forms.Button();
33
+            this.btn_BrowseNdupdate = new System.Windows.Forms.Button();
34
+            this.label_Save = new System.Windows.Forms.Label();
35
+            this.label_Update = new System.Windows.Forms.Label();
36
+            this.txtbox_SaveLocation = new System.Windows.Forms.TextBox();
37
+            this.txtbox_nDupdateLocation = new System.Windows.Forms.TextBox();
38
+            this.dataGridView_Update = new System.Windows.Forms.DataGridView();
39
+            this.btn_Update = new System.Windows.Forms.Button();
40
+            this.label1 = new System.Windows.Forms.Label();
41
+            this.comboBox_layer = new System.Windows.Forms.ComboBox();
42
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Update)).BeginInit();
43
+            this.SuspendLayout();
44
+            // 
45
+            // btn_BrowseSave
46
+            // 
47
+            this.btn_BrowseSave.Location = new System.Drawing.Point(494, 90);
48
+            this.btn_BrowseSave.Name = "btn_BrowseSave";
49
+            this.btn_BrowseSave.Size = new System.Drawing.Size(47, 30);
50
+            this.btn_BrowseSave.TabIndex = 18;
51
+            this.btn_BrowseSave.Text = "浏览";
52
+            this.btn_BrowseSave.UseVisualStyleBackColor = true;
53
+            this.btn_BrowseSave.Click += new System.EventHandler(this.btn_BrowseSave_Click);
54
+            // 
55
+            // btn_BrowseNdupdate
56
+            // 
57
+            this.btn_BrowseNdupdate.Location = new System.Drawing.Point(494, 38);
58
+            this.btn_BrowseNdupdate.Name = "btn_BrowseNdupdate";
59
+            this.btn_BrowseNdupdate.Size = new System.Drawing.Size(47, 29);
60
+            this.btn_BrowseNdupdate.TabIndex = 17;
61
+            this.btn_BrowseNdupdate.Text = "浏览";
62
+            this.btn_BrowseNdupdate.UseVisualStyleBackColor = true;
63
+            this.btn_BrowseNdupdate.Click += new System.EventHandler(this.btn_BrowseNdupdate_Click);
64
+            // 
65
+            // label_Save
66
+            // 
67
+            this.label_Save.AutoSize = true;
68
+            this.label_Save.Location = new System.Drawing.Point(74, 98);
69
+            this.label_Save.Name = "label_Save";
70
+            this.label_Save.Size = new System.Drawing.Size(82, 15);
71
+            this.label_Save.TabIndex = 16;
72
+            this.label_Save.Text = "保存路径:";
73
+            // 
74
+            // label_Update
75
+            // 
76
+            this.label_Update.Location = new System.Drawing.Point(74, 29);
77
+            this.label_Update.Name = "label_Update";
78
+            this.label_Update.Size = new System.Drawing.Size(77, 55);
79
+            this.label_Update.TabIndex = 15;
80
+            this.label_Update.Text = "需修改的文件所在路径:";
81
+            // 
82
+            // txtbox_SaveLocation
83
+            // 
84
+            this.txtbox_SaveLocation.Location = new System.Drawing.Point(157, 95);
85
+            this.txtbox_SaveLocation.Name = "txtbox_SaveLocation";
86
+            this.txtbox_SaveLocation.Size = new System.Drawing.Size(319, 25);
87
+            this.txtbox_SaveLocation.TabIndex = 14;
88
+            // 
89
+            // txtbox_nDupdateLocation
90
+            // 
91
+            this.txtbox_nDupdateLocation.Location = new System.Drawing.Point(157, 41);
92
+            this.txtbox_nDupdateLocation.Name = "txtbox_nDupdateLocation";
93
+            this.txtbox_nDupdateLocation.Size = new System.Drawing.Size(319, 25);
94
+            this.txtbox_nDupdateLocation.TabIndex = 13;
95
+            // 
96
+            // dataGridView_Update
97
+            // 
98
+            this.dataGridView_Update.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
99
+            this.dataGridView_Update.Location = new System.Drawing.Point(77, 197);
100
+            this.dataGridView_Update.Margin = new System.Windows.Forms.Padding(4);
101
+            this.dataGridView_Update.Name = "dataGridView_Update";
102
+            this.dataGridView_Update.RowHeadersWidth = 51;
103
+            this.dataGridView_Update.RowTemplate.Height = 23;
104
+            this.dataGridView_Update.Size = new System.Drawing.Size(473, 195);
105
+            this.dataGridView_Update.TabIndex = 12;
106
+            // 
107
+            // btn_Update
108
+            // 
109
+            this.btn_Update.Location = new System.Drawing.Point(252, 411);
110
+            this.btn_Update.Name = "btn_Update";
111
+            this.btn_Update.Size = new System.Drawing.Size(89, 31);
112
+            this.btn_Update.TabIndex = 19;
113
+            this.btn_Update.Text = "确定更新";
114
+            this.btn_Update.UseVisualStyleBackColor = true;
115
+            this.btn_Update.Click += new System.EventHandler(this.btn_Update_Click);
116
+            // 
117
+            // label1
118
+            // 
119
+            this.label1.Location = new System.Drawing.Point(74, 138);
120
+            this.label1.Name = "label1";
121
+            this.label1.Size = new System.Drawing.Size(77, 55);
122
+            this.label1.TabIndex = 20;
123
+            this.label1.Text = "待修改信息所在图层:";
124
+            // 
125
+            // comboBox_layer
126
+            // 
127
+            this.comboBox_layer.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
128
+            this.comboBox_layer.FormattingEnabled = true;
129
+            this.comboBox_layer.Location = new System.Drawing.Point(157, 151);
130
+            this.comboBox_layer.Name = "comboBox_layer";
131
+            this.comboBox_layer.Size = new System.Drawing.Size(184, 23);
132
+            this.comboBox_layer.TabIndex = 21;
133
+            // 
134
+            // Chaginfos
135
+            // 
136
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
137
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138
+            this.ClientSize = new System.Drawing.Size(624, 466);
139
+            this.Controls.Add(this.comboBox_layer);
140
+            this.Controls.Add(this.label1);
141
+            this.Controls.Add(this.btn_Update);
142
+            this.Controls.Add(this.btn_BrowseSave);
143
+            this.Controls.Add(this.btn_BrowseNdupdate);
144
+            this.Controls.Add(this.label_Save);
145
+            this.Controls.Add(this.label_Update);
146
+            this.Controls.Add(this.txtbox_SaveLocation);
147
+            this.Controls.Add(this.txtbox_nDupdateLocation);
148
+            this.Controls.Add(this.dataGridView_Update);
149
+            this.Name = "Chaginfos";
150
+            this.Text = "批量修改图框信息";
151
+            this.Load += new System.EventHandler(this.Chaginfos_Load);
152
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Update)).EndInit();
153
+            this.ResumeLayout(false);
154
+            this.PerformLayout();
155
+
156
+        }
157
+
158
+        #endregion
159
+
160
+        private System.Windows.Forms.Button btn_BrowseSave;
161
+        private System.Windows.Forms.Button btn_BrowseNdupdate;
162
+        private System.Windows.Forms.Label label_Save;
163
+        private System.Windows.Forms.Label label_Update;
164
+        private System.Windows.Forms.TextBox txtbox_SaveLocation;
165
+        private System.Windows.Forms.TextBox txtbox_nDupdateLocation;
166
+        private System.Windows.Forms.DataGridView dataGridView_Update;
167
+        private System.Windows.Forms.Button btn_Update;
168
+        private System.Windows.Forms.Label label1;
169
+        private System.Windows.Forms.ComboBox comboBox_layer;
170
+    }
171
+}

+ 352
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.cs 查看文件

@@ -0,0 +1,352 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+using System.Windows.Forms;
10
+
11
+using GrxCAD.EditorInput;
12
+using GrxCAD.DatabaseServices;
13
+using GrxCAD.Geometry;
14
+using System.IO;
15
+using GrxCAD.ApplicationServices;
16
+
17
+namespace HCTools
18
+{
19
+    public partial class Chaginfos : Form
20
+    {
21
+        public Chaginfos()
22
+        {
23
+            InitializeComponent();
24
+        }
25
+
26
+        public struct record
27
+        {
28
+            public string original;
29
+            public string now;
30
+            public double distance;
31
+
32
+            public record(string original, string now, double distance)
33
+            {
34
+                this.original = original;
35
+                this.now = now;
36
+                this.distance = distance;
37
+            }
38
+        }
39
+
40
+        private void Chaginfos_Load(object sender, EventArgs e)
41
+        {
42
+            dataGridView_Update.ColumnCount = 3;
43
+            dataGridView_Update.Columns[0].HeaderText = "原始内容";
44
+            dataGridView_Update.Columns[1].HeaderText = "修改内容";
45
+            dataGridView_Update.Columns[2].HeaderText = "平移距离";
46
+
47
+            dataGridView_Update.RowHeadersVisible = false;
48
+            dataGridView_Update.AllowUserToResizeRows = false;
49
+
50
+            dataGridView_Update.Columns[0].Width = 181;
51
+            dataGridView_Update.Columns[1].Width = 181;
52
+            dataGridView_Update.Columns[2].Width = 100;
53
+
54
+            dataGridView_Update.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
55
+            dataGridView_Update.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
56
+            dataGridView_Update.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
57
+
58
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
59
+            using (Transaction traction = database.TransactionManager.StartTransaction())
60
+            {
61
+                //存放所有图层名
62
+                List<string> alllayername = new List<string>();
63
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
64
+                foreach (ObjectId objid in layertable)
65
+                {
66
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
67
+                    alllayername.Add(layertablerecord.Name);
68
+                }
69
+                alllayername.Sort();
70
+
71
+                for (int i = 0; i < alllayername.Count; i++)
72
+                {
73
+                    this.comboBox_layer.Items.Add(alllayername[i]);
74
+                }
75
+            }
76
+        }
77
+
78
+
79
+        List<record> list = new List<record>();
80
+        private void btn_Update_Click(object sender, EventArgs e)
81
+        {
82
+            list.Clear();
83
+            int j = 0;
84
+
85
+            if (path_Open == "" || path_Save == "")
86
+            {
87
+                MessageBox.Show("需修改的文件所在路径或保存路径为空!", "提示");
88
+                return;
89
+            }
90
+
91
+            //Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
92
+            dataGridView_Update.ReadOnly = true;
93
+            for (int i = 0; i < dataGridView_Update.Rows.Count; i++)
94
+            {
95
+                string original = "";
96
+                string now = "";
97
+                string str = "";
98
+                double distance = 0;
99
+
100
+                object obj0 = dataGridView_Update[0, i].Value;
101
+                if (obj0 != null)
102
+                {
103
+                    original = obj0.ToString();
104
+                }
105
+                object obj1 = dataGridView_Update[1, i].Value;
106
+
107
+                if (obj1 != null)
108
+                {
109
+                    now = obj1.ToString();
110
+                }
111
+                object obj2 = dataGridView_Update[2, i].Value;
112
+
113
+                if (obj2 != null)
114
+                {
115
+                    str = obj2.ToString();
116
+                }
117
+
118
+                if (string.IsNullOrEmpty(str) == false)
119
+                {
120
+                    distance = Convert.ToDouble(str.ToString());
121
+                }
122
+
123
+                list.Add(new record(original, now, distance));
124
+            }
125
+            dataGridView_Update.ReadOnly = false;
126
+
127
+            //记录删除记录
128
+            List<string> delete = new List<string>();
129
+
130
+            string[] file = Directory.GetFiles(path_Open);
131
+            for (int i = 0; i < file.Length; i++)
132
+            {
133
+                string paths = file[i];
134
+                string name = System.IO.Path.GetFileName(paths);
135
+
136
+                if (name.Contains(".dwg") == false)
137
+                {
138
+                    continue;
139
+                }
140
+
141
+                Database data = new Database(false, true);
142
+                data.ReadDwgFile(paths, FileShare.Read, true, null);
143
+                data.CloseInput(true);
144
+
145
+
146
+                //记录附注起始坐标
147
+                //Point3d position = new Point3d();
148
+
149
+
150
+                delete.Clear();
151
+
152
+                using (Transaction trans = data.TransactionManager.StartTransaction())
153
+                {
154
+                    BlockTable bt = (BlockTable)trans.GetObject(data.BlockTableId, OpenMode.ForWrite);
155
+                    BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
156
+
157
+
158
+                    LayerTable lt = trans.GetObject(data.LayerTableId, OpenMode.ForRead) as LayerTable;
159
+                    LayerTableRecord ltr = trans.GetObject(lt[comboBox_layer.SelectedItem.ToString()], OpenMode.ForRead) as LayerTableRecord;
160
+                    ObjectId LayerID = ltr.ObjectId;
161
+
162
+                    foreach (ObjectId id in btr)
163
+                    {
164
+                        Entity ent = trans.GetObject(id, OpenMode.ForWrite) as Entity;
165
+                        if (ent != null)
166
+                        {
167
+                            if (ent.GetType().ToString() == "GrxCAD.DatabaseServices.DBText" && ent.LayerId == LayerID)
168
+                            {
169
+
170
+                                DBText T = ent as DBText;
171
+                                string str = T.TextString.Trim();
172
+
173
+                                //if (str.Contains("投影方式") && T.LayerId == LayerID)
174
+                                //{
175
+                                //    position = T.Position;
176
+                                //}
177
+
178
+                                //if (str.Contains("测图员") || str.Contains("数化员") || str.Contains("检查员") || str.Contains("复查员"))
179
+                                //{
180
+                                //    if (T.LayerId == LayerID)
181
+                                //    {
182
+                                //        delete.Add(str + "\t");
183
+                                //        T.Erase(true);
184
+                                //        //continue;
185
+                                //    }
186
+
187
+                                //}
188
+
189
+                                for (int k = 0; k < list.Count; k++)
190
+                                {
191
+                                    if (str == list[k].original.Trim())
192
+                                    {
193
+
194
+                                        if (string.IsNullOrEmpty(list[k].now) == true)
195
+                                        {
196
+                                            if (T.LayerId == LayerID)
197
+                                            {
198
+                                                j++;
199
+                                                delete.Add(str + "\t");
200
+                                                T.Erase(true);
201
+                                                continue;
202
+                                            }
203
+                                        }
204
+                                        else
205
+                                        {
206
+                                            j++;
207
+                                            T.TextString = list[k].now;
208
+                                            T.Position = new Point3d(T.Position.X + list[k].distance, T.Position.Y, 0);
209
+                                        }
210
+                                    }
211
+                                }
212
+
213
+                            }
214
+
215
+                        }
216
+
217
+                    }
218
+
219
+
220
+                    //if (position != null)
221
+                    //{
222
+
223
+                    //    TextStyleTable tst = trans.GetObject(data.TextStyleTableId, OpenMode.ForRead) as TextStyleTable;
224
+                    //    TextStyleTableRecord tstr = trans.GetObject(tst["HZ"], OpenMode.ForRead) as TextStyleTableRecord;
225
+                    //    ObjectId TStyleID = tstr.ObjectId;
226
+
227
+
228
+
229
+                    //    ObjectId HZ = TStyleID;
230
+                    //    double xx = position.X;
231
+                    //    double yy = position.Y;
232
+
233
+                    //    string[] contents = new string[7];
234
+                    //    contents[0] = "SPHEROID:WGS-84 ";
235
+                    //    contents[1] = "PROJECTION:Gauss-Kruger projection;";
236
+                    //    contents[2] = "Center meridian is 104°16′; Projection elevation is 310m.";
237
+                    //    //
238
+                    //    //
239
+                    //    //
240
+                    //    contents[3] = "VERTICAL DATUM : From Mean Sea Level HONDAU(Vietnam), Contour intervals: 1 meter";
241
+                    //    contents[4] = "GB/T 20257.1-2007 Cartographic symbols for national fundamental scale maps ";
242
+                    //    //contents[4] = "GB/T 20257.2-2006 Cartographic symbols for national fundamental scale maps ";
243
+                    //    contents[5] = "Part 1: Specifications for cartographic symbols 1:500 1:1000&1:2000 topographic maps";
244
+                    //    //contents[5] = "Part 2: Specifications for cartographic symbols 1:5000&1:10000 topographic maps";
245
+                    //    contents[6] = "December 2012";
246
+
247
+                    //    for (int k = 0; k < contents.Length; k++)
248
+                    //    {
249
+                    //        DBText text1 = new DBText();
250
+                    //        text1.TextString = contents[k];
251
+                    //        text1.Position = new Point3d(xx, yy, 0);
252
+                    //        //text1.Height = 15;
253
+                    //        text1.Height = 3;
254
+                    //        text1.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
255
+                    //        text1.LayerId = LayerID;
256
+                    //        text1.TextStyleId = HZ;
257
+                    //        text1.WidthFactor = 0.8;
258
+
259
+                    //        text1.SetDatabaseDefaults(data);
260
+                    //        btr.AppendEntity(text1);
261
+                    //        trans.AddNewlyCreatedDBObject(text1, true);
262
+
263
+
264
+
265
+                    //        //yy = yy - 30;
266
+                    //        yy = yy - 5;
267
+                    //    }
268
+
269
+                    //}
270
+                    //else
271
+                    //{
272
+
273
+                    //}
274
+
275
+
276
+                    trans.Commit();
277
+                }
278
+
279
+                //Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
280
+                //2007版本格式
281
+                //data.SaveAs(path_Save + "\\" + name, true, DwgVersion.AC1021, doc.Database.SecurityParameters);
282
+                data.SaveAs(path_Save + "\\" + name, DwgVersion.AC1021);
283
+                //2004版本格式
284
+                //data.SaveAs(path_Save + "\\" + name, DwgVersion.AC1800);
285
+                //2000版本格式
286
+                //data.SaveAs(path_Save + "\\" + name, DwgVersion.AC1015);
287
+
288
+
289
+                data.Dispose();
290
+
291
+                //
292
+                delete.Sort();
293
+                string deleterecord = "";
294
+                foreach (var item in delete)
295
+                {
296
+                    deleterecord += item;
297
+                }
298
+
299
+                deleterecord = name + "\t" + deleterecord;
300
+                deleterecord += "\r\n";
301
+
302
+                System.IO.StreamWriter writer = new StreamWriter(path_Save+"\\改动文件.txt", true);
303
+                writer.Write(deleterecord);
304
+                writer.Dispose();
305
+            }
306
+            if (j > 0)
307
+                MessageBox.Show("修改成功!");
308
+            else
309
+                MessageBox.Show("未找到原始内容,修改失败!");
310
+            this.Close();
311
+        }
312
+
313
+
314
+        private string path_Open = "";
315
+        private void btn_BrowseNdupdate_Click(object sender, EventArgs e)
316
+        {
317
+            path_Open = "";
318
+
319
+            FolderBrowserDialog FBD = new FolderBrowserDialog();
320
+            FBD.Description = "选择需修改数据数据目录";
321
+            FBD.ShowNewFolderButton = false;
322
+            DialogResult result = FBD.ShowDialog();
323
+
324
+            if (result == DialogResult.OK)
325
+            {
326
+                path_Open = FBD.SelectedPath;
327
+            }
328
+
329
+            txtbox_nDupdateLocation.Text = path_Open;
330
+        }
331
+
332
+
333
+        string path_Save = "";
334
+        private void btn_BrowseSave_Click(object sender, EventArgs e)
335
+        {
336
+            path_Save = "";
337
+
338
+            FolderBrowserDialog FBD = new FolderBrowserDialog();
339
+            FBD.Description = "选择保存数据目录";
340
+            FBD.ShowNewFolderButton = false;
341
+            DialogResult result = FBD.ShowDialog();
342
+
343
+            if (result == DialogResult.OK)
344
+            {
345
+                path_Save = FBD.SelectedPath;
346
+            }
347
+
348
+            txtbox_SaveLocation.Text = path_Save;
349
+        }
350
+
351
+    }
352
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 95
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckContourLine.cs 查看文件

@@ -0,0 +1,95 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+using GrxCAD.ApplicationServices;
8
+using GrxCAD.DatabaseServices;
9
+using GrxCAD.EditorInput;
10
+using GrxCAD.Geometry;
11
+
12
+namespace HCTools
13
+{
14
+    class CheckContourLine
15
+    {
16
+        public static int gap;
17
+        public static string jqx;
18
+        public static string sqx;
19
+
20
+        public void Valuecheck()
21
+        {
22
+            Document doc = Application.DocumentManager.MdiActiveDocument;
23
+            string LayerName = jqx + "," +sqx;
24
+            ObjectId[] ids = BasicFunction.getHeight(LayerName);//存放获取的等高线id
25
+
26
+
27
+            //如果没有等高线则返回
28
+            if (ids == null)
29
+                return;
30
+
31
+            //检查是否有错误曲线图层,没有则创建
32
+            LayerControl layerscontrol = new LayerControl();
33
+            string layname = "等高线有误";
34
+            if (!layerscontrol.haslayername(layname))
35
+            {
36
+                colorgb col = new colorgb(255, 0, 225);
37
+                layerscontrol.creatlayer(layname, col);
38
+                layerscontrol.movelayertofront(layname);
39
+            }
40
+            else
41
+                layerscontrol.movelayertofront(layname);
42
+
43
+            int j = 0;
44
+            int num = 0;
45
+            for (int i = 0; i < ids.Length; i++)
46
+            {
47
+                Polyline pll = BasicFunction.GetDBObject(ids[i]) as Polyline;
48
+                if (pll.Elevation <= 0)
49
+                {
50
+                    ChangeLayer(pll.Id, layname);
51
+                    j++;
52
+                }
53
+                else
54
+                {
55
+                    if (int.TryParse(Math.Round(pll.Elevation, 3, MidpointRounding.AwayFromZero).ToString(), out num))
56
+                    {
57
+                        if (Math.Round(pll.Elevation,3, MidpointRounding.AwayFromZero) % gap == 0)
58
+                        {
59
+                            continue;
60
+                        }
61
+                        else
62
+                        {
63
+                            ChangeLayer(pll.Id, layname);
64
+                            j++;
65
+                        }
66
+                    }
67
+                    else
68
+                    {
69
+                        ChangeLayer(pll.Id, layname);
70
+                        j++;
71
+                    }
72
+                }
73
+            }
74
+            Editor ed = doc.Editor; ed.WriteMessage("共有" + j + "处错误");
75
+        }
76
+
77
+
78
+        private void ChangeLayer(ObjectId c1Id, string lyname)
79
+        {
80
+            Database db = HostApplicationServices.WorkingDatabase;
81
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
82
+            using (Transaction trans = db.TransactionManager.StartTransaction())
83
+            {
84
+                BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);
85
+                BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
86
+                Entity ent1 = (Entity)c1Id.GetObject(OpenMode.ForWrite);
87
+                ent1.Layer = lyname;
88
+                trans.Commit();
89
+            }
90
+            doclock.Dispose();
91
+        }
92
+    }
93
+}
94
+
95
+

+ 147
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.Designer.cs 查看文件

@@ -0,0 +1,147 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class CheckL
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.textBox_Gap = new System.Windows.Forms.TextBox();
33
+            this.label_Gap = new System.Windows.Forms.Label();
34
+            this.btn_Cancel = new System.Windows.Forms.Button();
35
+            this.btn_OK = new System.Windows.Forms.Button();
36
+            this.label1 = new System.Windows.Forms.Label();
37
+            this.label2 = new System.Windows.Forms.Label();
38
+            this.comboBox_sqx = new System.Windows.Forms.ComboBox();
39
+            this.comboBox_jqx = new System.Windows.Forms.ComboBox();
40
+            this.SuspendLayout();
41
+            // 
42
+            // textBox_Gap
43
+            // 
44
+            this.textBox_Gap.Location = new System.Drawing.Point(167, 127);
45
+            this.textBox_Gap.Name = "textBox_Gap";
46
+            this.textBox_Gap.Size = new System.Drawing.Size(169, 25);
47
+            this.textBox_Gap.TabIndex = 3;
48
+            // 
49
+            // label_Gap
50
+            // 
51
+            this.label_Gap.AutoSize = true;
52
+            this.label_Gap.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
53
+            this.label_Gap.Location = new System.Drawing.Point(94, 130);
54
+            this.label_Gap.Name = "label_Gap";
55
+            this.label_Gap.Size = new System.Drawing.Size(67, 15);
56
+            this.label_Gap.TabIndex = 2;
57
+            this.label_Gap.Text = "等高距:";
58
+            // 
59
+            // btn_Cancel
60
+            // 
61
+            this.btn_Cancel.Location = new System.Drawing.Point(255, 171);
62
+            this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4);
63
+            this.btn_Cancel.Name = "btn_Cancel";
64
+            this.btn_Cancel.Size = new System.Drawing.Size(100, 29);
65
+            this.btn_Cancel.TabIndex = 34;
66
+            this.btn_Cancel.Text = "取 消";
67
+            this.btn_Cancel.UseVisualStyleBackColor = true;
68
+            this.btn_Cancel.Click += new System.EventHandler(this.btn_Cancel_Click);
69
+            // 
70
+            // btn_OK
71
+            // 
72
+            this.btn_OK.Location = new System.Drawing.Point(77, 171);
73
+            this.btn_OK.Margin = new System.Windows.Forms.Padding(4);
74
+            this.btn_OK.Name = "btn_OK";
75
+            this.btn_OK.Size = new System.Drawing.Size(100, 29);
76
+            this.btn_OK.TabIndex = 33;
77
+            this.btn_OK.Text = "确 定";
78
+            this.btn_OK.UseVisualStyleBackColor = true;
79
+            this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
80
+            // 
81
+            // label1
82
+            // 
83
+            this.label1.AutoSize = true;
84
+            this.label1.Location = new System.Drawing.Point(64, 25);
85
+            this.label1.Name = "label1";
86
+            this.label1.Size = new System.Drawing.Size(97, 15);
87
+            this.label1.TabIndex = 35;
88
+            this.label1.Text = "首曲线图层:";
89
+            // 
90
+            // label2
91
+            // 
92
+            this.label2.AutoSize = true;
93
+            this.label2.Location = new System.Drawing.Point(64, 74);
94
+            this.label2.Name = "label2";
95
+            this.label2.Size = new System.Drawing.Size(97, 15);
96
+            this.label2.TabIndex = 36;
97
+            this.label2.Text = "计曲线图层:";
98
+            // 
99
+            // comboBox_sqx
100
+            // 
101
+            this.comboBox_sqx.FormattingEnabled = true;
102
+            this.comboBox_sqx.Location = new System.Drawing.Point(167, 22);
103
+            this.comboBox_sqx.Name = "comboBox_sqx";
104
+            this.comboBox_sqx.Size = new System.Drawing.Size(169, 23);
105
+            this.comboBox_sqx.TabIndex = 37;
106
+            // 
107
+            // comboBox_jqx
108
+            // 
109
+            this.comboBox_jqx.FormattingEnabled = true;
110
+            this.comboBox_jqx.Location = new System.Drawing.Point(167, 71);
111
+            this.comboBox_jqx.Name = "comboBox_jqx";
112
+            this.comboBox_jqx.Size = new System.Drawing.Size(169, 23);
113
+            this.comboBox_jqx.TabIndex = 38;
114
+            // 
115
+            // CheckL
116
+            // 
117
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
118
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
119
+            this.ClientSize = new System.Drawing.Size(434, 213);
120
+            this.Controls.Add(this.comboBox_jqx);
121
+            this.Controls.Add(this.comboBox_sqx);
122
+            this.Controls.Add(this.label2);
123
+            this.Controls.Add(this.label1);
124
+            this.Controls.Add(this.btn_Cancel);
125
+            this.Controls.Add(this.btn_OK);
126
+            this.Controls.Add(this.textBox_Gap);
127
+            this.Controls.Add(this.label_Gap);
128
+            this.Name = "CheckL";
129
+            this.Text = "等高线检查";
130
+            this.Load += new System.EventHandler(this.CheckL_Load);
131
+            this.ResumeLayout(false);
132
+            this.PerformLayout();
133
+
134
+        }
135
+
136
+        #endregion
137
+
138
+        private System.Windows.Forms.TextBox textBox_Gap;
139
+        private System.Windows.Forms.Label label_Gap;
140
+        private System.Windows.Forms.Button btn_Cancel;
141
+        private System.Windows.Forms.Button btn_OK;
142
+        private System.Windows.Forms.Label label1;
143
+        private System.Windows.Forms.Label label2;
144
+        private System.Windows.Forms.ComboBox comboBox_sqx;
145
+        private System.Windows.Forms.ComboBox comboBox_jqx;
146
+    }
147
+}

+ 101
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.cs 查看文件

@@ -0,0 +1,101 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class CheckL : Form
15
+    {
16
+        public CheckL()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void btn_OK_Click(object sender, EventArgs e)
22
+        {
23
+            int num = 0;
24
+            if (comboBox_jqx.Text == "")
25
+            {
26
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线所在图层");
27
+                return;
28
+            }
29
+            if (comboBox_sqx.Text == "")
30
+            {
31
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线所在图层");
32
+                return;
33
+            }
34
+            if (textBox_Gap.Text == "")
35
+            {
36
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入等高距");
37
+                return;
38
+            }
39
+
40
+            if (int.TryParse(textBox_Gap.Text.ToString(), out num) == false)
41
+            {
42
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("等高距必须为整数");
43
+                return;
44
+            }
45
+
46
+            CheckContourLine.gap = Convert.ToInt32(textBox_Gap.Text);
47
+            CheckContourLine.jqx = comboBox_jqx.Text;
48
+            CheckContourLine.sqx = comboBox_sqx.Text;
49
+
50
+            this.Close();
51
+            CheckContourLine ccline = new CheckContourLine();
52
+            ccline.Valuecheck();
53
+            this.Close();
54
+        }
55
+
56
+        private void CheckL_Load(object sender, EventArgs e)
57
+        {
58
+            this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList;
59
+            this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList;
60
+
61
+            //自动填充下拉框
62
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
63
+            using (Transaction traction = database.TransactionManager.StartTransaction())
64
+            {
65
+                //存放所有图层名
66
+                List<string> alllayername = new List<string>();
67
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
68
+                foreach (ObjectId objid in layertable)
69
+                {
70
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
71
+                    alllayername.Add(layertablerecord.Name);
72
+                }
73
+
74
+                alllayername.Sort();
75
+
76
+                for (int i = 0; i < alllayername.Count; i++)
77
+                {
78
+                    this.comboBox_jqx.Items.Add(alllayername[i]);
79
+                    this.comboBox_sqx.Items.Add(alllayername[i]);
80
+                }
81
+
82
+                if (alllayername.Contains("8110"))
83
+                {
84
+                    int index = alllayername.IndexOf("8110");
85
+                    this.comboBox_sqx.SelectedIndex = index;
86
+                }
87
+                if (alllayername.Contains("8120"))
88
+                {
89
+                    int index = alllayername.IndexOf("8120");
90
+                    this.comboBox_jqx.SelectedIndex = index;
91
+                }
92
+                traction.Commit();
93
+            }
94
+        }
95
+
96
+        private void btn_Cancel_Click(object sender, EventArgs e)
97
+        {
98
+            this.Close();
99
+        }
100
+    }
101
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 422
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckPLOverlay.cs 查看文件

@@ -0,0 +1,422 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Diagnostics;
6
+
7
+using GrxCAD.Geometry;
8
+using GrxCAD.DatabaseServices;
9
+using GrxCAD.ApplicationServices;
10
+using GrxCAD.EditorInput;
11
+
12
+
13
+
14
+namespace HCTools
15
+{
16
+
17
+    public struct CPoint
18
+    {
19
+        public double x;
20
+        public double y;
21
+        public double z;
22
+        public object objID;
23
+    }
24
+
25
+
26
+    /// <summary>
27
+    /// 判断点和线是否重叠
28
+    /// </summary>
29
+    class CheckPLOverlay
30
+    {
31
+        public static int blc;//比例尺
32
+        public static string sqx;//首曲线
33
+        public static string jqx;//计曲线
34
+        public const int looptimes = 15;//循环查找次数
35
+        public static string EleLayerName;//高程点图层名
36
+
37
+        public int windowwidth;//当前可视范围
38
+        public int windowheight;
39
+
40
+
41
+        public double radius;//半径
42
+
43
+        public double length;//搜索半径
44
+        //存放所有高程点数组
45
+        public List<CPoint> pointarrlist = new List<CPoint>();
46
+
47
+        //存放有问题的高程点数组
48
+        public List<CPoint> errorpointarrlist = new List<CPoint>();
49
+
50
+
51
+
52
+
53
+
54
+
55
+        /// <summary>
56
+        /// 检测点线矛盾,并画圆标记出错误点
57
+        /// </summary>
58
+
59
+        public void contourch()
60
+        {
61
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
62
+
63
+            //清空各数组
64
+            pointarrlist.Clear();
65
+            errorpointarrlist.Clear();
66
+
67
+            double flagradius = 4.0 * blc / 1000;//画圆标记半径
68
+            windowwidth = 30 * 4 * blc / 1000;//确定可视范围
69
+            windowheight = 30 * 4 * blc / 1000;
70
+
71
+            if (blc == 500)
72
+            {
73
+                radius = 0.125;
74
+            }
75
+            else if (blc == 1000)
76
+            {
77
+                radius = 0.25;
78
+            }
79
+            else if (blc == 2000)
80
+            {
81
+                radius = 0.5;
82
+            }
83
+            else if (blc == 5000)
84
+            {
85
+                radius = 1.25;
86
+            }
87
+
88
+
89
+            //外切圆半径
90
+            length = radius * Math.Pow(2, 0.5);
91
+
92
+            selectcontourpoint(EleLayerName);//选出高程点
93
+            if (pointarrlist.Count == 0)
94
+            {
95
+                return;
96
+            }
97
+
98
+            //开始计时
99
+            Stopwatch watch = new Stopwatch();
100
+            watch.Start();
101
+
102
+            LayerControl layerscontrol = new LayerControl();
103
+            string layname = "点线重叠标记符号";
104
+            if (!layerscontrol.haslayername(layname))
105
+            {
106
+                colorgb col = new colorgb(255, 0, 255);
107
+                layerscontrol.creatlayer(layname, col);
108
+                layerscontrol.movelayertofront(layname);
109
+            }
110
+            else
111
+                layerscontrol.movelayertofront(layname);
112
+
113
+            layname = "点线重叠高程点";
114
+            if (layerscontrol.haslayername(layname) == false)
115
+            {
116
+                colorgb col = new colorgb(255, 0, 255);
117
+                layerscontrol.creatlayer(layname, col);
118
+            }
119
+
120
+
121
+
122
+            for (int i = 0; i < pointarrlist.Count; i++)
123
+            {
124
+                CPoint p = pointarrlist[i];
125
+                bool flag = check(p.x, p.y, p.z);
126
+                if (flag == false)
127
+                {
128
+                    errorpointarrlist.Add(p);
129
+                }
130
+            }
131
+
132
+
133
+
134
+
135
+            Database database = HostApplicationServices.WorkingDatabase;
136
+            using (Transaction traction = database.TransactionManager.StartTransaction())
137
+            {
138
+
139
+                DocumentLock documentlock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
140
+                BlockTable blocktable = traction.GetObject(database.BlockTableId,
141
+                                         OpenMode.ForWrite) as BlockTable;
142
+
143
+
144
+                string decimals = "";
145
+                if (blc == 2000 || blc == 5000)
146
+                {
147
+                    decimals = "F1";
148
+                }
149
+                else
150
+                {
151
+                    decimals = "F2";
152
+                }
153
+
154
+                for (int i = 0; i < errorpointarrlist.Count; i++)
155
+                {
156
+                    CPoint p = errorpointarrlist[i];
157
+
158
+                    BasicFunction functions = new BasicFunction();
159
+                    functions.makeflag(p.x, p.y, 0, flagradius, "点线重叠标记符号");
160
+
161
+
162
+                    ObjectId id = (ObjectId)p.objID;
163
+                    Entity entity = (Entity)traction.GetObject(id, OpenMode.ForWrite);
164
+                    entity.Layer = "点线重叠高程点";
165
+
166
+                    double z = p.z;
167
+                    string ele = z.ToString(decimals);
168
+
169
+
170
+                    Point3d p1 = new Point3d(p.x, p.y - 2.5, 0);
171
+                    Point3d p2 = new Point3d(p.x + 10, p.y + 2.5, 0);
172
+                    TypedValue[] typedvalue = new TypedValue[2];
173
+
174
+                    typedvalue.SetValue(new TypedValue((int)DxfCode.Start, "Text"), 0);
175
+                    typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, EleLayerName), 1);
176
+
177
+                    SelectionFilter filter = new SelectionFilter(typedvalue);
178
+                    PromptSelectionResult psr = editor.SelectCrossingWindow(p1, p2, filter);
179
+                    if (psr.Status == PromptStatus.OK)
180
+                    {
181
+                        SelectionSet set = psr.Value;
182
+                        ObjectId[] objs = new ObjectId[set.Count];
183
+                        objs = set.GetObjectIds();
184
+                        for (int ii = 0; ii < objs.Length; ii++)
185
+                        {
186
+                            Entity Text = (Entity)traction.GetObject(objs[ii], OpenMode.ForWrite);
187
+
188
+                            DBText T = (DBText)Text;
189
+                            if (T.TextString == ele)
190
+                            {
191
+                                T.Layer = "点线重叠高程点";
192
+                                T.Color = GrxCAD.Colors.Color.FromRgb(255, 0, 255);
193
+                            }
194
+                        }
195
+                    }
196
+
197
+
198
+                }
199
+
200
+                traction.Commit();
201
+                documentlock.Dispose();
202
+                traction.Dispose();
203
+            }
204
+
205
+
206
+
207
+
208
+            //耗时
209
+            watch.Stop();
210
+            long times = watch.ElapsedMilliseconds;
211
+            //editor.Regen();
212
+            //editor.UpdateScreen();
213
+
214
+            editor.WriteMessage("\n" + "耗时:" + times.ToString() + "毫秒");
215
+            editor.WriteMessage("\n" + "检测到压线高程点" + errorpointarrlist.Count.ToString());
216
+            editor.WriteMessage("\n");
217
+
218
+        }
219
+
220
+
221
+
222
+
223
+        /// <summary>
224
+        /// 选出所有高程点,并取出其x,y,z坐标
225
+        /// </summary>
226
+        /// <param name="layername">高程点图层名</param>
227
+        private void selectcontourpoint(string layername)
228
+        {
229
+            Document document = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
230
+            Database database = HostApplicationServices.WorkingDatabase;
231
+            using (Transaction traction = database.TransactionManager.StartTransaction())
232
+            {
233
+                // 获得当前文档的编辑器  
234
+                Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
235
+                // 创建一个 TypedValue 数组,用于定义过滤条件
236
+                TypedValue[] typedvalue = new TypedValue[1];
237
+                typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, layername), 0);
238
+                // 赋值过滤条件给 SelectionFilter 对象
239
+                SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
240
+
241
+                // 要求在图形区域中手动选择对象
242
+                PromptSelectionResult psr = editor.GetSelection(selectionfilter);
243
+
244
+                //自动选择图像区域全部对象
245
+                //PromptSelectionResult psr = editor.SelectAll(selectionfilter);
246
+
247
+
248
+                if (psr.Status == PromptStatus.OK)
249
+                {
250
+                    SelectionSet selectionset = psr.Value;
251
+
252
+                    ObjectId[] obj = new ObjectId[selectionset.Count];
253
+                    obj = selectionset.GetObjectIds();
254
+
255
+
256
+                    for (int i = 0; i < obj.Length; i++)
257
+                    {
258
+                        ObjectId objid = obj[i];
259
+
260
+                        //找到实体,取出高程点的x,y,z
261
+                        Entity entity = (Entity)traction.GetObject(objid, OpenMode.ForRead);
262
+
263
+                        if (entity is BlockReference)
264
+                        {
265
+                            BlockReference blockreference = (BlockReference)entity;
266
+                            CPoint cp = new CPoint();
267
+
268
+                            cp.x = blockreference.Position.X;
269
+                            cp.y = blockreference.Position.Y;
270
+                            cp.z = blockreference.Position.Z;
271
+                            cp.objID = objid;
272
+
273
+                            pointarrlist.Add(cp);
274
+                        }
275
+
276
+                    }
277
+                    editor.WriteMessage("\n" + "选中高程点数量:" + pointarrlist.Count.ToString());
278
+
279
+                }
280
+
281
+
282
+
283
+                traction.Commit();
284
+                traction.Dispose();
285
+            }
286
+        }
287
+
288
+
289
+        /// <summary>
290
+        /// 检查是否压线 
291
+        /// </summary>
292
+        /// <param name="x">高程点x坐标</param>
293
+        /// <param name="y">高程点y坐标</param>
294
+        /// <param name="z">高程点z坐标</param>
295
+        private bool check(double x, double y, double z)
296
+        {
297
+
298
+            Database database = HostApplicationServices.WorkingDatabase;
299
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
300
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
301
+            using (Transaction acTrans = database.TransactionManager.StartTransaction())
302
+            {
303
+                ViewTableRecord currview = editor.GetCurrentView();
304
+                currview.CenterPoint = new Point2d(x, y);
305
+                currview.ViewDirection = new Vector3d(0, 0, 1);
306
+                currview.Width = windowwidth;
307
+                currview.Height = windowheight;
308
+                editor.SetCurrentView(currview);
309
+                acTrans.Commit();
310
+            }
311
+
312
+            Transaction traction = database.TransactionManager.StartTransaction();
313
+            List<double> elevation = new List<double>();
314
+            try
315
+            {
316
+
317
+                BlockTable blocktable = traction.GetObject(database.BlockTableId,
318
+                                             OpenMode.ForWrite) as BlockTable;
319
+
320
+
321
+                BlockTableRecord blocktablerecord = traction.GetObject(blocktable[BlockTableRecord.ModelSpace],
322
+                                                OpenMode.ForWrite) as BlockTableRecord;
323
+
324
+
325
+                //ViewTableRecord currview = editor.GetCurrentView();
326
+                //currview.CenterPoint = new Point2d(x, y);
327
+                //currview.ViewDirection = new Vector3d(0, 0, 1);
328
+                //currview.Width = windowwidth;
329
+                //currview.Height = windowheight;
330
+                //editor.SetCurrentView(currview);
331
+
332
+
333
+                string filttext = sqx + "," + jqx;
334
+                TypedValue[] filterlist = new TypedValue[1]
335
+                    {
336
+                        new TypedValue((int)DxfCode.LayerName,filttext)
337
+                    };
338
+                //filterelist.SetValue(new TypedValue((int)DxfCode.LayerName, "8110,8120"),0);
339
+                // 赋值过滤条件给 SelectionFilter 对象
340
+                SelectionFilter filter = new SelectionFilter(filterlist);
341
+
342
+                Point3d p1 = new Point3d(x - length, y - length, 0);
343
+                Point3d p2 = new Point3d(x + length, y + length, 0);
344
+
345
+
346
+                PromptSelectionResult pselectresult;
347
+                pselectresult = editor.SelectCrossingWindow(p1, p2, filter);
348
+
349
+                if (pselectresult.Status == PromptStatus.OK)
350
+                {
351
+                    SelectionSet selectionset = pselectresult.Value;
352
+                    ObjectId[] obj = new ObjectId[selectionset.Count];
353
+                    obj = selectionset.GetObjectIds();
354
+                    for (int i = 0; i < obj.Length; i++)
355
+                    {
356
+                        ObjectId objid = obj[i];
357
+                        Entity entity = (Entity)traction.GetObject(objid, OpenMode.ForRead);
358
+
359
+                        if (entity is Polyline)
360
+                        {
361
+                            Polyline pline = (Polyline)entity;
362
+                            Point3d p = pline.GetClosestPointTo(new Point3d(x, y, z), new Vector3d(0, 0, 1), false);
363
+                            double distance = System.Math.Sqrt((p.X - x) * (p.X - x) + (p.Y - y) * (p.Y - y));
364
+                            if (distance < radius)
365
+                            {
366
+                                if ((distance == 0 || pline.Elevation != z) == true)
367
+                                {
368
+
369
+                                    return false;
370
+                                    //cpoint cp = new cpoint();
371
+                                    //cp.x = x;
372
+                                    //cp.y = y;
373
+                                    //cp.z = z;
374
+                                    //errorpointarrlist.Add(cp);
375
+                                }
376
+                            }
377
+                        }
378
+                        else if (entity is Polyline2d)
379
+                        {
380
+                            Polyline2d pline2d = (Polyline2d)entity;
381
+                            Point3d p = pline2d.GetClosestPointTo(new Point3d(x, y, z), new Vector3d(0, 0, 1), false);
382
+                            double distance = System.Math.Sqrt((p.X - x) * (p.X - x) + (p.Y - y) * (p.Y - y));
383
+                            if (distance < radius)
384
+                            {
385
+                                if ((distance == 0 && pline2d.Elevation == z) == false)
386
+                                {
387
+                                    return false;
388
+                                    //cpoint cp = new cpoint();
389
+                                    //cp.x = x;
390
+                                    //cp.y = y;
391
+                                    //cp.z = z;
392
+                                    //errorpointarrlist.Add(cp);
393
+                                }
394
+                            }
395
+                        }
396
+
397
+                    }
398
+
399
+                }
400
+
401
+
402
+            }
403
+            catch (GrxCAD.Runtime.Exception ex)
404
+            {
405
+                string str = ex.ToString();
406
+                Application.ShowAlertDialog(str);
407
+            }
408
+            finally
409
+            {
410
+                doclock.Dispose();
411
+                traction.Dispose();
412
+            }
413
+
414
+            return true;
415
+
416
+        }
417
+
418
+
419
+
420
+
421
+    }
422
+}

+ 154
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.Designer.cs 查看文件

@@ -0,0 +1,154 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class Conn
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.comboBox_blc = new System.Windows.Forms.ComboBox();
33
+            this.label_Blc = new System.Windows.Forms.Label();
34
+            this.btn_Cancel = new System.Windows.Forms.Button();
35
+            this.btn_OK = new System.Windows.Forms.Button();
36
+            this.comboBox_jqx = new System.Windows.Forms.ComboBox();
37
+            this.label2 = new System.Windows.Forms.Label();
38
+            this.comboBox_sqx = new System.Windows.Forms.ComboBox();
39
+            this.label1 = new System.Windows.Forms.Label();
40
+            this.SuspendLayout();
41
+            // 
42
+            // comboBox_blc
43
+            // 
44
+            this.comboBox_blc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
45
+            this.comboBox_blc.FormattingEnabled = true;
46
+            this.comboBox_blc.Items.AddRange(new object[] {
47
+            "1:500",
48
+            "1:1000",
49
+            "1:2000",
50
+            "1:5000"});
51
+            this.comboBox_blc.Location = new System.Drawing.Point(186, 28);
52
+            this.comboBox_blc.Margin = new System.Windows.Forms.Padding(4);
53
+            this.comboBox_blc.Name = "comboBox_blc";
54
+            this.comboBox_blc.Size = new System.Drawing.Size(160, 23);
55
+            this.comboBox_blc.TabIndex = 53;
56
+            // 
57
+            // label_Blc
58
+            // 
59
+            this.label_Blc.AutoSize = true;
60
+            this.label_Blc.Location = new System.Drawing.Point(83, 31);
61
+            this.label_Blc.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
62
+            this.label_Blc.Name = "label_Blc";
63
+            this.label_Blc.Size = new System.Drawing.Size(97, 15);
64
+            this.label_Blc.TabIndex = 52;
65
+            this.label_Blc.Text = "比例尺选择:";
66
+            // 
67
+            // btn_Cancel
68
+            // 
69
+            this.btn_Cancel.Location = new System.Drawing.Point(246, 167);
70
+            this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4);
71
+            this.btn_Cancel.Name = "btn_Cancel";
72
+            this.btn_Cancel.Size = new System.Drawing.Size(100, 29);
73
+            this.btn_Cancel.TabIndex = 55;
74
+            this.btn_Cancel.Text = "取 消";
75
+            this.btn_Cancel.UseVisualStyleBackColor = true;
76
+            // 
77
+            // btn_OK
78
+            // 
79
+            this.btn_OK.Location = new System.Drawing.Point(83, 167);
80
+            this.btn_OK.Margin = new System.Windows.Forms.Padding(4);
81
+            this.btn_OK.Name = "btn_OK";
82
+            this.btn_OK.Size = new System.Drawing.Size(100, 29);
83
+            this.btn_OK.TabIndex = 54;
84
+            this.btn_OK.Text = "确 定";
85
+            this.btn_OK.UseVisualStyleBackColor = true;
86
+            this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
87
+            // 
88
+            // comboBox_jqx
89
+            // 
90
+            this.comboBox_jqx.FormattingEnabled = true;
91
+            this.comboBox_jqx.Location = new System.Drawing.Point(186, 77);
92
+            this.comboBox_jqx.Name = "comboBox_jqx";
93
+            this.comboBox_jqx.Size = new System.Drawing.Size(160, 23);
94
+            this.comboBox_jqx.TabIndex = 59;
95
+            // 
96
+            // label2
97
+            // 
98
+            this.label2.AutoSize = true;
99
+            this.label2.Location = new System.Drawing.Point(83, 80);
100
+            this.label2.Name = "label2";
101
+            this.label2.Size = new System.Drawing.Size(97, 15);
102
+            this.label2.TabIndex = 58;
103
+            this.label2.Text = "计曲线图层:";
104
+            // 
105
+            // comboBox_sqx
106
+            // 
107
+            this.comboBox_sqx.FormattingEnabled = true;
108
+            this.comboBox_sqx.Location = new System.Drawing.Point(186, 123);
109
+            this.comboBox_sqx.Name = "comboBox_sqx";
110
+            this.comboBox_sqx.Size = new System.Drawing.Size(160, 23);
111
+            this.comboBox_sqx.TabIndex = 61;
112
+            // 
113
+            // label1
114
+            // 
115
+            this.label1.AutoSize = true;
116
+            this.label1.Location = new System.Drawing.Point(83, 126);
117
+            this.label1.Name = "label1";
118
+            this.label1.Size = new System.Drawing.Size(97, 15);
119
+            this.label1.TabIndex = 60;
120
+            this.label1.Text = "首曲线图层:";
121
+            // 
122
+            // Conn
123
+            // 
124
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
125
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
126
+            this.ClientSize = new System.Drawing.Size(432, 223);
127
+            this.Controls.Add(this.comboBox_sqx);
128
+            this.Controls.Add(this.label1);
129
+            this.Controls.Add(this.comboBox_jqx);
130
+            this.Controls.Add(this.label2);
131
+            this.Controls.Add(this.btn_Cancel);
132
+            this.Controls.Add(this.btn_OK);
133
+            this.Controls.Add(this.comboBox_blc);
134
+            this.Controls.Add(this.label_Blc);
135
+            this.Name = "Conn";
136
+            this.Text = "线相交检查";
137
+            this.Load += new System.EventHandler(this.Conn_Load);
138
+            this.ResumeLayout(false);
139
+            this.PerformLayout();
140
+
141
+        }
142
+
143
+        #endregion
144
+
145
+        private System.Windows.Forms.ComboBox comboBox_blc;
146
+        private System.Windows.Forms.Label label_Blc;
147
+        private System.Windows.Forms.Button btn_Cancel;
148
+        private System.Windows.Forms.Button btn_OK;
149
+        private System.Windows.Forms.ComboBox comboBox_jqx;
150
+        private System.Windows.Forms.Label label2;
151
+        private System.Windows.Forms.ComboBox comboBox_sqx;
152
+        private System.Windows.Forms.Label label1;
153
+    }
154
+}

+ 113
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.cs 查看文件

@@ -0,0 +1,113 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class Conn : Form
15
+    {
16
+        public Conn()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void Conn_Load(object sender, EventArgs e)
22
+        {
23
+            if (MainClass.Flag == "SelfIntersect")
24
+            {
25
+                this.Text = "线自相交";
26
+            }
27
+            if (MainClass.Flag == "EachIntersect")
28
+            {
29
+                this.Text = "线相交";
30
+            }
31
+
32
+            this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList;
33
+            this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList;
34
+
35
+            //自动填充下拉框
36
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
37
+            using (Transaction traction = database.TransactionManager.StartTransaction())
38
+            {
39
+                //存放所有图层名
40
+                List<string> alllayername = new List<string>();
41
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
42
+                foreach (ObjectId objid in layertable)
43
+                {
44
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
45
+                    alllayername.Add(layertablerecord.Name);
46
+                }
47
+
48
+                alllayername.Sort();
49
+
50
+                for (int i = 0; i < alllayername.Count; i++)
51
+                {
52
+                    this.comboBox_jqx.Items.Add(alllayername[i]);
53
+                    this.comboBox_sqx.Items.Add(alllayername[i]);
54
+                }
55
+
56
+                if (alllayername.Contains("8110"))
57
+                {
58
+                    int index = alllayername.IndexOf("8110");
59
+                    this.comboBox_sqx.SelectedIndex = index;
60
+                }
61
+                if (alllayername.Contains("8120"))
62
+                {
63
+                    int index = alllayername.IndexOf("8120");
64
+                    this.comboBox_jqx.SelectedIndex = index;
65
+                }
66
+                traction.Commit();
67
+            }
68
+        }
69
+
70
+        private void btn_OK_Click(object sender, EventArgs e)
71
+        {
72
+            if (MainClass.Flag == "SelfIntersect")
73
+            {
74
+                if (comboBox_blc.Text == "")
75
+                {
76
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
77
+                    return;
78
+                }
79
+
80
+                //比例尺
81
+                string blctext = comboBox_blc.Text;
82
+                int blcindex = blctext.LastIndexOf(':');
83
+                string strblc = blctext.Substring(blcindex + 1);
84
+                Inters.blc = Convert.ToInt32(strblc);
85
+                Inters.jqx = comboBox_jqx.Text;
86
+                Inters.sqx = comboBox_sqx.Text;
87
+
88
+                this.Close();
89
+                Inters selfints = new Inters();
90
+                selfints.SelfInts();
91
+            }
92
+
93
+            if (MainClass.Flag == "EachIntersect")
94
+            {
95
+                if (comboBox_blc.Text == "")
96
+                {
97
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
98
+                    return;
99
+                }
100
+
101
+                //比例尺
102
+                string blctext = comboBox_blc.Text;
103
+                int blcindex = blctext.LastIndexOf(':');
104
+                string strblc = blctext.Substring(blcindex + 1);
105
+                Inters.blc = Convert.ToInt32(strblc);
106
+
107
+                this.Close();
108
+                Inters eachints = new Inters();
109
+                eachints.Ints();
110
+            }
111
+        }
112
+    }
113
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 479
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Connect.cs 查看文件

@@ -0,0 +1,479 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+using GrxCAD.DatabaseServices;
8
+using GrxCAD.Geometry;
9
+using GrxCAD.ApplicationServices;
10
+using GrxCAD.EditorInput;
11
+using System.Windows.Forms;
12
+
13
+namespace HCTools
14
+{
15
+    class Connect
16
+    {
17
+        Point3dCollection joinpoint = new Point3dCollection();//连接点
18
+
19
+        #region 连接
20
+        /// <summary>
21
+        /// 连接线
22
+        /// </summary>
23
+        public void joinplline()
24
+        {
25
+            ObjectId[] line = BasicFunction.getPll();//获取待连接线
26
+            if (line == null)
27
+                return;
28
+
29
+            //遍历比较待连接线,连接高程相同的两等高线
30
+            Database db = HostApplicationServices.WorkingDatabase;
31
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
32
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
33
+
34
+            using (Transaction trans = db.TransactionManager.StartTransaction())
35
+            {
36
+                if (line.Length == 1)
37
+                {
38
+                    ed.WriteMessage("请选择另一条连接线");
39
+                    return;
40
+                }
41
+
42
+                try
43
+                {
44
+                    Entity entity1 = line[0].GetObject(OpenMode.ForWrite)as Entity;
45
+                    Entity entity2 = line[1].GetObject(OpenMode.ForWrite) as Entity;
46
+                    if (entity1 is Polyline2d && entity2 is Polyline)
47
+                    {
48
+                        Polyline2d pll1 = (Polyline2d)entity1;
49
+                        Polyline pll2 = (Polyline)trans.GetObject(entity2.Id, OpenMode.ForWrite);
50
+                        pll2.Elevation = pll1.Elevation;
51
+                        Calculate(pll1.StartPoint, pll1.EndPoint, pll2.StartPoint, pll2.EndPoint);
52
+                        Polyline pline = new Polyline();
53
+                        pline.AddVertexAt(0, new Point2d(joinpoint[0].X, joinpoint[0].Y), 0, 0, 0);
54
+                        pline.AddVertexAt(1, new Point2d(joinpoint[1].X, joinpoint[1].Y), 0, 0, 0);//创建连接线
55
+
56
+                        if (pll2.Elevation == pll1.Elevation)
57
+                        {
58
+                            //pll1.JoinEntity(pline);//浩辰的JoinEntity函数会报enotemplementedyet,不知道原因。
59
+                            Polyline pll_temp = PllConn(pll2, pline);
60
+                            //pll1.JoinEntity(pll2);
61
+                            Polyline pll_final = Pllpll2d(pll_temp, pll1, trans);
62
+                            pll1.Erase();
63
+                            pll2.Erase();
64
+                            BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
65
+                            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
66
+                            btr.AppendEntity(pll_final);
67
+                            trans.AddNewlyCreatedDBObject(pll_final, true);
68
+                        }
69
+                        else
70
+                            MessageBox.Show("两线高程不一致!", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
71
+                    }
72
+                    else if (entity1 is Polyline && entity2 is Polyline2d)
73
+                    {
74
+                        Polyline pll1 = (Polyline)entity1;
75
+                        Polyline2d pll2 = (Polyline2d)entity2;
76
+                        Calculate(pll1.StartPoint, pll1.EndPoint, pll2.StartPoint, pll2.EndPoint);
77
+                        Polyline pline = new Polyline();
78
+                        pline.AddVertexAt(0, new Point2d(joinpoint[0].X, joinpoint[0].Y), 0, 0, 0);
79
+                        pline.AddVertexAt(1, new Point2d(joinpoint[1].X, joinpoint[1].Y), 0, 0, 0);//创建连接线
80
+
81
+                        if (pll2.Elevation == pll1.Elevation)
82
+                        {
83
+                            //pll1.JoinEntity(pline);//浩辰的JoinEntity函数会报enotemplementedyet,不知道原因。
84
+                            Polyline pll_temp = PllConn(pll1,pline);
85
+                            //pll1.JoinEntity(pll2);
86
+                            Polyline pll_final = Pllpll2d(pll_temp, pll2, trans);
87
+                            pll1.Erase();
88
+                            pll2.Erase();
89
+                            BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
90
+                            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
91
+                            btr.AppendEntity(pll_final);
92
+                            trans.AddNewlyCreatedDBObject(pll_final, true);
93
+                        }
94
+                        else
95
+                            MessageBox.Show("两线高程不一致!", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
96
+                    }
97
+                    else if (entity1 is Polyline2d && entity2 is Polyline2d)
98
+                    {
99
+                        Polyline2d pll1 = (Polyline2d)entity1;
100
+                        Polyline2d pll2 = (Polyline2d)entity2;
101
+                        Calculate(pll1.StartPoint, pll1.EndPoint, pll2.StartPoint, pll2.EndPoint);
102
+                        Point3dCollection pos = new Point3dCollection{joinpoint[0], joinpoint[1]};
103
+                        DoubleCollection doubles = new DoubleCollection{0,0,0,0};
104
+                        Polyline2d pline = new Polyline2d(Poly2dType.SimplePoly, pos, 0, false, 0, 0, doubles);
105
+                        BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
106
+                        BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
107
+                        btr.AppendEntity(pline);
108
+                        trans.AddNewlyCreatedDBObject(pline, true);
109
+                        //pline.AddVertexAt(0, new Point2d(joinpoint[0].X, joinpoint[0].Y), 0, 0, 0);
110
+                        //pline.AddVertexAt(1, new Point2d(joinpoint[1].X, joinpoint[1].Y), 0, 0, 0);//创建连接线
111
+
112
+                        if (pll2.Elevation == pll1.Elevation)
113
+                        {
114
+                            Polyline2d pll_temp = Pll2dConn(pll1, pline,trans);
115
+                            btr.AppendEntity(pll_temp);
116
+                            trans.AddNewlyCreatedDBObject(pll_temp, true);
117
+                            //pll1.JoinEntity(pline);
118
+                            //pll1.JoinEntity(pll2);
119
+                            Polyline2d pll_final = Pll2dConn(pll_temp, pll2,trans);
120
+                            pll1.Erase();
121
+                            pline.Erase();
122
+                            pll2.Erase();
123
+                            pll_temp.Erase();
124
+                            btr.AppendEntity(pll_final);
125
+                            trans.AddNewlyCreatedDBObject(pll_final, true);
126
+                        }
127
+                        else
128
+                            MessageBox.Show("两线高程不一致!", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
129
+                    }
130
+                    else
131
+                    {
132
+                        Polyline pll1 = (Polyline)entity1;
133
+                        Polyline pll2 = (Polyline)entity2;
134
+                        Calculate(pll1.StartPoint, pll1.EndPoint, pll2.StartPoint, pll2.EndPoint);
135
+                        Polyline pline = new Polyline();
136
+                        pline.AddVertexAt(0, new Point2d(joinpoint[0].X, joinpoint[0].Y), 0, 0, 0);
137
+                        pline.AddVertexAt(1, new Point2d(joinpoint[1].X, joinpoint[1].Y), 0, 0, 0);//创建连接线
138
+
139
+                        if (pll2.Elevation == pll1.Elevation)
140
+                        {
141
+                            //pll1.JoinEntity(pline);//浩辰的JoinEntity函数会报enotemplementedyet,不知道原因。
142
+                            Polyline pll_temp = PllConn(pll1, pline);
143
+                            //pll1.JoinEntity(pll2);
144
+                            Polyline pll_final = PllConn(pll_temp, pll2);
145
+                            pll1.Erase();
146
+                            pll2.Erase();
147
+                            BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
148
+                            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
149
+                            btr.AppendEntity(pll_final);
150
+                            trans.AddNewlyCreatedDBObject(pll_final, true);
151
+                        }
152
+                        else
153
+                            MessageBox.Show("两线高程不一致!", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
154
+                    }
155
+                    trans.Commit();
156
+                }
157
+
158
+
159
+                catch (GrxCAD.Runtime.Exception ex)
160
+                {
161
+                    string str = ex.ToString();
162
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog(str);
163
+                }
164
+            }
165
+        }
166
+
167
+
168
+        /// <summary>
169
+        /// 计算获得连接点
170
+        /// </summary>
171
+        private Point3dCollection Calculate(Point3d startpt1, Point3d endpt1, Point3d startpt2, Point3d endpt2)
172
+        {
173
+            Double[] distance=new Double[4];
174
+            joinpoint.Clear();
175
+            int i = 0;
176
+
177
+            //两线段四个端点之间的距离
178
+            distance[0] = Math.Sqrt(Math.Pow((startpt1.X - startpt2.X), 2) + Math.Pow((startpt1.Y - startpt2.Y), 2));
179
+            distance[1] = Math.Sqrt(Math.Pow((startpt1.X - endpt2.X), 2) + Math.Pow((startpt1.Y - endpt2.Y), 2));
180
+            distance[2] = Math.Sqrt(Math.Pow((endpt1.X - startpt2.X), 2) + Math.Pow((endpt1.Y - startpt2.Y), 2));
181
+            distance[3] = Math.Sqrt(Math.Pow((endpt1.X - endpt2.X), 2) + Math.Pow((endpt1.Y - endpt2.Y), 2));
182
+
183
+            //比较获取最小的距离,得到连接点
184
+            for (i = 0; i < distance.Length; i++)
185
+            {
186
+                if (distance[i] == distance.Min())
187
+                    break;
188
+            }
189
+            switch (i.ToString())
190
+            {
191
+                case "0":
192
+                    joinpoint.Add(startpt1);
193
+                    joinpoint.Add(startpt2);
194
+                    break;
195
+
196
+                case "1":
197
+                    joinpoint.Add(startpt1);
198
+                    joinpoint.Add(endpt2);
199
+                    break;
200
+
201
+                case "2":
202
+                    joinpoint.Add(endpt1);
203
+                    joinpoint.Add(startpt2);
204
+                    break;
205
+
206
+                case "3":
207
+                    joinpoint.Add(endpt1);
208
+                    joinpoint.Add(endpt2);
209
+                    break;
210
+            }
211
+            return joinpoint;
212
+        }
213
+
214
+        /// <summary>
215
+        /// 连接两条线(两条都是Polyline)
216
+        /// </summary>
217
+        private Polyline PllConn(Polyline pll1, Polyline pll2)
218
+        {
219
+            List<Point2d> pllpt = new List<Point2d>();
220
+            List<Point2d> pll1pt = new List<Point2d>();
221
+            for (int i = 0; i < pll1.NumberOfVertices; i++)
222
+            {
223
+                pllpt.Add(pll1.GetPoint2dAt(i));
224
+            }
225
+            for (int i = 0; i < pll2.NumberOfVertices; i++)
226
+            {
227
+                pll1pt.Add(pll2.GetPoint2dAt(i));
228
+            }
229
+            //if (pllpt[pllpt.Count - 1] != pll1pt[pll1pt.Count - 1])
230
+            //    pllpt.Reverse();
231
+            //else if (pllpt[0] != pll1pt[0])
232
+            //    pll1pt.Reverse();
233
+            if (pllpt[pllpt.Count - 1] == pll1pt[pll1pt.Count - 1])
234
+                pll1pt.Reverse();
235
+            else if (pllpt[0] == pll1pt[pll1pt.Count - 1])
236
+            {
237
+                pllpt.Reverse();
238
+                pll1pt.Reverse();
239
+            }
240
+            else if (pllpt[0] == pll1pt[0])
241
+                pllpt.Reverse();
242
+                for (int i = 0; i < pll1pt.Count; i++)
243
+            {
244
+                if (pllpt.Contains(pll1pt[i]))
245
+                    continue;
246
+                else
247
+                    pllpt.Add(pll1pt[i]);
248
+            }
249
+            Polyline pline = new Polyline();
250
+            for (int i = 0; i < pllpt.Count; i++)
251
+            {
252
+                pline.AddVertexAt(i, new Point2d(pllpt[i].X, pllpt[i].Y), 0, 0, 0);
253
+            }
254
+            pline.Elevation = pll1.Elevation;
255
+            pline.LinetypeId = pll1.LinetypeId;
256
+            pline.Color = pll1.Color;
257
+            pline.Layer = pll1.Layer;
258
+            return pline;
259
+        }
260
+
261
+
262
+        /// <summary>
263
+        /// 连接两条线(两条都是Polyline2d)
264
+        /// </summary>
265
+        private Polyline2d Pll2dConn(Polyline2d pll1, Polyline2d pll2, Transaction tr)
266
+        {
267
+            List<Point3d> pllpt = new List<Point3d>();
268
+            List<Point3d> pll1pt = new List<Point3d>();
269
+            List<double> bulgeList = new List<double>();//存凸度
270
+            List<double> bulgeList1 = new List<double>();
271
+            Point3dCollection ptcoll = new Point3dCollection();
272
+            DoubleCollection dbcoll = new DoubleCollection();
273
+            foreach(ObjectId id in pll1)
274
+            {
275
+                Vertex2d vx = (Vertex2d)tr.GetObject(id, OpenMode.ForRead);
276
+                if (vx.VertexType != Vertex2dType.SplineControlVertex)
277
+                { 
278
+                    pllpt.Add(vx.Position);
279
+                    bulgeList.Add(vx.Bulge);
280
+                }
281
+            }
282
+            foreach (ObjectId id in pll2)
283
+            {
284
+                Vertex2d vx = (Vertex2d)tr.GetObject(id, OpenMode.ForRead);
285
+                if (vx.VertexType != Vertex2dType.SplineControlVertex)
286
+                {
287
+                    pll1pt.Add(vx.Position);
288
+                    bulgeList1.Add(vx.Bulge);
289
+                }
290
+            }
291
+            //if (pllpt[pllpt.Count - 1] != pll1pt[pll1pt.Count - 1])
292
+            //{
293
+            //    pllpt.Reverse();
294
+            //    bulgeList.Reverse();
295
+            //}
296
+            //else if (pllpt[0] != pll1pt[0])
297
+            //{ 
298
+            //    pll1pt.Reverse();
299
+            //    bulgeList1.Reverse();
300
+            //}
301
+            if (pllpt[pllpt.Count - 1] == pll1pt[pll1pt.Count - 1])
302
+            { 
303
+                pll1pt.Reverse();
304
+                bulgeList1.Reverse();
305
+            }
306
+            else if (pllpt[0] == pll1pt[pll1pt.Count - 1])
307
+            {
308
+                pllpt.Reverse();
309
+                pll1pt.Reverse();
310
+                bulgeList.Reverse();
311
+                bulgeList1.Reverse();
312
+            }
313
+            else if (pllpt[0] == pll1pt[0])
314
+            { 
315
+                pllpt.Reverse();
316
+                bulgeList1.Reverse();
317
+            }
318
+            for (int i = 0; i < pll1pt.Count; i++)
319
+            {
320
+                if (pllpt.Contains(pll1pt[i]))
321
+                    continue;
322
+                else
323
+                { 
324
+                    pllpt.Add(pll1pt[i]);
325
+                    bulgeList.Add(bulgeList1[i]);
326
+                }
327
+            }
328
+            for (int i = 0; i < pllpt.Count; i++)
329
+            {
330
+                ptcoll.Add(pllpt[i]);
331
+            }
332
+            for (int i = 0; i < bulgeList.Count; i++)
333
+            {
334
+                dbcoll.Add(bulgeList[i]);
335
+            }
336
+            Polyline2d pline = new Polyline2d(pll1.PolyType, ptcoll, 0, false, 0, 0, dbcoll);
337
+            pline.Elevation = pll1.Elevation;
338
+            pline.LinetypeId = pll1.LinetypeId;
339
+            pline.Color = pll1.Color;
340
+            pline.Layer = pll1.Layer;
341
+            return pline;
342
+        }
343
+
344
+
345
+        /// <summary>
346
+        /// 连接两条线(一条是Polyline,一条是Polyline2d,连接后的线为Polyline)
347
+        /// </summary>
348
+        private Polyline Pllpll2d(Polyline pll1, Polyline2d pll2, Transaction tr)
349
+        {
350
+            List<Point3d> pllpt = new List<Point3d>();
351
+            List<Point3d> pll1pt = new List<Point3d>();
352
+            for (int i = 0; i < pll1.NumberOfVertices; i++)
353
+            {
354
+                pllpt.Add(pll1.GetPoint3dAt(i));
355
+            }
356
+            foreach (ObjectId id in pll2)
357
+            {
358
+                Vertex2d vx = (Vertex2d)tr.GetObject(id, OpenMode.ForRead);
359
+                if (vx.VertexType != Vertex2dType.SplineControlVertex)
360
+                {
361
+                    pll1pt.Add(vx.Position);
362
+                }
363
+            }
364
+            //if (pllpt[pllpt.Count - 1] != pll1pt[pll1pt.Count - 1])
365
+            //    pllpt.Reverse();
366
+            //else if (pllpt[0] != pll1pt[0])
367
+            //    pll1pt.Reverse();
368
+            if (pllpt[pllpt.Count - 1] == pll1pt[pll1pt.Count - 1])
369
+                pll1pt.Reverse();
370
+            else if (pllpt[0] == pll1pt[pll1pt.Count - 1])
371
+            {
372
+                pllpt.Reverse();
373
+                pll1pt.Reverse();
374
+            }
375
+            else if (pllpt[0] == pll1pt[0])
376
+                pllpt.Reverse();
377
+            for (int i = 0; i < pll1pt.Count; i++)
378
+            {
379
+                if (pllpt.Contains(pll1pt[i]))
380
+                    continue;
381
+                else
382
+                    pllpt.Add(pll1pt[i]);
383
+            }
384
+            Polyline pline = new Polyline();
385
+            for (int i = 0; i < pllpt.Count; i++)
386
+            {
387
+                pline.AddVertexAt(i, new Point2d(pllpt[i].X, pllpt[i].Y), 0, 0, 0);
388
+            }
389
+            pline.Elevation = pll1.Elevation;
390
+            pline.LinetypeId = pll1.LinetypeId;
391
+            pline.Color = pll1.Color;
392
+            pline.Layer = pll1.Layer;
393
+            return pline;
394
+        }
395
+
396
+        #endregion
397
+
398
+
399
+        //public void conn()
400
+        //{
401
+        //    ObjectIdCollection ids = getEntity();
402
+        //    BlockReference br = null;
403
+        //    Polyline pll = null;
404
+        //    DBObjectCollection objcoll = new DBObjectCollection();
405
+        //    string Brname = "";
406
+        //    Point3d Brposition = new Point3d();
407
+
408
+        //    Database db = HostApplicationServices.WorkingDatabase;
409
+        //    DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
410
+        //    Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
411
+        //    using (Transaction trans = db.TransactionManager.StartTransaction())
412
+        //    {
413
+        //        foreach(ObjectId id in ids)
414
+        //        {
415
+        //            if (trans.GetObject(id, OpenMode.ForRead) is BlockReference)
416
+        //            {
417
+        //                br = trans.GetObject(id, OpenMode.ForRead)as BlockReference;
418
+        //                Brname = br.Name;
419
+        //                Brposition = br.Position;
420
+        //            }
421
+        //            if (trans.GetObject(id, OpenMode.ForRead) is Polyline)
422
+        //            {
423
+        //                pll = trans.GetObject(id, OpenMode.ForRead) as Polyline;
424
+        //            }
425
+        //        }
426
+        //        br.Explode(objcoll);
427
+        //        trans.Commit();
428
+        //    }
429
+
430
+        //    foreach (Entity ent in objcoll)
431
+        //    {
432
+        //        using (Transaction trans = db.TransactionManager.StartTransaction())
433
+        //        {
434
+        //            BlockTable blocktable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite) as BlockTable;
435
+        //            BlockTableRecord blocktablerecord = trans.GetObject(blocktable[BlockTableRecord.ModelSpace],
436
+        //                OpenMode.ForWrite) as BlockTableRecord;
437
+        //            blocktablerecord.AppendEntity(ent);
438
+        //            trans.AddNewlyCreatedDBObject(ent, true);
439
+        //            trans.Commit();
440
+        //        }
441
+        //    }
442
+
443
+
444
+        //    doclock.Dispose();
445
+        //}
446
+
447
+
448
+        //private static ObjectIdCollection getEntity()
449
+        //{
450
+        //    ObjectIdCollection ids = new ObjectIdCollection();
451
+
452
+        //    Document doc = Application.DocumentManager.MdiActiveDocument;
453
+        //    Database db = doc.Database;
454
+        //    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
455
+
456
+        //    TypedValue[] value = new TypedValue[]
457
+        //    {
458
+        //        new TypedValue((int)DxfCode.Start,"Insert,POLYLINE"),
459
+        //    };//设置筛选条件
460
+        //    SelectionFilter filter = new SelectionFilter(value);
461
+        //    //选择区域中全部对象
462
+        //    //PromptSelectionResult psr = ed.SelectAll(filter);
463
+        //    // 要求在图形区域中手动选择对象
464
+        //    PromptSelectionResult psr = ed.GetSelection(filter);
465
+
466
+
467
+        //    if (psr.Status == PromptStatus.OK)
468
+        //    {
469
+        //        using (Transaction trans = db.TransactionManager.StartTransaction())
470
+        //        {
471
+        //            SelectionSet ss = psr.Value;
472
+        //            ids = new ObjectIdCollection(ss.GetObjectIds());
473
+        //            trans.Commit();
474
+        //        }
475
+        //    }
476
+        //    return ids;
477
+        //}
478
+    }
479
+}

+ 173
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ContourLineFix.cs 查看文件

@@ -0,0 +1,173 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using GrxCAD.GraphicsInterface;
6
+using System;
7
+using System.Collections.Generic;
8
+using System.Linq;
9
+using System.Text;
10
+using System.Threading.Tasks;
11
+
12
+namespace HCTools
13
+{
14
+    class ContourLineFix
15
+    {
16
+        public void Clfix()
17
+        {
18
+            Database db = HostApplicationServices.WorkingDatabase;
19
+            Document doc = Application.DocumentManager.MdiActiveDocument;
20
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
21
+
22
+            ObjectId jigid = new ObjectId();
23
+            PromptPointResult pPtRes;
24
+            PromptPointOptions pPtOpts = new PromptPointOptions("");
25
+
26
+            pPtOpts.Message = "选择起点\n ";
27
+            pPtRes = doc.Editor.GetPoint(pPtOpts);
28
+            Point3d ptStart = pPtRes.Value;
29
+
30
+            if (pPtRes.Status == PromptStatus.OK)
31
+            {
32
+                LineJig lJig = new LineJig(ptStart);
33
+                PromptResult PR = doc.Editor.Drag(lJig);
34
+                if (PR.Status == PromptStatus.OK)
35
+                {
36
+                    jigid = BasicFunction.AddObj(doc, lJig.line_1);
37
+                    GrxCAD.DatabaseServices.Line jigl = (GrxCAD.DatabaseServices.Line)BasicFunction.GetDBObject(jigid);
38
+                    List<ObjectId> plllist = Pllsort(jigl);
39
+                    GrxCAD.DatabaseServices.Polyline pll_s = (GrxCAD.DatabaseServices.Polyline)BasicFunction.GetDBObject(plllist[0]);
40
+                    GrxCAD.DatabaseServices.Polyline pll_w = (GrxCAD.DatabaseServices.Polyline)BasicFunction.GetDBObject(plllist[plllist.Count - 1]);
41
+                    double dgj = (pll_s.Elevation - pll_w.Elevation)/(plllist.Count - 1);
42
+                    double ele = pll_s.Elevation;
43
+                    using (Transaction tr = db.TransactionManager.StartTransaction())
44
+                    {
45
+                        for (int i = 1; i < plllist.Count - 1; i++)
46
+                        {
47
+                            GrxCAD.DatabaseServices.Polyline pll = (GrxCAD.DatabaseServices.Polyline)tr.GetObject(plllist[i], OpenMode.ForWrite, true);
48
+                            pll.Elevation = ele - dgj;
49
+                            ele = ele - dgj;
50
+                        }
51
+                        GrxCAD.DatabaseServices.Line jl = (GrxCAD.DatabaseServices.Line)tr.GetObject(jigid, OpenMode.ForWrite, true);
52
+                        jl.Erase();
53
+                        tr.Commit();
54
+                    }
55
+                    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
56
+                    ed.WriteMessage("修改完成\n");
57
+                }
58
+
59
+            }
60
+            doclock.Dispose();
61
+        }
62
+
63
+
64
+        private static List<ObjectId> Pllsort(Line jigl)
65
+        {
66
+            List<ObjectId> sortedid = new List<ObjectId>();
67
+            Point3dCollection ptcoll = new Point3dCollection();
68
+            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
69
+            ptcoll.Add(jigl.StartPoint);
70
+            ptcoll.Add(jigl.EndPoint);
71
+
72
+            Database db = HostApplicationServices.WorkingDatabase;
73
+            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
74
+            TypedValue[] value = new TypedValue[]
75
+                {
76
+                new TypedValue((int)DxfCode.Start,"LWPOLYLINE"),
77
+                };//设置筛选条件
78
+            SelectionFilter filter = new SelectionFilter(value);
79
+            // 要求在图形区域中手动选择对象
80
+            PromptSelectionResult psr = ed.SelectFence(ptcoll, filter);
81
+
82
+            if (psr.Status == PromptStatus.OK)
83
+            {
84
+                SelectionSet ss = psr.Value;
85
+                ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
86
+
87
+                using (Transaction trans = db.TransactionManager.StartTransaction())
88
+                {
89
+                    for (int i = 1; i < idcoll.Count; i++)
90
+                    {
91
+                        GrxCAD.DatabaseServices.Polyline pll = (GrxCAD.DatabaseServices.Polyline)BasicFunction.GetDBObject(idcoll[i]);
92
+                        Point3dCollection itsresult1 = new Point3dCollection();
93
+                        pll.IntersectWith(jigl, Intersect.OnBothOperands, plane, itsresult1, IntPtr.Zero, IntPtr.Zero);
94
+                        double x1 = itsresult1[0].X;
95
+                        double y1 = itsresult1[0].Y;
96
+                        double x2 = jigl.StartPoint.X;
97
+                        double y2 = jigl.StartPoint.Y;
98
+                        double tempdist = Math.Abs(Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2)));
99
+                        ObjectId temp = idcoll[i];
100
+                        for (int j = i - 1; j >=0; j--)
101
+                        {
102
+                            GrxCAD.DatabaseServices.Polyline pll2 = (GrxCAD.DatabaseServices.Polyline)BasicFunction.GetDBObject(idcoll[j]);
103
+                        Point3dCollection itsresult2 = new Point3dCollection();
104
+                            pll2.IntersectWith(jigl, Intersect.OnBothOperands, plane, itsresult2, IntPtr.Zero, IntPtr.Zero);
105
+                            double x3 = itsresult2[0].X;
106
+                            double y3 = itsresult2[0].Y;
107
+                            double tempdist2 = Math.Abs(Math.Sqrt(Math.Pow(x3 - x2, 2) + Math.Pow(y3 - y2, 2)));
108
+                            if (tempdist < tempdist2)
109
+                            {
110
+                                idcoll[j + 1] = idcoll[j];
111
+                                idcoll[j] = temp;
112
+                            }
113
+                            else
114
+                                break;
115
+                        }
116
+                    }
117
+                    foreach (ObjectId id in idcoll)
118
+                    {
119
+                        sortedid.Add(id);
120
+                    }
121
+                    trans.Commit();
122
+                }
123
+            }
124
+            return sortedid;
125
+        }
126
+    }
127
+
128
+    public class LineJig : DrawJig
129
+    {
130
+        public Line line_1;
131
+        public Point3d BasePnt;
132
+        public Point3d AcquirePnt;
133
+
134
+        public LineJig(Point3d _basePnt)
135
+        {
136
+            line_1 = new Line();
137
+
138
+            BasePnt = _basePnt;
139
+        }
140
+
141
+        protected override SamplerStatus Sampler(JigPrompts prompts)
142
+        {
143
+            JigPromptPointOptions JPPO = new JigPromptPointOptions();
144
+            JPPO.Message = "选择终点\n";
145
+            JPPO.UserInputControls = (UserInputControls.Accept3dCoordinates | UserInputControls.NullResponseAccepted | UserInputControls.AnyBlankTerminatesInput);
146
+
147
+            PromptPointResult PR = prompts.AcquirePoint(JPPO);
148
+
149
+            if (PR.Status != PromptStatus.OK)
150
+                return SamplerStatus.Cancel;
151
+
152
+            if (PR.Value == AcquirePnt)
153
+                return SamplerStatus.NoChange;
154
+
155
+            AcquirePnt = PR.Value;
156
+            return SamplerStatus.OK;
157
+        }
158
+
159
+        protected override bool WorldDraw(WorldDraw draw)
160
+        {
161
+            Point3d point_1 = new Point3d(BasePnt.X, BasePnt.Y, 0);
162
+            Point3d point_2 = new Point3d(AcquirePnt.X, AcquirePnt.Y, 0);
163
+            line_1.StartPoint = point_1;
164
+            line_1.EndPoint = point_2;
165
+            line_1.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 7);
166
+
167
+            draw.Geometry.Draw(line_1);
168
+            return true;
169
+        }
170
+    }
171
+}
172
+
173
+

+ 856
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutContourLine.cs 查看文件

@@ -0,0 +1,856 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    class CutContourLine
15
+    {
16
+        public static string sqxlayer;
17
+        public static string jqxlayer;
18
+        public static int mapscale;
19
+        public static double scalelen;
20
+        public static double lenIgnore;
21
+        public static double eledvalue;
22
+        public void ccls()
23
+        {
24
+            DocumentLock documentlock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
25
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
26
+            Database db = doc.Database;
27
+            //类全局变量
28
+            //存储地图图层
29
+            //System.Collections.ArrayList layerlist = new System.Collections.ArrayList();
30
+            LayerTable layertable = null;
31
+            bool openflag = true;
32
+            List<Entity> plentitycollection = new List<Entity>();
33
+            List<Entity> plentitycollection1 = new List<Entity>();
34
+            //保存裁剪掉的等高线
35
+            List<Entity> cdentity = new List<Entity>();
36
+
37
+
38
+            #region//第一个事务 获取计曲线
39
+            using (Transaction tran = doc.TransactionManager.StartTransaction())
40
+            {
41
+                
42
+                //layertable = tran.GetObject(db.LayerTableId, OpenMode.ForRead) as LayerTable;
43
+                ////获取图层
44
+                //foreach (ObjectId id in layertable)
45
+                //{
46
+                //    DocumentLock docLock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
47
+                //    LayerTableRecord lyrtbrec = tran.GetObject(id, OpenMode.ForWrite) as LayerTableRecord;
48
+                //    docLock.Dispose();
49
+                //    layerlist.Add(lyrtbrec.Name);
50
+                    
51
+                //}
52
+
53
+                //CLSelectForm clsf = new CLSelectForm(layerlist);
54
+                //if (clsf.ShowDialog() == DialogResult.OK)
55
+                //{
56
+                //    openflag = true;
57
+                //    mapscale = clsf.mapscale;
58
+                //    sqxlayer = clsf.SQX;
59
+                //    jqxlayer = clsf.JQX;
60
+                //    scalelen = clsf.ScaleLength;
61
+                //    lenIgnore = clsf.LenIgnore;
62
+                //    eledvalue = clsf.EleDValue;
63
+                //}
64
+
65
+
66
+                if (openflag == true)
67
+                {
68
+                    ///带1的为首曲线过滤,没有的是计曲线过滤
69
+                    TypedValue[] tv = new TypedValue[1];
70
+                    TypedValue[] tv1 = new TypedValue[1];
71
+                    tv.SetValue(new TypedValue((int)DxfCode.LayerName, jqxlayer), 0);
72
+                    tv1.SetValue(new TypedValue((int)DxfCode.LayerName, sqxlayer), 0);
73
+                    SelectionFilter sf = new SelectionFilter(tv);
74
+                    SelectionFilter sf1 = new SelectionFilter(tv1);
75
+                    //doc.Editor.WriteMessage("请选择计曲线!");
76
+
77
+                    //PromptSelectionResult psr = doc.Editor.GetSelection(sf);
78
+                    PromptSelectionResult psr = doc.Editor.SelectAll(sf);
79
+                    PromptSelectionResult psr1 = doc.Editor.SelectAll(sf1);
80
+
81
+                    if (psr.Status == PromptStatus.OK && psr1.Status == PromptStatus.OK)
82
+                    {
83
+                        //// 以只读方式打开块表记录   Open the Block table record for read
84
+                        BlockTable acbt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
85
+                        //// 以写方式打开模型空间块表记录   Open the Block table record Model space for write
86
+                        BlockTableRecord acblr = tran.GetObject(acbt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
87
+                        SelectionSet ss = psr.Value;
88
+                        //// 以只读方式打开块表记录   Open the Block table record for read
89
+                        SelectionSet ss1 = psr1.Value;
90
+
91
+
92
+                        foreach (ObjectId idpl in ss.GetObjectIds())
93
+                        {
94
+                            Entity enpl = tran.GetObject(idpl, OpenMode.ForWrite, true) as Entity;
95
+                            if (enpl is Polyline)
96
+                            {
97
+                                Polyline pl = enpl as Polyline;
98
+                                if (pl.Elevation != 0)
99
+                                {
100
+                                    plentitycollection.Add(enpl);
101
+                                }
102
+                            }
103
+                            else if (enpl is Polyline2d)
104
+                            {
105
+                                Polyline2d pl2d = enpl as Polyline2d;
106
+                                if (pl2d.Elevation != 0)
107
+                                {
108
+                                    plentitycollection.Add(enpl);
109
+                                }
110
+                            }
111
+                        }
112
+                        foreach (ObjectId idp2 in ss1.GetObjectIds())
113
+                        {
114
+                            Entity enp2 = tran.GetObject(idp2, OpenMode.ForWrite, true) as Entity;
115
+                            if (enp2 is Polyline)
116
+                            {
117
+                                Polyline pl = enp2 as Polyline;
118
+                                if (pl.Elevation != 0)
119
+                                {
120
+                                    plentitycollection1.Add(enp2);
121
+                                }
122
+                            }
123
+                            else if (enp2 is Polyline2d)
124
+                            {
125
+                                Polyline2d pl2d = enp2 as Polyline2d;
126
+                                if (pl2d.Elevation != 0)
127
+                                {
128
+                                    plentitycollection1.Add(enp2);
129
+                                }
130
+                            }
131
+                        }
132
+                    }
133
+                    else
134
+                        doc.Editor.WriteMessage("没有选择到任何实体\r\n");
135
+                    //////////////////////////////这个气死我了 
136
+
137
+                    doc.Editor.WriteMessage("程序开始运行\r\n.........\r\n......\r\n...\r\n");
138
+                    tran.Commit();
139
+                    tran.Dispose();
140
+                }
141
+                else
142
+                {
143
+                    MessageBox.Show("请选择相应的每一个参数!", "警告");
144
+                    return;
145
+
146
+                }
147
+            }//end using
148
+            #endregion
149
+
150
+            #region//检查、裁剪等高线
151
+            if (plentitycollection.Count > 0)
152
+            {
153
+                //根据高程将计曲线排序
154
+                plentitycollection.Sort(CompareDGXByElevation);
155
+                //删除重叠,重复的等高线
156
+                //int count = RemoveOverlapPolyline(ref plentitycollection);
157
+
158
+                ////////////////////方便调试 仅此而已
159
+                //List<Polyline2d> test = new List<Polyline2d>();
160
+                //foreach (Entity en in plentitycollection)
161
+                //{
162
+                //    Polyline2d pl = en as Polyline2d;
163
+                //    if (pl != null)
164
+                //        test.Add(pl);
165
+                //}
166
+
167
+                //List<Polyline> test00 = new List<Polyline>();
168
+                //foreach (Entity en in plentitycollection)
169
+                //{
170
+                //    Polyline pl = en as Polyline;
171
+                //    if (pl != null)
172
+                //        test00.Add(pl);
173
+                //}
174
+                ///////////////////
175
+
176
+
177
+
178
+                //以每条计曲线为循环变量
179
+                for (int i = 0; i < plentitycollection.Count - 1; i++)
180
+                {
181
+                    Point3dCollection pt3dcoll = new Point3dCollection();
182
+
183
+                    Entity en1 = plentitycollection[i];
184
+                    double ele1 = 0;
185
+                    Point2d pten1start = new Point2d();//
186
+                    Point2d pten1end = new Point2d();//
187
+
188
+                    if (en1 is Polyline)
189
+                    {
190
+                        Polyline pl = en1 as Polyline;
191
+                        pten1start = new Point2d(pl.StartPoint.X, pl.StartPoint.Y);
192
+                        pten1end = new Point2d(pl.EndPoint.X, pl.EndPoint.Y);
193
+
194
+                        ele1 = Convert.ToDouble(pl.Elevation.ToString("f1"));
195
+                        pl.GetStretchPoints(pt3dcoll);
196
+                    }
197
+                    else if (en1 is Polyline2d)
198
+                    {
199
+                        Polyline2d pl2d = en1 as Polyline2d;
200
+                        pten1start = new Point2d(pl2d.StartPoint.X, pl2d.StartPoint.Y);
201
+                        pten1end = new Point2d(pl2d.EndPoint.X, pl2d.EndPoint.Y);
202
+
203
+                        ele1 = Convert.ToDouble(pl2d.Elevation.ToString("f1"));
204
+                        pl2d.GetStretchPoints(pt3dcoll);
205
+                    }
206
+
207
+                    int j = 1;
208
+                    Entity en2 = null;
209
+                    double ele2 = 0, ele = 0;
210
+                    Point2d pten2start = new Point2d();
211
+                    Point2d pten2end = new Point2d();
212
+
213
+                    double startlength = 9999999, endlength = 9999999;
214
+
215
+                    //寻找一条等高线(计曲线)相邻的等高线
216
+                    while (ele <= ele1 + eledvalue)
217
+                    {
218
+                        Entity entemp = plentitycollection[j];
219
+                        if (entemp is Polyline)
220
+                        {
221
+                            Polyline pl = entemp as Polyline;
222
+                            ele = Convert.ToDouble(pl.Elevation.ToString("f1"));
223
+
224
+                            if (ele == ele1 + eledvalue)
225
+                            {
226
+                                pten2start = new Point2d(pl.StartPoint.X, pl.StartPoint.Y);
227
+                                pten2end = new Point2d(pl.EndPoint.X, pl.EndPoint.Y);
228
+
229
+                                double start = pten1start.GetDistanceTo(pten2start);
230
+                                double end = pten1end.GetDistanceTo(pten2end);
231
+
232
+                                //这段代码主要解决相邻有多条等高线时选择距离最近的
233
+                                if (startlength > start && endlength > end)
234
+                                {
235
+                                    startlength = start;
236
+                                    endlength = end;
237
+
238
+                                    en2 = entemp;
239
+                                    ele2 = ele;
240
+                                }
241
+                                else if (startlength > start)
242
+                                {
243
+                                    startlength = start;
244
+                                    endlength = end;
245
+
246
+                                    en2 = entemp;
247
+                                    ele2 = ele;
248
+                                }
249
+                                else if (endlength > end)
250
+                                {
251
+                                    startlength = start;
252
+                                    endlength = end;
253
+
254
+                                    en2 = entemp;
255
+                                    ele2 = ele;
256
+                                }
257
+                            }
258
+                        }
259
+                        else if (entemp is Polyline2d)
260
+                        {
261
+                            Polyline2d pl2d = entemp as Polyline2d;
262
+                            ele = Convert.ToDouble(pl2d.Elevation.ToString("f1"));
263
+
264
+                            if (ele == ele1 + eledvalue)
265
+                            {
266
+                                pten2start = new Point2d(pl2d.StartPoint.X, pl2d.StartPoint.Y);
267
+                                pten2end = new Point2d(pl2d.EndPoint.X, pl2d.EndPoint.Y);
268
+
269
+                                double start = pten1start.GetDistanceTo(pten2start);
270
+                                double end = pten1end.GetDistanceTo(pten2end);
271
+
272
+                                if (startlength > start && endlength > end)
273
+                                {
274
+                                    startlength = start;
275
+                                    endlength = end;
276
+
277
+                                    en2 = entemp;
278
+                                    ele2 = ele;
279
+                                }
280
+                                else if (startlength > start)
281
+                                {
282
+                                    startlength = start;
283
+                                    endlength = end;
284
+
285
+                                    en2 = entemp;
286
+                                    ele2 = ele;
287
+                                }
288
+                                else if (endlength > end)
289
+                                {
290
+                                    startlength = start;
291
+                                    endlength = end;
292
+
293
+                                    en2 = entemp;
294
+                                    ele2 = ele;
295
+                                }
296
+                            }
297
+                        }
298
+                        j++;
299
+                        if (j > plentitycollection.Count - 1)
300
+                            break;
301
+                    }
302
+
303
+                    //满足裁剪条件的节点
304
+                    Point3dCollection cjcoll = new Point3dCollection();
305
+                    bool flag = false;
306
+
307
+                    if (en2 != null)
308
+                    {
309
+                        //以计曲线节点为循环
310
+                        for (int ii = 0; ii < pt3dcoll.Count; ii++)
311
+                        {
312
+                            Point3d pt3d = pt3dcoll[ii];
313
+
314
+                            Point3d temppt3d = new Point3d();
315
+                            temppt3d = GetClosestPoint(pt3d, en2);
316
+
317
+                            //临时计算两个3d点之间的平面距离
318
+                            Point2d pt2d1 = new Point2d(pt3d.X, pt3d.Y);
319
+                            Point2d pt2d2 = new Point2d(temppt3d.X, temppt3d.Y);
320
+
321
+                            double length = pt2d1.GetDistanceTo(pt2d2);
322
+                            if (length < scalelen)
323
+                            {
324
+                                //flag为false标志继续添加满足条件节点
325
+                                //flag为true标志结束添加节点,进行后续计算
326
+                                
327
+                                if (ii == pt3dcoll.Count - 1)//最后一组节点
328
+                                {
329
+                                    flag = true;
330
+                                }
331
+                                else 
332
+                                {
333
+                                    cjcoll.Add(pt3d);
334
+                                    cjcoll.Add(temppt3d);
335
+                                }
336
+                            }
337
+                            else
338
+                            {
339
+                                flag = true;
340
+                            }
341
+                            if (flag == true)
342
+                            {
343
+                                if (cjcoll.Count > 0)
344
+                                {
345
+                                    if (cjcoll.Count > 3)
346
+                                    {
347
+                                        //矩形框四个角点
348
+                                        //选取2个为裁剪的两个节点
349
+                                        //为计曲线上的点
350
+                                        Point3d pt1cjnode = new Point3d();
351
+                                        Point3d pt2node = new Point3d();
352
+                                        Point3d pt3cjnode = new Point3d();
353
+                                        Point3d pt4node = new Point3d();
354
+
355
+                                        pt1cjnode = cjcoll[0];
356
+                                        pt2node = cjcoll[1];
357
+                                        pt3cjnode = cjcoll[cjcoll.Count - 2];
358
+                                        pt4node = cjcoll[cjcoll.Count - 1];
359
+
360
+                                        Point3dCollection rectcj = new Point3dCollection();
361
+                                        rectcj.Add(pt1cjnode);
362
+                                        rectcj.Add(pt2node);
363
+                                        rectcj.Add(pt3cjnode);
364
+                                        rectcj.Add(pt4node);
365
+
366
+                                        #region
367
+                                        Point2d pt2djudge1 = new Point2d(pt1cjnode.X, pt1cjnode.Y);
368
+                                        Point2d pt2djudge2 = new Point2d(pt3cjnode.X, pt3cjnode.Y);
369
+
370
+                                        if (pt2djudge1.GetDistanceTo(pt2djudge2) > lenIgnore)
371
+                                        {
372
+                                            #region//画裁剪线
373
+                                            ////using (Transaction tran = doc.TransactionManager.StartTransaction())
374
+                                            ////{
375
+
376
+                                            ////    //// 以只读方式打开块表记录   Open the Block table record for read
377
+                                            ////    BlockTable acbt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
378
+                                            ////    //// 以写方式打开模型空间块表记录   Open the Block table record Model space for write
379
+                                            ////    BlockTableRecord acblr = tran.GetObject(acbt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
380
+
381
+                                            ////    //设置激活图层
382
+                                            ////    layertable = tran.GetObject(db.LayerTableId, OpenMode.ForWrite) as LayerTable;
383
+                                            ////    if (!layertable.Has("CJX"))
384
+                                            ////    {
385
+                                            ////        LayerTableRecord ltr = new LayerTableRecord();
386
+                                            ////        ltr.Name = "CJX";
387
+                                            ////        ObjectId layerid = layertable.Add(ltr);
388
+                                            ////        tran.AddNewlyCreatedDBObject(ltr, true);
389
+                                            ////        db.Clayer = layerid;
390
+                                            ////    }
391
+                                            ////    else
392
+                                            ////    {
393
+                                            ////        //设置首曲线为当期激活图层
394
+                                            ////        foreach (ObjectId id in layertable)
395
+                                            ////        {
396
+                                            ////            LayerTableRecord lyrtbrec = tran.GetObject(id, OpenMode.ForWrite) as LayerTableRecord;
397
+                                            ////            if (lyrtbrec.Name == "CJX")
398
+                                            ////                db.Clayer = id;
399
+                                            ////        }
400
+                                            ////    }
401
+
402
+                                            ////    Polyline3d cjxpl = new Polyline3d(Poly3dType.SimplePoly, cjcoll, false);
403
+
404
+                                            ////    cjxpl.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.Blue);
405
+                                            ////    acblr.AppendEntity(cjxpl);
406
+                                            ////    cjxpl.Layer = "CJX";
407
+                                            ////    tran.AddNewlyCreatedDBObject(cjxpl, true);
408
+
409
+                                            ////    //doc.Editor.WriteMessage("");
410
+
411
+                                            ////    tran.Commit();
412
+                                            ////    tran.Dispose();
413
+                                            ////}
414
+                                            #endregion
415
+
416
+                                            double Xmin = 9999999999, Xmax = 0, Ymin = 9999999999, Ymax = 0;
417
+                                            //获取该点集的最大值最小值
418
+                                            foreach (Point3d pt3dcorner in cjcoll)
419
+                                            {
420
+                                                if (Xmin >= pt3dcorner.X)
421
+                                                    Xmin = pt3dcorner.X;
422
+                                                if (Xmax < pt3dcorner.X)
423
+                                                    Xmax = pt3dcorner.X;
424
+                                                if (Ymin >= pt3dcorner.Y)
425
+                                                    Ymin = pt3dcorner.Y;
426
+                                                if (Ymax < pt3dcorner.Y)
427
+                                                    Ymax = pt3dcorner.Y;
428
+                                            }
429
+                                            if (Xmin > Xmax)
430
+                                            {
431
+                                                double tempt = 0;
432
+                                                tempt = Xmin;
433
+                                                Xmin = Xmax;
434
+                                                Xmax = tempt;
435
+                                            }
436
+
437
+                                            if (Ymin > Ymax)
438
+                                            {
439
+                                                double tempt = 0;
440
+                                                tempt = Ymin;
441
+                                                Ymin = Ymax;
442
+                                                Ymax = tempt;
443
+                                            }
444
+                                            #region//设置视图
445
+                                            //设置当前视图
446
+                                            ViewTableRecord viewtr = new ViewTableRecord();
447
+                                            viewtr.CenterPoint = new Point2d(Xmin + (Xmax - Xmin) / 2, Ymin + (Ymax - Ymin) / 2);
448
+                                            viewtr.ViewDirection = new Vector3d(0, 0, 1);
449
+                                            viewtr.Height = Ymax - Ymin + 100;
450
+                                            viewtr.Width = Xmax - Xmin + 100;
451
+                                            doc.Editor.SetCurrentView(viewtr);
452
+                                            #endregion
453
+
454
+                                            //对选择到的首曲线进行处理
455
+                                            string stttr = "";
456
+                                            TypedValue[] tvtemp = new TypedValue[1];
457
+                                            tvtemp.SetValue(new TypedValue((int)DxfCode.LayerName, sqxlayer), 0);
458
+                                            SelectionFilter sftemp = new SelectionFilter(tvtemp);
459
+                                            PromptSelectionResult psrtempt = doc.Editor.SelectCrossingWindow(new Point3d(Xmin, Ymin, 0), new Point3d(Xmax, Ymax, 0), sftemp);
460
+                                            if (psrtempt.Status == PromptStatus.OK)
461
+                                            {
462
+                                                SelectionSet sstempt = psrtempt.Value;
463
+                                                #region
464
+                                                using (Transaction tran = doc.TransactionManager.StartTransaction())
465
+                                                {
466
+                                                    //// 以只读方式打开块表记录   Open the Block table record for read
467
+                                                    BlockTable acbt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
468
+                                                    //// 以写方式打开模型空间块表记录   Open the Block table record Model space for write
469
+                                                    BlockTableRecord acblr = tran.GetObject(acbt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
470
+
471
+                                                    //设置激活图层
472
+                                                    layertable = tran.GetObject(db.LayerTableId, OpenMode.ForWrite) as LayerTable;
473
+
474
+                                                    //设置首曲线为当期激活图层
475
+                                                    foreach (ObjectId id in layertable)
476
+                                                    {
477
+                                                        LayerTableRecord lyrtbrec = tran.GetObject(id, OpenMode.ForWrite) as LayerTableRecord;
478
+                                                        if (lyrtbrec.Name == sqxlayer)
479
+                                                            db.Clayer = id;
480
+                                                    }
481
+                                                    foreach (ObjectId oidtempt in sstempt.GetObjectIds())
482
+                                                    {
483
+                                                        Entity entempt = tran.GetObject(oidtempt, OpenMode.ForWrite) as Entity;
484
+
485
+                                                        //if (ele1 > ele2)
486
+                                                        //{
487
+                                                        //    double tempt = 0;
488
+                                                        //    tempt = ele1;
489
+                                                        //    ele1 = ele2;
490
+                                                        //    ele2 = tempt;
491
+                                                        //}
492
+
493
+                                                        if (entempt is Polyline)
494
+                                                        {
495
+                                                            Polyline pltempt = entempt as Polyline;
496
+                                                            if (Convert.ToDouble(pltempt.Elevation.ToString("f1")) > ele1 && Convert.ToDouble(pltempt.Elevation.ToString("f1")) < ele2)
497
+                                                            {
498
+                                                                //裁剪节点集
499
+                                                                Point3dCollection pt3dcolltempt = new Point3dCollection();
500
+                                                                //裁剪节点集
501
+                                                                Point3dCollection pt3dcolltempt2 = new Point3dCollection();
502
+
503
+
504
+                                                                //裁剪节点
505
+                                                                Point3d pt3dtt1 = pltempt.GetClosestPointTo(pt1cjnode, false);
506
+                                                                Point3d pt3dtt2 = pltempt.GetClosestPointTo(pt3cjnode, false);
507
+
508
+                                                                //将线端点以外的点添加进裁剪接节点
509
+                                                                if (pt3dtt1 != new Point3d())
510
+                                                                {
511
+                                                                    if (pt3dtt1 != pltempt.StartPoint && pt3dtt1 != pltempt.EndPoint)
512
+                                                                        pt3dcolltempt.Add(pt3dtt1);
513
+                                                                }
514
+                                                                if (pt3dtt2 != new Point3d())
515
+                                                                {
516
+                                                                    if (pt3dtt2 != pltempt.StartPoint && pt3dtt2 != pltempt.EndPoint)
517
+                                                                        pt3dcolltempt.Add(pt3dtt2);
518
+                                                                }
519
+                                                                stttr += pltempt.StartPoint.X + "," + pltempt.StartPoint.Y + "," + pltempt.StartPoint.Z + "!" + pltempt.EndPoint.X + ","
520
+                                                                    + pltempt.EndPoint.Y + "," + pltempt.EndPoint.Z + "\r\n";
521
+                                                                stttr += pt3dtt1.X + "@" + pt3dtt1.Y + "@" + pt3dtt1.Z + "!" + pt3dtt2.X + "@" + pt3dtt2.Y + "@" + pt3dtt2.Z + "\r\n";
522
+                                                                if (pt3dcolltempt.Count > 0)
523
+                                                                {
524
+                                                                    for (int ch = 0; ch < pt3dcolltempt.Count; ch++)
525
+                                                                    {
526
+                                                                        pt3dcolltempt2.Add(pt3dcolltempt[pt3dcolltempt.Count - 1 - ch]);
527
+                                                                    }
528
+
529
+
530
+                                                                    DBObjectCollection dbojcoll = null;
531
+                                                                    DBObjectCollection dbojcoll2 = null;
532
+                                                                    try
533
+                                                                    {
534
+                                                                        dbojcoll = pltempt.GetSplitCurves(pt3dcolltempt);
535
+                                                                    }
536
+                                                                    catch { }
537
+                                                                    try
538
+                                                                    {
539
+                                                                        dbojcoll2 = pltempt.GetSplitCurves(pt3dcolltempt2);
540
+                                                                    }
541
+                                                                    catch { }
542
+
543
+                                                                    if (dbojcoll2.Count > dbojcoll.Count)
544
+                                                                        dbojcoll = dbojcoll2;
545
+                                                                    //if (dbojcoll.Count >0)
546
+                                                                    if (dbojcoll.Count < 1)
547
+                                                                        continue;
548
+                                                                    //{
549
+                                                                    if (pltempt.Closed)//如果该线闭合
550
+                                                                    {
551
+                                                                        foreach (DBObject enen in dbojcoll)
552
+                                                                        {
553
+                                                                            Polyline plcjh = enen as Polyline;
554
+                                                                            Point3dCollection ptcolltempt3d = new Point3dCollection();
555
+                                                                            plcjh.GetStretchPoints(ptcolltempt3d);
556
+                                                                            Point3d ptptpt = ptcolltempt3d[(int)(ptcolltempt3d.Count / 2)];
557
+                                                                            //Point3d ptptpt = ptcolltempt3d[1];
558
+                                                                            Point2d ptinen1 = new Point2d();
559
+                                                                            Point2d ptinen2 = new Point2d();
560
+                                                                            //double llen = 9999;
561
+                                                                            if (en1 is Polyline)
562
+                                                                            {
563
+                                                                                Polyline plen1 = en1 as Polyline;
564
+                                                                                Point3d mypt = plen1.GetClosestPointTo(ptptpt, false);
565
+                                                                                ptinen1 = new Point2d(mypt.X, mypt.Y);
566
+
567
+                                                                                //llen = plen1.GetClosestPointTo(ptptpt, false).DistanceTo(ptptpt);
568
+                                                                            }
569
+                                                                            else if (en1 is Polyline2d)
570
+                                                                            {
571
+                                                                                Polyline2d pl2den1 = en1 as Polyline2d;
572
+
573
+                                                                                Point3d mypt = pl2den1.GetClosestPointTo(ptptpt, false);
574
+                                                                                ptinen1 = new Point2d(mypt.X, mypt.Y);
575
+                                                                                //llen = pl2den1.GetClosestPointTo(ptptpt, false).DistanceTo(ptptpt);
576
+                                                                            }
577
+                                                                            if (en2 is Polyline)
578
+                                                                            {
579
+                                                                                Polyline plen2 = en2 as Polyline;
580
+                                                                                Point3d mypt = plen2.GetClosestPointTo(ptptpt, false);
581
+                                                                                ptinen2 = new Point2d(mypt.X, mypt.Y);
582
+                                                                            }
583
+                                                                            else if (en2 is Polyline2d)
584
+                                                                            {
585
+                                                                                Polyline2d pl2den2 = en2 as Polyline2d;
586
+
587
+                                                                                Point3d mypt = pl2den2.GetClosestPointTo(ptptpt, false);
588
+                                                                                ptinen2 = new Point2d(mypt.X, mypt.Y);
589
+                                                                            }
590
+                                                                            double llen = 9999;
591
+                                                                            if ((ptinen1 != new Point2d()) && (ptinen2 != new Point2d()))
592
+                                                                            {
593
+                                                                                llen = ptinen1.GetDistanceTo(ptinen2);
594
+                                                                            }
595
+                                                                            if (llen < scalelen)
596
+                                                                            {
597
+                                                                                cdentity.Add(plcjh);
598
+                                                                            }
599
+                                                                            else
600
+                                                                            {
601
+                                                                                acblr.AppendEntity(plcjh);
602
+                                                                                plcjh.Layer = sqxlayer;
603
+                                                                                tran.AddNewlyCreatedDBObject(plcjh, true);
604
+                                                                            }
605
+                                                                        }
606
+                                                                    }
607
+                                                                    else
608
+                                                                    {
609
+                                                                        foreach (DBObject enen in dbojcoll)
610
+                                                                        {
611
+
612
+                                                                            Polyline plcjh = enen as Polyline;
613
+                                                                            Point2d startpoint = new Point2d(plcjh.StartPoint.X, plcjh.StartPoint.Y);
614
+                                                                            Point2d endpoint = new Point2d(plcjh.EndPoint.X, plcjh.EndPoint.Y);
615
+
616
+                                                                            double linelength = startpoint.GetDistanceTo(endpoint);
617
+
618
+                                                                            if (linelength > 1.5 * mapscale)
619
+                                                                            {
620
+                                                                                //if ((plcjh.GetClosestPointTo(pt3dtt1, false) == pt3dtt1) && (plcjh.GetClosestPointTo(pt3dtt2, false) == pt3dtt2))
621
+                                                                                if ((pt3dtt1 == plcjh.StartPoint || pt3dtt1 == plcjh.EndPoint) && (pt3dtt2 == plcjh.StartPoint || pt3dtt2 == plcjh.EndPoint))
622
+                                                                                {
623
+                                                                                    cdentity.Add(plcjh);
624
+                                                                                }
625
+                                                                                else
626
+                                                                                {
627
+                                                                                    acblr.AppendEntity(plcjh);
628
+                                                                                    plcjh.Layer = sqxlayer;
629
+                                                                                    tran.AddNewlyCreatedDBObject(plcjh, true);
630
+                                                                                }
631
+                                                                            }
632
+                                                                            else
633
+                                                                                cdentity.Add(plcjh);
634
+                                                                        }
635
+                                                                    }
636
+                                                                    //}
637
+                                                                    entempt.Erase(true);
638
+                                                                    //tran.Commit();
639
+                                                                }
640
+
641
+                                                            }
642
+                                                        }
643
+                                                        else if (entempt is Polyline2d)
644
+                                                        {
645
+                                                            ////裁剪二维多段线代码
646
+                                                            
647
+                                                            Polyline2d pl2dtempt = entempt as Polyline2d;
648
+                                                            if (Convert.ToDouble(pl2dtempt.Elevation.ToString("f1")) > ele1 && Convert.ToDouble(pl2dtempt.Elevation.ToString("f1")) < ele2)
649
+                                                            {
650
+                                                                Point3dCollection pt3dcolltempt = new Point3dCollection();
651
+                                                                Point3d pt3dtt1 = pl2dtempt.GetClosestPointTo(pt1cjnode, false);
652
+                                                                Point3d pt3dtt2 = pl2dtempt.GetClosestPointTo(pt3cjnode, false);
653
+
654
+                                                                //将线端点以外的点添加进裁剪接节点
655
+                                                                if (pt3dtt1 != new Point3d())
656
+                                                                {
657
+                                                                    if (pt3dtt1 != pl2dtempt.StartPoint && pt3dtt1 != pl2dtempt.EndPoint)
658
+                                                                        pt3dcolltempt.Add(pt3dtt1);
659
+                                                                }
660
+                                                                if (pt3dtt2 != new Point3d())
661
+                                                                {
662
+                                                                    if (pt3dtt2 != pl2dtempt.StartPoint && pt3dtt2 != pl2dtempt.EndPoint)
663
+                                                                        pt3dcolltempt.Add(pt3dtt2);
664
+                                                                }
665
+                                                                if (pt3dcolltempt.Count > 0)
666
+                                                                {
667
+                                                                    Polyline pltempt = new Polyline();                                                                   
668
+                                                                    Point3dCollection pt3dpl2dcoll = new Point3dCollection();
669
+                                                                    pl2dtempt.GetStretchPoints(pt3dpl2dcoll);
670
+                                                                    //foreach (Point3d pt in pt3dpl2dcoll)
671
+                                                                    //{
672
+                                                                    //    pltempt.AddVertexAt(0,pt,0,0,0);
673
+                                                                    //}
674
+
675
+                                                                    DBObjectCollection dbojcoll = pl2dtempt.GetSplitCurves(pt3dcolltempt);
676
+                                                                    if (dbojcoll.Count>0)
677
+                                                                    {
678
+                                                                    foreach (DBObject enen in dbojcoll)
679
+                                                                    {
680
+                                                                        Polyline2d pl2dcjh = enen as Polyline2d;
681
+
682
+                                                                        Point2d startpoint = new Point2d(pl2dcjh.StartPoint.X, pl2dcjh.StartPoint.Y);
683
+                                                                        Point2d endpoint = new Point2d(pl2dcjh.EndPoint.X, pl2dcjh.EndPoint.Y);
684
+
685
+                                                                        double linelength = startpoint.GetDistanceTo(endpoint);
686
+
687
+                                                                        if (linelength > 1.5 * mapscale)
688
+                                                                        {
689
+
690
+                                                                            if ((pl2dcjh.GetClosestPointTo(pt3dtt1, false) == pt3dtt1) && (pl2dcjh.GetClosestPointTo(pt3dtt2, false) == pt3dtt2))
691
+                                                                            if ((pt3dtt1 == pl2dcjh.StartPoint || pt3dtt1 == pl2dcjh.EndPoint) && (pt3dtt2 == pl2dcjh.StartPoint || pt3dtt2 == pl2dcjh.EndPoint))
692
+                                                                            {
693
+                                                                                cdentity.Add(pl2dcjh);
694
+                                                                            }
695
+                                                                            else
696
+                                                                            {
697
+                                                                                acblr.AppendEntity(pl2dcjh);
698
+                                                                                pl2dcjh.Layer = sqxlayer;
699
+                                                                                tran.AddNewlyCreatedDBObject(pl2dcjh, true);
700
+                                                                            }
701
+                                                                        }
702
+                                                                        else
703
+                                                                            cdentity.Add(pl2dcjh);
704
+                                                                    }
705
+
706
+                                                                    } 
707
+                                                                    entempt.Erase(true);
708
+                                                                    tran.Commit();
709
+                                                                }
710
+                                                            }
711
+
712
+                                                  
713
+                                                        }
714
+
715
+                                                        #region//画裁剪线
716
+                                                        //Polyline3d cjxpl = new Polyline3d(Poly3dType.SimplePoly, rectcj, false);
717
+                                                        //if (!layertable.Has("CJX"))
718
+                                                        //{
719
+                                                        //    LayerTableRecord ltr = new LayerTableRecord();
720
+                                                        //    ltr.Name = "CJX";
721
+                                                        //    ObjectId layerid = layertable.Add(ltr);
722
+                                                        //    tran.AddNewlyCreatedDBObject(ltr, true);
723
+                                                        //    //db.Clayer = layerid;
724
+                                                        //}
725
+
726
+                                                        //cjxpl.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.Blue);
727
+                                                        //acblr.AppendEntity(cjxpl);
728
+                                                        //cjxpl.Layer = "CJX";
729
+                                                        //tran.AddNewlyCreatedDBObject(cjxpl, true);
730
+                                                        ////doc.Editor.WriteMessage("");
731
+                                                        #endregion
732
+
733
+                                                    }
734
+
735
+                                                    tran.Commit();
736
+                                                    tran.Dispose();
737
+                                                }
738
+                                                #endregion
739
+                                            }
740
+
741
+                                        }
742
+
743
+                                    }
744
+                                    cjcoll.Clear();
745
+                                    cjcoll = new Point3dCollection();
746
+                                }
747
+
748
+                                flag = false;
749
+                                continue;
750
+                            }//end if
751
+                            else
752
+                            {
753
+                                continue;
754
+                            }
755
+                        }
756
+                    }
757
+                }
758
+            }
759
+            else
760
+                return;      
761
+       #endregion
762
+       #region
763
+            ///画裁剪掉的线
764
+            if (cdentity.Count > 0)
765
+            {
766
+                using (Transaction tran = doc.TransactionManager.StartTransaction())
767
+                {
768
+
769
+                    //// 以只读方式打开块表记录   Open the Block table record for read
770
+                    BlockTable acbt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
771
+                    //// 以写方式打开模型空间块表记录   Open the Block table record Model space for write
772
+                    BlockTableRecord acblr = tran.GetObject(acbt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
773
+
774
+                    //设置激活图层
775
+                    layertable = tran.GetObject(db.LayerTableId, OpenMode.ForWrite) as LayerTable;
776
+                    if (!layertable.Has("CJSQX"))
777
+                    {
778
+                        LayerTableRecord ltr = new LayerTableRecord();
779
+                        ltr.Name = "CJSQX";
780
+                        ObjectId layerid = layertable.Add(ltr);
781
+                        tran.AddNewlyCreatedDBObject(ltr, true);
782
+                        db.Clayer = layerid;
783
+                    }
784
+                    else
785
+                    {
786
+                        foreach (ObjectId id in layertable)
787
+                        {
788
+                            LayerTableRecord lyrtbrec = tran.GetObject(id, OpenMode.ForWrite) as LayerTableRecord;
789
+                            if (lyrtbrec.Name == "CJSQX")
790
+                                db.Clayer = id;
791
+                        }
792
+                    }
793
+
794
+                    foreach (Entity enenen in cdentity)
795
+                    {
796
+                        enenen.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.Red);
797
+                        acblr.AppendEntity(enenen);
798
+                        enenen.Layer = "CJSQX";
799
+                        tran.AddNewlyCreatedDBObject(enenen, true);
800
+                    }
801
+
802
+                    doc.Editor.WriteMessage("已完成裁剪\r\n裁剪掉的等高线都放在CJSQX图层中\r\n");
803
+
804
+                    tran.Commit();
805
+                    tran.Dispose();
806
+                }
807
+            }
808
+            #endregion
809
+            documentlock.Dispose();
810
+            doc.Editor.WriteMessage("程序运行结束");          
811
+        }
812
+        public static int CompareDGXByElevation(Entity en1, Entity en2)
813
+        {
814
+            double ele1 = 0, ele2 = 0;
815
+            //because just Polyline and Polyline2d two class in plentitycollection
816
+            if (en1 is Polyline)
817
+            {
818
+                Polyline pl = en1 as Polyline;
819
+                ele1 = Convert.ToDouble(pl.Elevation.ToString("f1"));
820
+            }
821
+            else
822
+            {
823
+                Polyline2d pl2d = en1 as Polyline2d;
824
+                ele1 = Convert.ToDouble(pl2d.Elevation.ToString("f1"));
825
+            }
826
+
827
+            if (en2 is Polyline)
828
+            {
829
+                Polyline pl = en2 as Polyline;
830
+                ele2 = Convert.ToDouble(pl.Elevation.ToString("f1"));
831
+            }
832
+            else
833
+            {
834
+                Polyline2d pl2d = en2 as Polyline2d;
835
+                ele2 = Convert.ToDouble(pl2d.Elevation.ToString("f1"));
836
+            }
837
+
838
+            return (int)(ele1 - ele2);
839
+
840
+        }
841
+        public static Point3d GetClosestPoint(Point3d pt, Entity enpl)
842
+        {
843
+            if (enpl is Polyline)
844
+            {
845
+                Polyline pl = enpl as Polyline;
846
+                return pl.GetClosestPointTo(pt, true);
847
+            }
848
+            else
849
+            {
850
+                Polyline2d pl2d = enpl as Polyline2d;
851
+                return pl2d.GetClosestPointTo(pt, true);
852
+            }
853
+        }
854
+       #endregion
855
+    }
856
+}

+ 244
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.Designer.cs 查看文件

@@ -0,0 +1,244 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class CutCountL
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CutCountL));
33
+            this.label17 = new System.Windows.Forms.Label();
34
+            this.richTextBox2 = new System.Windows.Forms.RichTextBox();
35
+            this.dgxCJ_gcc_te = new System.Windows.Forms.TextBox();
36
+            this.dgxCJ_gcc_la = new System.Windows.Forms.Label();
37
+            this.dgxCJ_hlcd_te = new System.Windows.Forms.TextBox();
38
+            this.dgxCJ_hlcd_la = new System.Windows.Forms.Label();
39
+            this.dgxCJ_cjjl_te = new System.Windows.Forms.TextBox();
40
+            this.dgxCJ_cjjl_la = new System.Windows.Forms.Label();
41
+            this.dgxCJ_jqx_co = new System.Windows.Forms.ComboBox();
42
+            this.dgxCJ_jqx_la = new System.Windows.Forms.Label();
43
+            this.dgxCJ_sqx_co = new System.Windows.Forms.ComboBox();
44
+            this.dgxCJ_sqx_la = new System.Windows.Forms.Label();
45
+            this.dgxCJ_blc_co = new System.Windows.Forms.ComboBox();
46
+            this.dgxCJ_blc_la = new System.Windows.Forms.Label();
47
+            this.Cancel = new System.Windows.Forms.Button();
48
+            this.OK = new System.Windows.Forms.Button();
49
+            this.SuspendLayout();
50
+            // 
51
+            // label17
52
+            // 
53
+            this.label17.AutoSize = true;
54
+            this.label17.Location = new System.Drawing.Point(319, 20);
55
+            this.label17.Name = "label17";
56
+            this.label17.Size = new System.Drawing.Size(52, 15);
57
+            this.label17.TabIndex = 27;
58
+            this.label17.Text = "说明:";
59
+            // 
60
+            // richTextBox2
61
+            // 
62
+            this.richTextBox2.Location = new System.Drawing.Point(322, 44);
63
+            this.richTextBox2.Name = "richTextBox2";
64
+            this.richTextBox2.Size = new System.Drawing.Size(430, 319);
65
+            this.richTextBox2.TabIndex = 26;
66
+            this.richTextBox2.Text = resources.GetString("richTextBox2.Text");
67
+            // 
68
+            // dgxCJ_gcc_te
69
+            // 
70
+            this.dgxCJ_gcc_te.Location = new System.Drawing.Point(174, 313);
71
+            this.dgxCJ_gcc_te.Name = "dgxCJ_gcc_te";
72
+            this.dgxCJ_gcc_te.Size = new System.Drawing.Size(121, 25);
73
+            this.dgxCJ_gcc_te.TabIndex = 25;
74
+            // 
75
+            // dgxCJ_gcc_la
76
+            // 
77
+            this.dgxCJ_gcc_la.AutoSize = true;
78
+            this.dgxCJ_gcc_la.Location = new System.Drawing.Point(48, 285);
79
+            this.dgxCJ_gcc_la.Name = "dgxCJ_gcc_la";
80
+            this.dgxCJ_gcc_la.Size = new System.Drawing.Size(142, 15);
81
+            this.dgxCJ_gcc_la.TabIndex = 24;
82
+            this.dgxCJ_gcc_la.Text = "两计曲线间高程差:";
83
+            // 
84
+            // dgxCJ_hlcd_te
85
+            // 
86
+            this.dgxCJ_hlcd_te.Location = new System.Drawing.Point(174, 244);
87
+            this.dgxCJ_hlcd_te.Name = "dgxCJ_hlcd_te";
88
+            this.dgxCJ_hlcd_te.Size = new System.Drawing.Size(121, 25);
89
+            this.dgxCJ_hlcd_te.TabIndex = 23;
90
+            // 
91
+            // dgxCJ_hlcd_la
92
+            // 
93
+            this.dgxCJ_hlcd_la.AutoSize = true;
94
+            this.dgxCJ_hlcd_la.Location = new System.Drawing.Point(48, 217);
95
+            this.dgxCJ_hlcd_la.Name = "dgxCJ_hlcd_la";
96
+            this.dgxCJ_hlcd_la.Size = new System.Drawing.Size(180, 15);
97
+            this.dgxCJ_hlcd_la.TabIndex = 22;
98
+            this.dgxCJ_hlcd_la.Text = "可忽略的裁剪长度(m):";
99
+            // 
100
+            // dgxCJ_cjjl_te
101
+            // 
102
+            this.dgxCJ_cjjl_te.Location = new System.Drawing.Point(174, 176);
103
+            this.dgxCJ_cjjl_te.Name = "dgxCJ_cjjl_te";
104
+            this.dgxCJ_cjjl_te.Size = new System.Drawing.Size(121, 25);
105
+            this.dgxCJ_cjjl_te.TabIndex = 21;
106
+            // 
107
+            // dgxCJ_cjjl_la
108
+            // 
109
+            this.dgxCJ_cjjl_la.AutoSize = true;
110
+            this.dgxCJ_cjjl_la.Location = new System.Drawing.Point(48, 179);
111
+            this.dgxCJ_cjjl_la.Name = "dgxCJ_cjjl_la";
112
+            this.dgxCJ_cjjl_la.Size = new System.Drawing.Size(120, 15);
113
+            this.dgxCJ_cjjl_la.TabIndex = 20;
114
+            this.dgxCJ_cjjl_la.Text = "裁剪距离(m):";
115
+            // 
116
+            // dgxCJ_jqx_co
117
+            // 
118
+            this.dgxCJ_jqx_co.FormattingEnabled = true;
119
+            this.dgxCJ_jqx_co.Location = new System.Drawing.Point(174, 136);
120
+            this.dgxCJ_jqx_co.Name = "dgxCJ_jqx_co";
121
+            this.dgxCJ_jqx_co.Size = new System.Drawing.Size(121, 23);
122
+            this.dgxCJ_jqx_co.TabIndex = 19;
123
+            // 
124
+            // dgxCJ_jqx_la
125
+            // 
126
+            this.dgxCJ_jqx_la.AutoSize = true;
127
+            this.dgxCJ_jqx_la.Location = new System.Drawing.Point(48, 139);
128
+            this.dgxCJ_jqx_la.Name = "dgxCJ_jqx_la";
129
+            this.dgxCJ_jqx_la.Size = new System.Drawing.Size(97, 15);
130
+            this.dgxCJ_jqx_la.TabIndex = 18;
131
+            this.dgxCJ_jqx_la.Text = "计曲线图层:";
132
+            // 
133
+            // dgxCJ_sqx_co
134
+            // 
135
+            this.dgxCJ_sqx_co.FormattingEnabled = true;
136
+            this.dgxCJ_sqx_co.Location = new System.Drawing.Point(174, 93);
137
+            this.dgxCJ_sqx_co.Name = "dgxCJ_sqx_co";
138
+            this.dgxCJ_sqx_co.Size = new System.Drawing.Size(121, 23);
139
+            this.dgxCJ_sqx_co.TabIndex = 17;
140
+            // 
141
+            // dgxCJ_sqx_la
142
+            // 
143
+            this.dgxCJ_sqx_la.AutoSize = true;
144
+            this.dgxCJ_sqx_la.Location = new System.Drawing.Point(48, 97);
145
+            this.dgxCJ_sqx_la.Name = "dgxCJ_sqx_la";
146
+            this.dgxCJ_sqx_la.Size = new System.Drawing.Size(97, 15);
147
+            this.dgxCJ_sqx_la.TabIndex = 16;
148
+            this.dgxCJ_sqx_la.Text = "首曲线图层:";
149
+            // 
150
+            // dgxCJ_blc_co
151
+            // 
152
+            this.dgxCJ_blc_co.FormattingEnabled = true;
153
+            this.dgxCJ_blc_co.Items.AddRange(new object[] {
154
+            "1:200",
155
+            "1:500",
156
+            "1:1000",
157
+            "1:2000",
158
+            "1:5000",
159
+            "1:10000"});
160
+            this.dgxCJ_blc_co.Location = new System.Drawing.Point(174, 51);
161
+            this.dgxCJ_blc_co.Name = "dgxCJ_blc_co";
162
+            this.dgxCJ_blc_co.Size = new System.Drawing.Size(121, 23);
163
+            this.dgxCJ_blc_co.TabIndex = 15;
164
+            // 
165
+            // dgxCJ_blc_la
166
+            // 
167
+            this.dgxCJ_blc_la.AutoSize = true;
168
+            this.dgxCJ_blc_la.Location = new System.Drawing.Point(48, 54);
169
+            this.dgxCJ_blc_la.Name = "dgxCJ_blc_la";
170
+            this.dgxCJ_blc_la.Size = new System.Drawing.Size(90, 15);
171
+            this.dgxCJ_blc_la.TabIndex = 14;
172
+            this.dgxCJ_blc_la.Text = "地图比例尺:";
173
+            // 
174
+            // Cancel
175
+            // 
176
+            this.Cancel.Location = new System.Drawing.Point(506, 391);
177
+            this.Cancel.Margin = new System.Windows.Forms.Padding(4);
178
+            this.Cancel.Name = "Cancel";
179
+            this.Cancel.Size = new System.Drawing.Size(100, 29);
180
+            this.Cancel.TabIndex = 34;
181
+            this.Cancel.Text = "取 消";
182
+            this.Cancel.UseVisualStyleBackColor = true;
183
+            this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
184
+            // 
185
+            // OK
186
+            // 
187
+            this.OK.Location = new System.Drawing.Point(196, 391);
188
+            this.OK.Margin = new System.Windows.Forms.Padding(4);
189
+            this.OK.Name = "OK";
190
+            this.OK.Size = new System.Drawing.Size(100, 29);
191
+            this.OK.TabIndex = 33;
192
+            this.OK.Text = "确 定";
193
+            this.OK.UseVisualStyleBackColor = true;
194
+            this.OK.Click += new System.EventHandler(this.OK_Click);
195
+            // 
196
+            // CutCountL
197
+            // 
198
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
199
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
200
+            this.ClientSize = new System.Drawing.Size(800, 442);
201
+            this.Controls.Add(this.Cancel);
202
+            this.Controls.Add(this.OK);
203
+            this.Controls.Add(this.label17);
204
+            this.Controls.Add(this.richTextBox2);
205
+            this.Controls.Add(this.dgxCJ_gcc_te);
206
+            this.Controls.Add(this.dgxCJ_gcc_la);
207
+            this.Controls.Add(this.dgxCJ_hlcd_te);
208
+            this.Controls.Add(this.dgxCJ_hlcd_la);
209
+            this.Controls.Add(this.dgxCJ_cjjl_te);
210
+            this.Controls.Add(this.dgxCJ_cjjl_la);
211
+            this.Controls.Add(this.dgxCJ_jqx_co);
212
+            this.Controls.Add(this.dgxCJ_jqx_la);
213
+            this.Controls.Add(this.dgxCJ_sqx_co);
214
+            this.Controls.Add(this.dgxCJ_sqx_la);
215
+            this.Controls.Add(this.dgxCJ_blc_co);
216
+            this.Controls.Add(this.dgxCJ_blc_la);
217
+            this.Name = "CutCountL";
218
+            this.Text = "等高线裁剪";
219
+            this.Load += new System.EventHandler(this.CutCountL_Load);
220
+            this.ResumeLayout(false);
221
+            this.PerformLayout();
222
+
223
+        }
224
+
225
+        #endregion
226
+
227
+        private System.Windows.Forms.Label label17;
228
+        private System.Windows.Forms.RichTextBox richTextBox2;
229
+        private System.Windows.Forms.TextBox dgxCJ_gcc_te;
230
+        private System.Windows.Forms.Label dgxCJ_gcc_la;
231
+        private System.Windows.Forms.TextBox dgxCJ_hlcd_te;
232
+        private System.Windows.Forms.Label dgxCJ_hlcd_la;
233
+        private System.Windows.Forms.TextBox dgxCJ_cjjl_te;
234
+        private System.Windows.Forms.Label dgxCJ_cjjl_la;
235
+        private System.Windows.Forms.ComboBox dgxCJ_jqx_co;
236
+        private System.Windows.Forms.Label dgxCJ_jqx_la;
237
+        private System.Windows.Forms.ComboBox dgxCJ_sqx_co;
238
+        private System.Windows.Forms.Label dgxCJ_sqx_la;
239
+        private System.Windows.Forms.ComboBox dgxCJ_blc_co;
240
+        private System.Windows.Forms.Label dgxCJ_blc_la;
241
+        private System.Windows.Forms.Button Cancel;
242
+        private System.Windows.Forms.Button OK;
243
+    }
244
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.cs 查看文件

@@ -0,0 +1,120 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class CutCountL : Form
15
+    {
16
+        public CutCountL()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void CutCountL_Load(object sender, EventArgs e)
22
+        {
23
+            this.dgxCJ_blc_co.DropDownStyle = ComboBoxStyle.DropDownList;
24
+            this.dgxCJ_jqx_co.DropDownStyle = ComboBoxStyle.DropDownList;
25
+            this.dgxCJ_sqx_co.DropDownStyle = ComboBoxStyle.DropDownList;
26
+
27
+            //自动填充下拉框
28
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
29
+            using (Transaction traction = database.TransactionManager.StartTransaction())
30
+            {
31
+                //存放所有图层名
32
+                List<string> alllayername = new List<string>();
33
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
34
+                foreach (ObjectId objid in layertable)
35
+                {
36
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
37
+                    alllayername.Add(layertablerecord.Name);
38
+                }
39
+
40
+                alllayername.Sort();
41
+
42
+                for (int i = 0; i < alllayername.Count; i++)
43
+                {
44
+                    this.dgxCJ_jqx_co.Items.Add(alllayername[i]);
45
+                    this.dgxCJ_sqx_co.Items.Add(alllayername[i]);
46
+                }
47
+
48
+                if (alllayername.Contains("8300"))
49
+                {
50
+                    int index = alllayername.IndexOf("8300");
51
+                }
52
+                if (alllayername.Contains("8110"))
53
+                {
54
+                    int index = alllayername.IndexOf("8110");
55
+                    this.dgxCJ_sqx_co.SelectedIndex = index;
56
+                }
57
+                if (alllayername.Contains("8120"))
58
+                {
59
+                    int index = alllayername.IndexOf("8120");
60
+                    this.dgxCJ_jqx_co.SelectedIndex = index;
61
+                }
62
+                traction.Commit();
63
+            }
64
+
65
+        }
66
+
67
+        private void OK_Click(object sender, EventArgs e)
68
+        {
69
+            if (dgxCJ_blc_co.Text == "")
70
+            {
71
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
72
+                return;
73
+            }
74
+            if (dgxCJ_sqx_co.Text == "")
75
+            {
76
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层");
77
+                return;
78
+            }
79
+            if (dgxCJ_jqx_co.Text == "")
80
+            {
81
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层");
82
+                return;
83
+            }
84
+            if (dgxCJ_gcc_te.Text == "")
85
+            {
86
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入计曲线高程差");
87
+                return;
88
+            }
89
+            if (dgxCJ_hlcd_te.Text == "")
90
+            {
91
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入可忽略的裁剪长度");
92
+                return;
93
+            }
94
+            if (dgxCJ_cjjl_te.Text == "")
95
+            {
96
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入裁剪距离");
97
+                return;
98
+            }
99
+            CutContourLine.sqxlayer = dgxCJ_sqx_co.Text;
100
+            CutContourLine.jqxlayer = dgxCJ_jqx_co.Text;
101
+            CutContourLine.eledvalue = double.Parse(dgxCJ_gcc_te.Text);
102
+            CutContourLine.lenIgnore = double.Parse(dgxCJ_hlcd_te.Text);
103
+            CutContourLine.scalelen = double.Parse(dgxCJ_cjjl_te.Text);
104
+            //比例尺
105
+            string blctext = dgxCJ_blc_co.Text;
106
+            int blcindex = blctext.LastIndexOf(':');
107
+            string strblc = blctext.Substring(blcindex + 1);
108
+            CutContourLine.mapscale = Convert.ToInt32(strblc);
109
+
110
+            this.Close();
111
+            CutContourLine chfeature = new CutContourLine();
112
+            chfeature.ccls();
113
+        }
114
+
115
+        private void Cancel_Click(object sender, EventArgs e)
116
+        {
117
+            this.Close();
118
+        }
119
+    }
120
+}

+ 143
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.resx 查看文件

@@ -0,0 +1,143 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <data name="richTextBox2.Text" xml:space="preserve">
121
+    <value>根据规范要求,地形图中计曲线间距小于2mm,首曲线可以不表示。
122
+
123
+各种比例尺地形图不用表示首曲线的计曲线间距为:
124
+1:500  	1m
125
+1:1000 	2m
126
+1:2000 	4m
127
+1:5000 	10m
128
+1:10000	15m
129
+该裁减距离只是参考,按成图需求,可自行设置不用表示首曲线的计曲线间距。
130
+
131
+可忽略裁剪长度是另一个是否表示首曲线的参数,当满足规范间距不用表示的首曲线长度太短,小于规范长度时,不予处理。
132
+其中1:1000的可忽略裁剪长度为1m,其他比例尺的地形图以1:1000为基准变化,也可以按出图需求,自行设定。
133
+
134
+根据规范要求,不同比例尺地形图计曲线间高程差为固定值。
135
+各种比例尺计曲线间高程差为:
136
+1:500  	2.5m
137
+1:1000 	5m
138
+1:2000 	10m
139
+1:5000 	50m
140
+1:10000	100m
141
+该参数只是参考,具体计曲线间高程差,根据其地形图来确定。</value>
142
+  </data>
143
+</root>

+ 131
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.Designer.cs 查看文件

@@ -0,0 +1,131 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class DGXGeneral
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.checkedListBox_dgxtc = new System.Windows.Forms.CheckedListBox();
33
+            this.label1 = new System.Windows.Forms.Label();
34
+            this.label2 = new System.Windows.Forms.Label();
35
+            this.comboBox_dgj = new System.Windows.Forms.ComboBox();
36
+            this.butn_ok = new System.Windows.Forms.Button();
37
+            this.butn_cancel = new System.Windows.Forms.Button();
38
+            this.SuspendLayout();
39
+            // 
40
+            // checkedListBox_dgxtc
41
+            // 
42
+            this.checkedListBox_dgxtc.FormattingEnabled = true;
43
+            this.checkedListBox_dgxtc.Location = new System.Drawing.Point(44, 102);
44
+            this.checkedListBox_dgxtc.Name = "checkedListBox_dgxtc";
45
+            this.checkedListBox_dgxtc.Size = new System.Drawing.Size(235, 264);
46
+            this.checkedListBox_dgxtc.TabIndex = 0;
47
+            // 
48
+            // label1
49
+            // 
50
+            this.label1.AutoSize = true;
51
+            this.label1.Location = new System.Drawing.Point(25, 35);
52
+            this.label1.Name = "label1";
53
+            this.label1.Size = new System.Drawing.Size(112, 15);
54
+            this.label1.TabIndex = 1;
55
+            this.label1.Text = "转换后等高距:";
56
+            // 
57
+            // label2
58
+            // 
59
+            this.label2.AutoSize = true;
60
+            this.label2.Location = new System.Drawing.Point(25, 75);
61
+            this.label2.Name = "label2";
62
+            this.label2.Size = new System.Drawing.Size(127, 15);
63
+            this.label2.TabIndex = 2;
64
+            this.label2.Text = "选择等高线图层:";
65
+            // 
66
+            // comboBox_dgj
67
+            // 
68
+            this.comboBox_dgj.FormattingEnabled = true;
69
+            this.comboBox_dgj.Items.AddRange(new object[] {
70
+            "0.5",
71
+            "1",
72
+            "2",
73
+            "2.5",
74
+            "5",
75
+            "10",
76
+            "20",
77
+            "40",
78
+            "50"});
79
+            this.comboBox_dgj.Location = new System.Drawing.Point(134, 32);
80
+            this.comboBox_dgj.Name = "comboBox_dgj";
81
+            this.comboBox_dgj.Size = new System.Drawing.Size(155, 23);
82
+            this.comboBox_dgj.TabIndex = 3;
83
+            // 
84
+            // butn_ok
85
+            // 
86
+            this.butn_ok.Location = new System.Drawing.Point(28, 389);
87
+            this.butn_ok.Name = "butn_ok";
88
+            this.butn_ok.Size = new System.Drawing.Size(75, 23);
89
+            this.butn_ok.TabIndex = 4;
90
+            this.butn_ok.Text = "确 定";
91
+            this.butn_ok.UseVisualStyleBackColor = true;
92
+            this.butn_ok.Click += new System.EventHandler(this.butn_ok_Click);
93
+            // 
94
+            // butn_cancel
95
+            // 
96
+            this.butn_cancel.Location = new System.Drawing.Point(214, 389);
97
+            this.butn_cancel.Name = "butn_cancel";
98
+            this.butn_cancel.Size = new System.Drawing.Size(75, 23);
99
+            this.butn_cancel.TabIndex = 5;
100
+            this.butn_cancel.Text = "取 消";
101
+            this.butn_cancel.UseVisualStyleBackColor = true;
102
+            // 
103
+            // DGXGeneral
104
+            // 
105
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
106
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
107
+            this.ClientSize = new System.Drawing.Size(338, 424);
108
+            this.Controls.Add(this.butn_cancel);
109
+            this.Controls.Add(this.butn_ok);
110
+            this.Controls.Add(this.comboBox_dgj);
111
+            this.Controls.Add(this.label2);
112
+            this.Controls.Add(this.label1);
113
+            this.Controls.Add(this.checkedListBox_dgxtc);
114
+            this.Name = "DGXGeneral";
115
+            this.Text = "等高线缩编";
116
+            this.Load += new System.EventHandler(this.DGXGeneral_Load);
117
+            this.ResumeLayout(false);
118
+            this.PerformLayout();
119
+
120
+        }
121
+
122
+        #endregion
123
+
124
+        private System.Windows.Forms.CheckedListBox checkedListBox_dgxtc;
125
+        private System.Windows.Forms.Label label1;
126
+        private System.Windows.Forms.Label label2;
127
+        private System.Windows.Forms.ComboBox comboBox_dgj;
128
+        private System.Windows.Forms.Button butn_ok;
129
+        private System.Windows.Forms.Button butn_cancel;
130
+    }
131
+}

+ 76
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.cs 查看文件

@@ -0,0 +1,76 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections;
4
+using System.Collections.Generic;
5
+using System.ComponentModel;
6
+using System.Data;
7
+using System.Drawing;
8
+using System.Linq;
9
+using System.Text;
10
+using System.Threading.Tasks;
11
+using System.Windows.Forms;
12
+
13
+namespace HCTools
14
+{
15
+    public partial class DGXGeneral : Form
16
+    {
17
+        public DGXGeneral()
18
+        {
19
+            InitializeComponent();
20
+        }
21
+
22
+        private void DGXGeneral_Load(object sender, EventArgs e)
23
+        {
24
+            this.comboBox_dgj.DropDownStyle = ComboBoxStyle.DropDownList;
25
+
26
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
27
+            using (Transaction traction = database.TransactionManager.StartTransaction())
28
+            {
29
+                //存放所有图层名
30
+                List<string> alllayername = new List<string>();
31
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
32
+                foreach (ObjectId objid in layertable)
33
+                {
34
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
35
+                    alllayername.Add(layertablerecord.Name);
36
+                }
37
+
38
+                alllayername.Sort();
39
+
40
+                for (int i = 0; i < alllayername.Count; i++)
41
+                {
42
+                    this.checkedListBox_dgxtc.Items.Add(alllayername[i]);
43
+                }
44
+                traction.Commit();
45
+            }
46
+        }
47
+
48
+        private void butn_ok_Click(object sender, EventArgs e)
49
+        {
50
+            ArrayList eplayerlist = new ArrayList();
51
+            if (checkedListBox_dgxtc.CheckedItems.Count > 0)
52
+            {
53
+                int count = checkedListBox_dgxtc.CheckedItems.Count;
54
+                for (int i = 0; i < count; i++)
55
+                {
56
+                    eplayerlist.Add(checkedListBox_dgxtc.CheckedItems[i].ToString());
57
+                }
58
+            }
59
+            else
60
+            {
61
+                MessageBox.Show("请选择处理等高线图层!", "警告");
62
+                return;
63
+            }
64
+            if (comboBox_dgj.Text == "")
65
+            {
66
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择等高距");
67
+                return;
68
+            }
69
+
70
+            DGXGeneralization.dgxlayerlist = eplayerlist;
71
+            DGXGeneralization.dgj = double.Parse(comboBox_dgj.Text);
72
+            DGXGeneralization.dgxGeneralization();
73
+            this.Close();
74
+        }
75
+    }
76
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 193
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneralization.cs 查看文件

@@ -0,0 +1,193 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using System;
5
+using System.Collections;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    class DGXGeneralization
15
+    {
16
+        public static ArrayList dgxlayerlist;
17
+        public static double dgj;
18
+        public static bool openflag = true;
19
+        public static void dgxGeneralization()
20
+        {
21
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
22
+            Database db = doc.Database;
23
+            DocumentLock docLock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
24
+            //try
25
+            //{
26
+                //LayerTable lt = null;
27
+                //ArrayList layerlist = new ArrayList();
28
+
29
+                ////获取图层事务
30
+                //using (Transaction tran = doc.TransactionManager.StartTransaction())
31
+                //{
32
+                //    lt = tran.GetObject(db.LayerTableId, OpenMode.ForRead) as LayerTable;
33
+                //    foreach (ObjectId layerid in lt)
34
+                //    {
35
+                //        LayerTableRecord ltrec = tran.GetObject(layerid, OpenMode.ForWrite) as LayerTableRecord;
36
+                //        layerlist.Add(ltrec.Name);
37
+                //    }
38
+                //    doc.Editor.WriteMessage("程序开始运行\r\n......\r\n");
39
+                //    tran.Commit();
40
+                //    tran.Dispose();
41
+
42
+                //}
43
+                
44
+
45
+
46
+                //DGXSBForm sf = new DGXSBForm(layerlist);
47
+                //if (sf.ShowDialog() == DialogResult.OK)
48
+                //{
49
+                //    dgxlayerlist = sf.DGXlayerlist;
50
+                //    dgj = sf.DGJ;
51
+                //    openflag = true;
52
+                //}
53
+                if (openflag)
54
+                {
55
+                    string dgx1 = string.Empty, dgx2 = string.Empty;
56
+                    if (dgxlayerlist.Count > 0)
57
+                    {
58
+                        if (dgxlayerlist.Count == 1)
59
+                        {
60
+                            dgx1 = dgxlayerlist[0].ToString();
61
+                        }
62
+                        if (dgxlayerlist.Count == 2)
63
+                        {
64
+                            dgx1 = dgxlayerlist[0].ToString();
65
+                            dgx2 = dgxlayerlist[1].ToString();
66
+                        }
67
+                    }
68
+
69
+                    using (Transaction tran = doc.TransactionManager.StartTransaction())
70
+                    {
71
+                        
72
+                        //// 以只读方式打开块表记录   Open the Block table record for read
73
+                        BlockTable acbt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
74
+                        //// 以写方式打开模型空间块表记录   Open the Block table record Model space for write
75
+                        BlockTableRecord acblr = tran.GetObject(acbt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
76
+
77
+                        //设置激活图层
78
+                        LayerTable layertable = tran.GetObject(db.LayerTableId, OpenMode.ForWrite) as LayerTable;
79
+                        if (!layertable.Has("Delete"))
80
+                        {
81
+                            LayerTableRecord ltr = new LayerTableRecord();
82
+                            ltr.Name = "Delete";
83
+                            ObjectId layerid = layertable.Add(ltr);
84
+                            tran.AddNewlyCreatedDBObject(ltr, true);
85
+                            //db.Clayer = layerid;
86
+                        }
87
+                        if (!layertable.Has("8120"))
88
+                        {
89
+                            LayerTableRecord ltr = new LayerTableRecord();
90
+                            ltr.Name = "8120";
91
+                            ObjectId layerid = layertable.Add(ltr);
92
+                            tran.AddNewlyCreatedDBObject(ltr, true);
93
+                            //db.Clayer = layerid;
94
+                        }
95
+                        if (!layertable.Has("8110"))
96
+                        {
97
+                            LayerTableRecord ltr = new LayerTableRecord();
98
+                            ltr.Name = "8110";
99
+                            ObjectId layerid = layertable.Add(ltr);
100
+                            tran.AddNewlyCreatedDBObject(ltr, true);
101
+                            //db.Clayer = layerid;
102
+                        }
103
+                        tran.Commit();
104
+                        tran.Dispose();
105
+                        
106
+                    }
107
+                    PromptSelectionResult psr = doc.Editor.SelectAll();
108
+                    //doc.Editor.WriteMessage("请选择等高线!");
109
+                    //PromptSelectionResult psr = doc.Editor.GetSelection();
110
+                    if (psr.Status == PromptStatus.OK)
111
+                    {
112
+                        
113
+                        SelectionSet ss = psr.Value;
114
+                        foreach (ObjectId oid in ss.GetObjectIds())
115
+                        {
116
+                            using (Transaction tran = doc.TransactionManager.StartTransaction())
117
+                            {
118
+                                BlockTable acbt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
119
+                                BlockTableRecord acbtr = tran.GetObject(acbt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
120
+
121
+                                Entity en = tran.GetObject(oid, OpenMode.ForWrite) as Entity;
122
+
123
+                                if ((en.Layer == dgx1) || (en.Layer == dgx2))
124
+                                {
125
+                                    Polyline pl = new Polyline();
126
+                                    Polyline2d pl2d = new Polyline2d();
127
+                                    double elevation = 99999999;
128
+                                    if (en is Polyline)
129
+                                    {
130
+                                        pl = en as Polyline;
131
+                                        elevation = pl.Elevation;
132
+                                    }
133
+                                    else if (en is Polyline2d)
134
+                                    {
135
+                                        pl2d = en as Polyline2d;
136
+                                        elevation = pl2d.Elevation;
137
+                                    }
138
+                                    if (elevation != 99999999)
139
+                                    {
140
+                                        elevation = Convert.ToDouble(elevation.ToString("f1"));
141
+                                        if (dgj != 0)
142
+                                        {
143
+                                            double remainder = elevation % dgj;
144
+                                            if (remainder != 0.0)
145
+                                            {
146
+                                                en.Layer = "Delete";
147
+                                                en.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.Red);
148
+                                            }
149
+                                            else
150
+                                            {
151
+                                                double remainder2 = elevation % (dgj * 5);
152
+                                                if (remainder2 == 0.0)
153
+                                                {
154
+                                                    en.Layer = "8120";
155
+                                                    en.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.Yellow);
156
+                                                }
157
+                                                else
158
+                                                {
159
+                                                    en.Layer = "8110";
160
+                                                    en.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.White);
161
+                                                }
162
+                                            }
163
+                                        }
164
+
165
+                                    }
166
+
167
+                                }
168
+                                else
169
+                                    continue;
170
+                                //                            
171
+                                tran.Commit();
172
+                                tran.Dispose();
173
+                            }
174
+                        }
175
+                        doc.Editor.WriteMessage("程序运行结束,谢谢使用");
176
+                        
177
+                    }
178
+
179
+
180
+                }
181
+                else
182
+                {
183
+                    doc.Editor.WriteMessage("请选择相关参数\r\n");
184
+                }
185
+            //}
186
+            //catch (GrxCAD.Runtime.Exception ex)
187
+            //{
188
+            //    doc.Editor.WriteMessage(ex.ToString());
189
+            //}
190
+                docLock.Dispose();
191
+        }
192
+    }
193
+}

+ 150
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.Designer.cs 查看文件

@@ -0,0 +1,150 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class DeleteElept
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.label1 = new System.Windows.Forms.Label();
33
+            this.comboBox_gcd = new System.Windows.Forms.ComboBox();
34
+            this.label2 = new System.Windows.Forms.Label();
35
+            this.checkedListBox_ly = new System.Windows.Forms.CheckedListBox();
36
+            this.button_ok = new System.Windows.Forms.Button();
37
+            this.button_cancel = new System.Windows.Forms.Button();
38
+            this.label3 = new System.Windows.Forms.Label();
39
+            this.comboBox_blc = new System.Windows.Forms.ComboBox();
40
+            this.SuspendLayout();
41
+            // 
42
+            // label1
43
+            // 
44
+            this.label1.AutoSize = true;
45
+            this.label1.Location = new System.Drawing.Point(54, 28);
46
+            this.label1.Name = "label1";
47
+            this.label1.Size = new System.Drawing.Size(127, 15);
48
+            this.label1.TabIndex = 0;
49
+            this.label1.Text = "高程点所在图层:";
50
+            // 
51
+            // comboBox_gcd
52
+            // 
53
+            this.comboBox_gcd.FormattingEnabled = true;
54
+            this.comboBox_gcd.Location = new System.Drawing.Point(180, 25);
55
+            this.comboBox_gcd.Name = "comboBox_gcd";
56
+            this.comboBox_gcd.Size = new System.Drawing.Size(222, 23);
57
+            this.comboBox_gcd.TabIndex = 1;
58
+            // 
59
+            // label2
60
+            // 
61
+            this.label2.AutoSize = true;
62
+            this.label2.Location = new System.Drawing.Point(16, 111);
63
+            this.label2.Name = "label2";
64
+            this.label2.Size = new System.Drawing.Size(202, 15);
65
+            this.label2.TabIndex = 2;
66
+            this.label2.Text = "需要删除内部高程点的图层:";
67
+            // 
68
+            // checkedListBox_ly
69
+            // 
70
+            this.checkedListBox_ly.FormattingEnabled = true;
71
+            this.checkedListBox_ly.Location = new System.Drawing.Point(91, 140);
72
+            this.checkedListBox_ly.Name = "checkedListBox_ly";
73
+            this.checkedListBox_ly.Size = new System.Drawing.Size(379, 184);
74
+            this.checkedListBox_ly.TabIndex = 3;
75
+            // 
76
+            // button_ok
77
+            // 
78
+            this.button_ok.Location = new System.Drawing.Point(133, 345);
79
+            this.button_ok.Name = "button_ok";
80
+            this.button_ok.Size = new System.Drawing.Size(75, 31);
81
+            this.button_ok.TabIndex = 4;
82
+            this.button_ok.Text = "确 定";
83
+            this.button_ok.UseVisualStyleBackColor = true;
84
+            this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
85
+            // 
86
+            // button_cancel
87
+            // 
88
+            this.button_cancel.Location = new System.Drawing.Point(355, 345);
89
+            this.button_cancel.Name = "button_cancel";
90
+            this.button_cancel.Size = new System.Drawing.Size(75, 31);
91
+            this.button_cancel.TabIndex = 5;
92
+            this.button_cancel.Text = "取 消";
93
+            this.button_cancel.UseVisualStyleBackColor = true;
94
+            this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click);
95
+            // 
96
+            // label3
97
+            // 
98
+            this.label3.AutoSize = true;
99
+            this.label3.Location = new System.Drawing.Point(114, 66);
100
+            this.label3.Name = "label3";
101
+            this.label3.Size = new System.Drawing.Size(67, 15);
102
+            this.label3.TabIndex = 6;
103
+            this.label3.Text = "比例尺:";
104
+            // 
105
+            // comboBox_blc
106
+            // 
107
+            this.comboBox_blc.FormattingEnabled = true;
108
+            this.comboBox_blc.Items.AddRange(new object[] {
109
+            "1:500",
110
+            "1:1000",
111
+            "1:2000",
112
+            "1:5000"});
113
+            this.comboBox_blc.Location = new System.Drawing.Point(180, 63);
114
+            this.comboBox_blc.Name = "comboBox_blc";
115
+            this.comboBox_blc.Size = new System.Drawing.Size(222, 23);
116
+            this.comboBox_blc.TabIndex = 7;
117
+            // 
118
+            // DeleteElept
119
+            // 
120
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
121
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
122
+            this.ClientSize = new System.Drawing.Size(535, 388);
123
+            this.Controls.Add(this.comboBox_blc);
124
+            this.Controls.Add(this.label3);
125
+            this.Controls.Add(this.button_cancel);
126
+            this.Controls.Add(this.button_ok);
127
+            this.Controls.Add(this.checkedListBox_ly);
128
+            this.Controls.Add(this.label2);
129
+            this.Controls.Add(this.comboBox_gcd);
130
+            this.Controls.Add(this.label1);
131
+            this.Name = "DeleteElept";
132
+            this.Text = "删除内部高程点";
133
+            this.Load += new System.EventHandler(this.DeleteElept_Load);
134
+            this.ResumeLayout(false);
135
+            this.PerformLayout();
136
+
137
+        }
138
+
139
+        #endregion
140
+
141
+        private System.Windows.Forms.Label label1;
142
+        private System.Windows.Forms.ComboBox comboBox_gcd;
143
+        private System.Windows.Forms.Label label2;
144
+        private System.Windows.Forms.CheckedListBox checkedListBox_ly;
145
+        private System.Windows.Forms.Button button_ok;
146
+        private System.Windows.Forms.Button button_cancel;
147
+        private System.Windows.Forms.Label label3;
148
+        private System.Windows.Forms.ComboBox comboBox_blc;
149
+    }
150
+}

+ 93
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.cs 查看文件

@@ -0,0 +1,93 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class DeleteElept : Form
15
+    {
16
+        public DeleteElept()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void DeleteElept_Load(object sender, EventArgs e)
22
+        {
23
+            this.comboBox_gcd.DropDownStyle = ComboBoxStyle.DropDownList;
24
+            this.comboBox_blc.DropDownStyle = ComboBoxStyle.DropDownList;
25
+
26
+            //自动填充下拉框
27
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
28
+            using (Transaction traction = database.TransactionManager.StartTransaction())
29
+            {
30
+                //存放所有图层名
31
+                List<string> alllayername = new List<string>();
32
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
33
+                foreach (ObjectId objid in layertable)
34
+                {
35
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
36
+                    alllayername.Add(layertablerecord.Name);
37
+                }
38
+
39
+                alllayername.Sort();
40
+
41
+                for (int i = 0; i < alllayername.Count; i++)
42
+                {
43
+                    this.comboBox_gcd.Items.Add(alllayername[i]);
44
+                    this.checkedListBox_ly.Items.Add(alllayername[i]);
45
+                }
46
+
47
+                if (alllayername.Contains("8300"))
48
+                {
49
+                    int index = alllayername.IndexOf("8300");
50
+                    this.comboBox_gcd.SelectedIndex = index;
51
+                }
52
+                traction.Commit();
53
+            }
54
+        }
55
+
56
+        private void button_ok_Click(object sender, EventArgs e)
57
+        {
58
+            if (comboBox_gcd.Text == "")
59
+            { 
60
+                MessageBox.Show("请选择高程点所在图层!");
61
+                return;
62
+            }
63
+            if (comboBox_blc.Text == "")
64
+            { 
65
+                MessageBox.Show("请选择比例尺!");
66
+                return;
67
+            }
68
+            if (checkedListBox_ly.CheckedItems.Count == 0)
69
+            {
70
+                MessageBox.Show("请至少选择一个图层!");
71
+                return;
72
+            }
73
+            DeletePts.gcdly = comboBox_gcd.Text;
74
+            string blctext = comboBox_blc.Text;
75
+            int blcindex = blctext.LastIndexOf(':');
76
+            string strblc = blctext.Substring(blcindex + 1);
77
+            DeletePts.blc = Convert.ToInt32(strblc);
78
+
79
+            for (int i = 0; i < checkedListBox_ly.CheckedItems.Count; i++)
80
+            {
81
+                DeletePts.delely.Add(checkedListBox_ly.CheckedItems[i].ToString());
82
+            }
83
+            DeletePts delept = new DeletePts();
84
+            delept.delept();
85
+            this.Close();
86
+        }
87
+
88
+        private void button_cancel_Click(object sender, EventArgs e)
89
+        {
90
+            this.Close();
91
+        }
92
+    }
93
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 149
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeletePts.cs 查看文件

@@ -0,0 +1,149 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+
11
+namespace HCTools
12
+{
13
+    class DeletePts
14
+    {
15
+        public static string gcdly;//高程点所在图层
16
+        public static List<string> delely = new List<string>();//需要删除的图层
17
+        public static int blc;//比例尺
18
+        public double radius;//半径
19
+
20
+        public void delept()
21
+        {
22
+            List<ObjectId> deleids = new List<ObjectId>();
23
+            if (blc == 500)
24
+            {
25
+                radius = 1.5;
26
+            }
27
+            else if (blc == 1000)
28
+            {
29
+                radius = 2.5;
30
+            }
31
+            else if (blc == 2000)
32
+            {
33
+                radius = 4;
34
+            }
35
+            else if (blc == 5000)
36
+            {
37
+                radius = 10.5;
38
+            }
39
+            //创建新图层
40
+            LayerControl layerscontrol = new LayerControl();
41
+            string layname = "已删除";
42
+            if (!layerscontrol.haslayername(layname))
43
+            {
44
+                colorgb col = new colorgb(255, 0, 255);
45
+                layerscontrol.creatlayer(layname, col);
46
+                layerscontrol.movelayertofront(layname);
47
+            }
48
+            else
49
+                layerscontrol.movelayertofront(layname);
50
+
51
+
52
+            for (int i = 0; i < delely.Count; i++)
53
+            {
54
+                List<ObjectId> temp = Idget(delely[i]);
55
+                for (int j = 0; j < temp.Count; j++)
56
+                {
57
+                    deleids.Add(temp[j]);
58
+                }
59
+            }
60
+            Database db = HostApplicationServices.WorkingDatabase;
61
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
62
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
63
+
64
+            TypedValue[] typedvalue = new TypedValue[]
65
+            {
66
+                new TypedValue((int)DxfCode.LayerName, gcdly),
67
+                new TypedValue((int)DxfCode.Start, "Insert")
68
+            };
69
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
70
+
71
+            for (int i = 0; i < deleids.Count; i++)
72
+            {
73
+                using (Transaction trans = db.TransactionManager.StartTransaction())
74
+                {
75
+                    Entity ent = (Entity)trans.GetObject(deleids[i], OpenMode.ForWrite);
76
+                    if (ent is Polyline)
77
+                    {
78
+                        Polyline pll = (Polyline)trans.GetObject(deleids[i], OpenMode.ForWrite);
79
+                        Point3dCollection ptcoll = new Point3dCollection();
80
+                        for (int j = 0; j < pll.NumberOfVertices; j++)
81
+                        {
82
+                            ptcoll.Add(pll.GetPoint3dAt(j));
83
+                        }
84
+                        PromptSelectionResult psr = editor.SelectCrossingPolygon(ptcoll, selectionfilter);
85
+
86
+                        if (psr.Status == PromptStatus.OK)
87
+                        {
88
+                            SelectionSet selectionset = psr.Value;
89
+                            ObjectId[] ids = selectionset.GetObjectIds();
90
+                            for (int j = 0; j < ids.Count(); j++)
91
+                            {
92
+                                BlockReference br = (BlockReference)trans.GetObject(ids[j], OpenMode.ForWrite);
93
+                                br.Layer = "已删除";
94
+                                Point3d p1 = new Point3d(br.Position.X - radius, br.Position.Y - radius, 0);
95
+                                Point3d p2 = new Point3d(br.Position.X + radius, br.Position.Y + radius, 0);
96
+
97
+                                TypedValue[] tpvl = new TypedValue[]
98
+                                {
99
+                                    new TypedValue((int)DxfCode.Start, "Text"),
100
+                                    new TypedValue((int)DxfCode.LayerName, gcdly)
101
+                                };
102
+
103
+                                SelectionFilter filter = new SelectionFilter(tpvl);
104
+                                PromptSelectionResult prosr = editor.SelectCrossingWindow(p1, p2, filter);
105
+
106
+                                if (prosr.Status == PromptStatus.OK)
107
+                                {
108
+                                    SelectionSet seleset = prosr.Value;
109
+                                    ObjectId[] selid = seleset.GetObjectIds();
110
+                                    for (int ii = 0; ii < selid.Count(); ii++)
111
+                                    {
112
+                                        DBText text = trans.GetObject(selid[ii], OpenMode.ForWrite) as DBText;
113
+                                        text.Layer = "已删除";
114
+                                    }
115
+                                }
116
+                            }
117
+                        }
118
+                        trans.Commit();
119
+                    }
120
+                }
121
+            }
122
+            editor.WriteMessage("删除完成\n");
123
+            doclock.Dispose();
124
+        }
125
+
126
+        private static List<ObjectId> Idget(string ly)
127
+        {
128
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
129
+            TypedValue[] typedvalue = new TypedValue[1];
130
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, ly), 0);
131
+
132
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
133
+            PromptSelectionResult psr = editor.SelectAll(selectionfilter);
134
+            SelectionSet selectionset = psr.Value;
135
+            ObjectId[] obj = new ObjectId[selectionset.Count];
136
+            List<ObjectId> ids = new List<ObjectId>();
137
+
138
+            if (psr.Status == PromptStatus.OK)
139
+            {
140
+                obj = selectionset.GetObjectIds();
141
+                for (int i = 0; i < obj.Length; i++)
142
+                {
143
+                    ids.Add(obj[i]);
144
+                }
145
+            }
146
+            return ids;
147
+        }
148
+    }
149
+}

+ 153
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnnck.cs 查看文件

@@ -0,0 +1,153 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+
11
+namespace HCTools
12
+{
13
+    class DgxAnnck
14
+    {
15
+        public static string ptlayer;
16
+        public static string tklayer;
17
+        public static double density;
18
+        public static int flag;
19
+
20
+        public void check()
21
+        {
22
+            ObjectId[] ids = TKget();
23
+
24
+            Database db = HostApplicationServices.WorkingDatabase;
25
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
26
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
27
+
28
+            TypedValue[] typedvalue = new TypedValue[1];
29
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, ptlayer), 0);
30
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
31
+
32
+            for (int i = 0; i < ids.Length; i++)
33
+            {
34
+                Entity current_entity = BasicFunction.GetDBObject(ids[i]);
35
+                ZoomToExtent(current_entity.GeometricExtents);
36
+                using (Transaction trans = db.TransactionManager.StartTransaction())
37
+                {
38
+                    Polyline pll = (Polyline)trans.GetObject(ids[i], OpenMode.ForWrite);
39
+                    Point3dCollection ptcoll = new Point3dCollection();
40
+                    for (int j = 0; j < pll.NumberOfVertices; j++)
41
+                    {
42
+                        ptcoll.Add(pll.GetPoint3dAt(j));
43
+                    }
44
+                    PromptSelectionResult psr = editor.SelectCrossingPolygon(ptcoll, selectionfilter);
45
+
46
+                    if (psr.Status == PromptStatus.OK)
47
+                    {
48
+                        SelectionSet selectionset = psr.Value;
49
+                        int ptnums = selectionset.Count;
50
+                        double den = ptnums / pll.Area;
51
+                        if (den < density && flag == 1)
52
+                        {
53
+                            LayerControl layerscontrol = new LayerControl();
54
+                            string layname = "小于密度";
55
+                            if (!layerscontrol.haslayername(layname))
56
+                            {
57
+                                colorgb col = new colorgb(0, 0, 255);
58
+                                layerscontrol.creatlayer(layname, col);
59
+                                pll.Layer = "小于密度";
60
+                            }
61
+                            else
62
+                                pll.Layer = "小于密度";
63
+                        }
64
+                        else if (den > density && flag == 2)
65
+                        {
66
+                            LayerControl layerscontrol = new LayerControl();
67
+                            string layname = "大于密度";
68
+                            if (!layerscontrol.haslayername(layname))
69
+                            {
70
+                                colorgb col = new colorgb(255, 0, 0);
71
+                                layerscontrol.creatlayer(layname, col);
72
+                                pll.Layer = "大于密度";
73
+                            }
74
+                            else
75
+                                pll.Layer = "大于密度";
76
+                        }
77
+                        else if (flag == 3)
78
+                        {
79
+                            if (den < density || den > density)
80
+                            {
81
+                                LayerControl layerscontrol = new LayerControl();
82
+                                string layname = "不等于密度";
83
+                                if (!layerscontrol.haslayername(layname))
84
+                                {
85
+                                    colorgb col = new colorgb(255, 255, 0);
86
+                                    layerscontrol.creatlayer(layname, col);
87
+                                    pll.Layer = "不等于密度";
88
+                                }
89
+                                else
90
+                                    pll.Layer = "不等于密度";
91
+                            }
92
+                        }
93
+                    }
94
+                    trans.Commit();
95
+                }
96
+            }
97
+            doclock.Dispose();
98
+        }
99
+
100
+        private static ObjectId[] TKget()
101
+        {
102
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
103
+            TypedValue[] typedvalue = new TypedValue[1];
104
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, tklayer), 0);
105
+
106
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
107
+            PromptSelectionResult psr = editor.SelectAll(selectionfilter);
108
+            SelectionSet selectionset = psr.Value;
109
+            ObjectId[] obj = new ObjectId[selectionset.Count];
110
+
111
+            if (psr.Status == PromptStatus.OK)
112
+            {
113
+                obj = selectionset.GetObjectIds();
114
+            }
115
+            return obj;
116
+        }
117
+
118
+        public static void ZoomToExtent(Extents3d extent)
119
+        {
120
+            try
121
+            {
122
+                Point3d pMin = extent.MinPoint;
123
+                Point3d pMax = extent.MaxPoint;
124
+                //获取当前文档及数据库
125
+                Document acDoc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
126
+                Database acCurDb = acDoc.Database;
127
+
128
+                // 启动事务
129
+                using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
130
+                {
131
+                    using (ViewTableRecord acView = acDoc.Editor.GetCurrentView())
132
+                    {
133
+                        //设置视图的高
134
+                        acView.Height = Math.Abs(pMin.Y - pMax.Y);
135
+                        //设置视图的宽
136
+                        acView.Width = Math.Abs(pMin.X - pMax.X);
137
+                        // 设置视图中心
138
+                        acView.CenterPoint = new Point2d((pMin.X + pMax.X) / 2, (pMin.Y + pMax.Y) / 2);
139
+                        // 更新当前视图
140
+                        acDoc.Editor.SetCurrentView(acView);
141
+                    }
142
+                    // 提交更改
143
+                    acTrans.Commit();
144
+                }
145
+            }
146
+            catch (Exception)
147
+            {
148
+
149
+                throw;
150
+            }
151
+        }
152
+    }
153
+}

+ 170
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.Designer.cs 查看文件

@@ -0,0 +1,170 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class DgxAnno
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.checkBox_below = new System.Windows.Forms.CheckBox();
33
+            this.checkBox_upon = new System.Windows.Forms.CheckBox();
34
+            this.textBox_density = new System.Windows.Forms.TextBox();
35
+            this.label3 = new System.Windows.Forms.Label();
36
+            this.button_cancel = new System.Windows.Forms.Button();
37
+            this.button_ok = new System.Windows.Forms.Button();
38
+            this.comboBox_gw = new System.Windows.Forms.ComboBox();
39
+            this.comboBox_ptLayer = new System.Windows.Forms.ComboBox();
40
+            this.label2 = new System.Windows.Forms.Label();
41
+            this.label1 = new System.Windows.Forms.Label();
42
+            this.SuspendLayout();
43
+            // 
44
+            // checkBox_below
45
+            // 
46
+            this.checkBox_below.AutoSize = true;
47
+            this.checkBox_below.Location = new System.Drawing.Point(236, 135);
48
+            this.checkBox_below.Name = "checkBox_below";
49
+            this.checkBox_below.Size = new System.Drawing.Size(89, 19);
50
+            this.checkBox_below.TabIndex = 21;
51
+            this.checkBox_below.Text = "小于密度";
52
+            this.checkBox_below.UseVisualStyleBackColor = true;
53
+            // 
54
+            // checkBox_upon
55
+            // 
56
+            this.checkBox_upon.AutoSize = true;
57
+            this.checkBox_upon.Location = new System.Drawing.Point(346, 135);
58
+            this.checkBox_upon.Name = "checkBox_upon";
59
+            this.checkBox_upon.Size = new System.Drawing.Size(89, 19);
60
+            this.checkBox_upon.TabIndex = 20;
61
+            this.checkBox_upon.Text = "大于密度";
62
+            this.checkBox_upon.UseVisualStyleBackColor = true;
63
+            // 
64
+            // textBox_density
65
+            // 
66
+            this.textBox_density.Location = new System.Drawing.Point(104, 133);
67
+            this.textBox_density.Name = "textBox_density";
68
+            this.textBox_density.Size = new System.Drawing.Size(100, 25);
69
+            this.textBox_density.TabIndex = 19;
70
+            // 
71
+            // label3
72
+            // 
73
+            this.label3.AutoSize = true;
74
+            this.label3.Location = new System.Drawing.Point(46, 139);
75
+            this.label3.Name = "label3";
76
+            this.label3.Size = new System.Drawing.Size(52, 15);
77
+            this.label3.TabIndex = 18;
78
+            this.label3.Text = "密度:";
79
+            // 
80
+            // button_cancel
81
+            // 
82
+            this.button_cancel.Location = new System.Drawing.Point(290, 178);
83
+            this.button_cancel.Name = "button_cancel";
84
+            this.button_cancel.Size = new System.Drawing.Size(75, 29);
85
+            this.button_cancel.TabIndex = 17;
86
+            this.button_cancel.Text = "取 消";
87
+            this.button_cancel.UseVisualStyleBackColor = true;
88
+            this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click);
89
+            // 
90
+            // button_ok
91
+            // 
92
+            this.button_ok.Location = new System.Drawing.Point(100, 178);
93
+            this.button_ok.Name = "button_ok";
94
+            this.button_ok.Size = new System.Drawing.Size(75, 29);
95
+            this.button_ok.TabIndex = 16;
96
+            this.button_ok.Text = "确 定";
97
+            this.button_ok.UseVisualStyleBackColor = true;
98
+            this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
99
+            // 
100
+            // comboBox_gw
101
+            // 
102
+            this.comboBox_gw.FormattingEnabled = true;
103
+            this.comboBox_gw.Location = new System.Drawing.Point(185, 83);
104
+            this.comboBox_gw.Name = "comboBox_gw";
105
+            this.comboBox_gw.Size = new System.Drawing.Size(197, 23);
106
+            this.comboBox_gw.TabIndex = 15;
107
+            // 
108
+            // comboBox_ptLayer
109
+            // 
110
+            this.comboBox_ptLayer.FormattingEnabled = true;
111
+            this.comboBox_ptLayer.Location = new System.Drawing.Point(185, 34);
112
+            this.comboBox_ptLayer.Name = "comboBox_ptLayer";
113
+            this.comboBox_ptLayer.Size = new System.Drawing.Size(197, 23);
114
+            this.comboBox_ptLayer.TabIndex = 14;
115
+            // 
116
+            // label2
117
+            // 
118
+            this.label2.AutoSize = true;
119
+            this.label2.Location = new System.Drawing.Point(67, 86);
120
+            this.label2.Name = "label2";
121
+            this.label2.Size = new System.Drawing.Size(112, 15);
122
+            this.label2.TabIndex = 13;
123
+            this.label2.Text = "格网所在图层:";
124
+            // 
125
+            // label1
126
+            // 
127
+            this.label1.AutoSize = true;
128
+            this.label1.Location = new System.Drawing.Point(22, 37);
129
+            this.label1.Name = "label1";
130
+            this.label1.Size = new System.Drawing.Size(157, 15);
131
+            this.label1.TabIndex = 12;
132
+            this.label1.Text = "等高线注记所在图层:";
133
+            // 
134
+            // DgxAnno
135
+            // 
136
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
137
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138
+            this.ClientSize = new System.Drawing.Size(478, 232);
139
+            this.Controls.Add(this.checkBox_below);
140
+            this.Controls.Add(this.checkBox_upon);
141
+            this.Controls.Add(this.textBox_density);
142
+            this.Controls.Add(this.label3);
143
+            this.Controls.Add(this.button_cancel);
144
+            this.Controls.Add(this.button_ok);
145
+            this.Controls.Add(this.comboBox_gw);
146
+            this.Controls.Add(this.comboBox_ptLayer);
147
+            this.Controls.Add(this.label2);
148
+            this.Controls.Add(this.label1);
149
+            this.Name = "DgxAnno";
150
+            this.Text = "等高线高程注记密度检查";
151
+            this.Load += new System.EventHandler(this.DgxAnno_Load);
152
+            this.ResumeLayout(false);
153
+            this.PerformLayout();
154
+
155
+        }
156
+
157
+        #endregion
158
+
159
+        private System.Windows.Forms.CheckBox checkBox_below;
160
+        private System.Windows.Forms.CheckBox checkBox_upon;
161
+        private System.Windows.Forms.TextBox textBox_density;
162
+        private System.Windows.Forms.Label label3;
163
+        private System.Windows.Forms.Button button_cancel;
164
+        private System.Windows.Forms.Button button_ok;
165
+        private System.Windows.Forms.ComboBox comboBox_gw;
166
+        private System.Windows.Forms.ComboBox comboBox_ptLayer;
167
+        private System.Windows.Forms.Label label2;
168
+        private System.Windows.Forms.Label label1;
169
+    }
170
+}

+ 101
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.cs 查看文件

@@ -0,0 +1,101 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class DgxAnno : Form
15
+    {
16
+        public DgxAnno()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void DgxAnno_Load(object sender, EventArgs e)
22
+        {
23
+            this.comboBox_ptLayer.DropDownStyle = ComboBoxStyle.DropDownList;
24
+            this.comboBox_gw.DropDownStyle = ComboBoxStyle.DropDownList;
25
+
26
+            this.MaximizeBox = false;
27
+            this.StartPosition = FormStartPosition.CenterScreen;
28
+
29
+            //自动填充下拉框
30
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
31
+            using (Transaction traction = database.TransactionManager.StartTransaction())
32
+            {
33
+                //存放所有图层名
34
+                List<string> alllayername = new List<string>();
35
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
36
+                foreach (ObjectId objid in layertable)
37
+                {
38
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
39
+                    alllayername.Add(layertablerecord.Name);
40
+                }
41
+
42
+                alllayername.Sort();
43
+
44
+                for (int i = 0; i < alllayername.Count; i++)
45
+                {
46
+                    this.comboBox_ptLayer.Items.Add(alllayername[i]);
47
+                    this.comboBox_gw.Items.Add(alllayername[i]);
48
+                }
49
+
50
+                if (alllayername.Contains("8121"))
51
+                {
52
+                    int index = alllayername.IndexOf("8121");
53
+                    this.comboBox_ptLayer.SelectedIndex = index;
54
+                }
55
+                traction.Commit();
56
+            }
57
+        }
58
+
59
+        private void button_ok_Click(object sender, EventArgs e)
60
+        {
61
+            if (comboBox_ptLayer.Text == "")
62
+            {
63
+                MessageBox.Show("请选择等高线注记所在图层!");
64
+                return;
65
+            }
66
+            if (comboBox_gw.Text == "")
67
+            {
68
+                MessageBox.Show("请选择格网所在图层!");
69
+                return;
70
+            }
71
+            if (textBox_density.Text == "")
72
+            {
73
+                MessageBox.Show("请输入密度!");
74
+                return;
75
+            }
76
+            DgxAnnck.ptlayer = comboBox_ptLayer.Text;
77
+            DgxAnnck.tklayer = comboBox_gw.Text;
78
+            DgxAnnck.density = Convert.ToDouble(textBox_density.Text);
79
+            if (checkBox_below.Checked && !checkBox_upon.Checked)
80
+                DgxAnnck.flag = 1;
81
+            else if (!checkBox_below.Checked && checkBox_upon.Checked)
82
+                DgxAnnck.flag = 2;
83
+            else if (checkBox_below.Checked && checkBox_upon.Checked)
84
+                DgxAnnck.flag = 3;
85
+            else if (!checkBox_below.Checked && !checkBox_upon.Checked)
86
+            {
87
+                MessageBox.Show("请选择“大于密度”/“小于密度”!");
88
+                return;
89
+            }
90
+
91
+            DgxAnnck dgx = new DgxAnnck();
92
+            dgx.check();
93
+            this.Close();
94
+        }
95
+
96
+        private void button_cancel_Click(object sender, EventArgs e)
97
+        {
98
+            this.Close();
99
+        }
100
+    }
101
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 97
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.Designer.cs 查看文件

@@ -0,0 +1,97 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class Dgxinterpl
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.label1 = new System.Windows.Forms.Label();
33
+            this.textBox_dgj = new System.Windows.Forms.TextBox();
34
+            this.button_ok = new System.Windows.Forms.Button();
35
+            this.button_cancel = new System.Windows.Forms.Button();
36
+            this.SuspendLayout();
37
+            // 
38
+            // label1
39
+            // 
40
+            this.label1.AutoSize = true;
41
+            this.label1.Location = new System.Drawing.Point(55, 44);
42
+            this.label1.Name = "label1";
43
+            this.label1.Size = new System.Drawing.Size(67, 15);
44
+            this.label1.TabIndex = 0;
45
+            this.label1.Text = "等高距:";
46
+            // 
47
+            // textBox_dgj
48
+            // 
49
+            this.textBox_dgj.Location = new System.Drawing.Point(139, 41);
50
+            this.textBox_dgj.Name = "textBox_dgj";
51
+            this.textBox_dgj.Size = new System.Drawing.Size(157, 25);
52
+            this.textBox_dgj.TabIndex = 1;
53
+            // 
54
+            // button_ok
55
+            // 
56
+            this.button_ok.Location = new System.Drawing.Point(47, 84);
57
+            this.button_ok.Name = "button_ok";
58
+            this.button_ok.Size = new System.Drawing.Size(75, 34);
59
+            this.button_ok.TabIndex = 2;
60
+            this.button_ok.Text = "确 定";
61
+            this.button_ok.UseVisualStyleBackColor = true;
62
+            this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
63
+            // 
64
+            // button_cancel
65
+            // 
66
+            this.button_cancel.Location = new System.Drawing.Point(256, 84);
67
+            this.button_cancel.Name = "button_cancel";
68
+            this.button_cancel.Size = new System.Drawing.Size(75, 34);
69
+            this.button_cancel.TabIndex = 3;
70
+            this.button_cancel.Text = "取 消";
71
+            this.button_cancel.UseVisualStyleBackColor = true;
72
+            this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click);
73
+            // 
74
+            // Dgxinterpl
75
+            // 
76
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
77
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
78
+            this.ClientSize = new System.Drawing.Size(375, 145);
79
+            this.Controls.Add(this.button_cancel);
80
+            this.Controls.Add(this.button_ok);
81
+            this.Controls.Add(this.textBox_dgj);
82
+            this.Controls.Add(this.label1);
83
+            this.Name = "Dgxinterpl";
84
+            this.Text = "Dgxinterpl";
85
+            this.ResumeLayout(false);
86
+            this.PerformLayout();
87
+
88
+        }
89
+
90
+        #endregion
91
+
92
+        private System.Windows.Forms.Label label1;
93
+        private System.Windows.Forms.TextBox textBox_dgj;
94
+        private System.Windows.Forms.Button button_ok;
95
+        private System.Windows.Forms.Button button_cancel;
96
+    }
97
+}

+ 38
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.cs 查看文件

@@ -0,0 +1,38 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+using System.Windows.Forms;
10
+
11
+namespace HCTools
12
+{
13
+    public partial class Dgxinterpl : Form
14
+    {
15
+        public Dgxinterpl()
16
+        {
17
+            InitializeComponent();
18
+        }
19
+
20
+        private void button_ok_Click(object sender, EventArgs e)
21
+        {
22
+            if (textBox_dgj.Text == "")
23
+            {
24
+                MessageBox.Show("请输入等高距!");
25
+                return;
26
+            }
27
+            Dgxinters.dgj = Convert.ToInt32(textBox_dgj.Text);
28
+            Dgxinters dgxinter = new Dgxinters();
29
+            this.Close();
30
+            dgxinter.Interdgx();
31
+        }
32
+
33
+        private void button_cancel_Click(object sender, EventArgs e)
34
+        {
35
+            this.Close();
36
+        }
37
+    }
38
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 351
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinters.cs 查看文件

@@ -0,0 +1,351 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+
11
+namespace HCTools
12
+{
13
+    class Dgxinters
14
+    {
15
+        public struct Dgx_ct
16
+        {
17
+            public Polyline pll;
18
+            public double elevation;
19
+        }
20
+
21
+        public struct Angles
22
+        {
23
+            public double angle;
24
+            public int xh;
25
+        }
26
+
27
+        public static int dgj;
28
+        public void Interdgx()
29
+        {
30
+            Line jigl1 = Fzx();
31
+            Line jigl2 = Fzx();
32
+            List<Point3d> ptonline = new List<Point3d>();//两辅助拉线之间的线段上的点
33
+
34
+            Point3dCollection ptcoll = new Point3dCollection();
35
+            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
36
+            ptcoll.Add(jigl1.StartPoint);
37
+            ptcoll.Add(jigl1.EndPoint);
38
+
39
+            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
40
+            TypedValue[] value = new TypedValue[]
41
+                {
42
+                new TypedValue((int)DxfCode.Start,"LWPOLYLINE"),
43
+                };//设置筛选条件
44
+            SelectionFilter filter = new SelectionFilter(value);
45
+            // 要求在图形区域中手动选择对象
46
+            PromptSelectionResult psr = ed.SelectFence(ptcoll, filter);
47
+
48
+            if (psr.Status == PromptStatus.OK)
49
+            {
50
+                SelectionSet ss = psr.Value;
51
+                ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
52
+                List<Dgx_ct> dgx_ct = new List<Dgx_ct>();
53
+                for (int i = 0; i < idcoll.Count; i++)
54
+                {
55
+                    Dgx_ct temp = getpll(idcoll[i]);
56
+                    dgx_ct.Add(temp);
57
+                }
58
+                dgx_ct.OrderByDescending(x => x.elevation);
59
+
60
+                for (int i = 0; i < dgx_ct.Count - 1; i++)
61
+                {
62
+                    Point3dCollection itsresult1 = new Point3dCollection();
63
+                    Point3dCollection itsresult2 = new Point3dCollection();
64
+                    dgx_ct[i].pll.IntersectWith(jigl1, Intersect.OnBothOperands, plane, itsresult1, IntPtr.Zero, IntPtr.Zero);
65
+                    dgx_ct[i].pll.IntersectWith(jigl2, Intersect.OnBothOperands, plane, itsresult2, IntPtr.Zero, IntPtr.Zero);
66
+                    Point3d start = itsresult1[0];
67
+                    Point3d end = itsresult2[0];
68
+                    List<Point3d> pts1 = GetPtsBetweenpts(dgx_ct[i].pll, start, end);
69
+
70
+                    itsresult1 = new Point3dCollection();
71
+                    itsresult2 = new Point3dCollection();
72
+                    dgx_ct[i + 1].pll.IntersectWith(jigl1, Intersect.OnBothOperands, plane, itsresult1, IntPtr.Zero, IntPtr.Zero);
73
+                    dgx_ct[i + 1].pll.IntersectWith(jigl2, Intersect.OnBothOperands, plane, itsresult2, IntPtr.Zero, IntPtr.Zero);
74
+                    Point3d start1 = itsresult1[0];
75
+                    Point3d end1 = itsresult2[0];
76
+                    List<Point3d> pts2 = GetPtsBetweenpts(dgx_ct[i + 1].pll, start1, end1);
77
+                    List<Point3d> linearinterpt = new List<Point3d>();
78
+
79
+                    double gcc = dgx_ct[i + 1].pll.Elevation - dgx_ct[i].pll.Elevation;
80
+                    for (int ii = 0; ii < gcc / dgj; ii++)
81
+                    {
82
+                        double targetgc = dgx_ct[i].pll.Elevation + dgj * (ii + 1);
83
+                        Interpolationpts(pts1, pts2, targetgc);
84
+                    }
85
+                }
86
+                ed.WriteMessage("\n等高线内插完成");
87
+            }
88
+        }
89
+
90
+
91
+        private static Line Fzx()
92
+        {
93
+            Document doc = Application.DocumentManager.MdiActiveDocument;
94
+            Line jigl = new Line();
95
+
96
+            ObjectId jigid = new ObjectId();
97
+            PromptPointResult pPtRes;
98
+            PromptPointOptions pPtOpts = new PromptPointOptions("");
99
+            pPtOpts.Message = "选择起点\n ";
100
+            pPtRes = doc.Editor.GetPoint(pPtOpts);
101
+            Point3d ptStart = pPtRes.Value;
102
+
103
+            if (pPtRes.Status == PromptStatus.OK)
104
+            {
105
+                LineJig lJig = new LineJig(ptStart);
106
+                PromptResult PR = doc.Editor.Drag(lJig);
107
+                if (PR.Status == PromptStatus.OK)
108
+                {
109
+                    jigid = BasicFunction.AddObj(doc, lJig.line_1);
110
+                    jigl = (Line)BasicFunction.GetDBObject(jigid);
111
+                }
112
+            }
113
+            return jigl;
114
+        }
115
+
116
+        private static Dgx_ct getpll(ObjectId id)
117
+        {
118
+            Dgx_ct dgx_ct = new Dgx_ct();
119
+            Polyline temp = (Polyline)BasicFunction.GetDBObject(id);
120
+            dgx_ct.pll = temp;
121
+            dgx_ct.elevation = Convert.ToDouble(temp.Elevation.ToString("0.00"));
122
+            return dgx_ct;
123
+        }
124
+
125
+        private static List<Point3d> GetPtsBetweenpts(Polyline pll, Point3d start, Point3d end)
126
+        {
127
+            List<Point3d> allvertex = new List<Point3d>();
128
+            List<Point3d> vertexbt = new List<Point3d>();
129
+            vertexbt.Add(start);
130
+            for (int i = 0; i < pll.NumberOfVertices; i++)
131
+            {
132
+                allvertex.Add(pll.GetPoint3dAt(i));
133
+            }
134
+            double dist1 = double.MaxValue;
135
+            int start_index = 0;
136
+            double dist2 = double.MaxValue;
137
+            int end_index = 0;
138
+            bool sort = false;
139
+            for (int i = 0; i < allvertex.Count; i++)
140
+            {
141
+                if (start.DistanceTo(allvertex[i]) < dist1)
142
+                {
143
+                    dist1 = start.DistanceTo(allvertex[i]);
144
+                    start_index = i;
145
+                }
146
+                if (end.DistanceTo(allvertex[i]) < dist2)
147
+                {
148
+                    dist2 = end.DistanceTo(allvertex[i]);
149
+                    end_index = i;
150
+                }
151
+            }
152
+            if (start_index > end_index)
153
+            {
154
+                int temp = start_index;
155
+                start_index = end_index;
156
+                end_index = temp;
157
+                sort = true;
158
+            }
159
+            for (int i = start_index; i < end_index + 1; i++)
160
+            {
161
+                if (!vertexbt.Contains(allvertex[i]))
162
+                {
163
+                    vertexbt.Add(allvertex[i]);
164
+                    if (i == end_index && !vertexbt.Contains(end))
165
+                        vertexbt.Add(end);
166
+                }
167
+            }
168
+            if (sort)
169
+                vertexbt.Reverse();
170
+            return vertexbt;
171
+        }
172
+
173
+        private static double CalculateAngles(Point3d pt1, Point3d pt2, Point3d pt3)
174
+        {
175
+            //计算角度
176
+            Vector3d vectorAB = pt1.GetVectorTo(pt2);
177
+            Vector3d vectorBC = pt2.GetVectorTo(pt3);
178
+
179
+            double dotProduct = vectorAB.DotProduct(vectorBC);
180
+
181
+            // 计算两个向量的长度  
182
+            double lengthAB = vectorAB.Length;
183
+            double lengthBC = vectorBC.Length;
184
+
185
+            double angleDegrees = new double();
186
+            // 防止除以零的错误  
187
+            if (lengthAB > 0 && lengthBC > 0)
188
+            {
189
+                // 计算两个向量之间夹角的余弦值  
190
+                double cosAngle = dotProduct / (lengthAB * lengthBC);
191
+
192
+                // 使用反余弦函数计算夹角(以弧度为单位)  
193
+                double angleRadians = Math.Acos(cosAngle);
194
+
195
+                // 将弧度转换为度  
196
+                angleDegrees = angleRadians * (180.0 / Math.PI);
197
+            }
198
+            return angleDegrees;
199
+        }
200
+
201
+        private static bool LineIntersect(double x1, double y1, double x2, double y2,
202
+                                          double x3, double y3, double x4, double y4)
203
+        {
204
+            double d1x = x2 - x1;
205
+            double d1y = y2 - y1;
206
+            double d2x = x4 - x3;
207
+            double d2y = y4 - y3;
208
+
209
+            // 计算点1和点2相对于线段CD的叉积  
210
+            double cp1 = d2x * (y1 - y3) - (x1 - x3) * d2y;
211
+            double cp2 = d2x * (y2 - y3) - (x2 - x3) * d2y;
212
+
213
+            // 如果点1和点2相对于线段CD的叉积符号相反,则它们跨立在CD的两侧  
214
+            if (cp1 * cp2 < 0)
215
+            {
216
+                // 计算点3和点4相对于线段AB的叉积  
217
+                double cp3 = d1x * (y3 - y1) - (x3 - x1) * d1y;
218
+                double cp4 = d1x * (y4 - y1) - (x4 - x1) * d1y;
219
+
220
+                // 如果点3和点4相对于线段AB的叉积符号也相反,则它们跨立在AB的两侧  
221
+                if (cp3 * cp4 < 0)
222
+                {
223
+                    // 根据跨立实验,如果以上条件都满足,则线段一定相交  
224
+                    return true;
225
+                }
226
+            }
227
+            // 线段不相交  
228
+            return false;
229
+        }
230
+
231
+        private static Point3d Interpolation(Point3d p1, Point3d p2, double targetZ)
232
+        {
233
+            double t = (targetZ - p1.Z) / dgj;
234
+            double x = p1.X + t * (p2.X - p1.X);
235
+            double y = p1.Y + t * (p2.Y - p1.Y);
236
+            return new Point3d(x, y, targetZ);
237
+        }
238
+
239
+        public static void Interpolationpts(List<Point3d> pts1, List<Point3d> pts2, double targetgc)
240
+        {
241
+            Point3d pt1 = pts1[0];
242
+            Point3d pt2 = pts2[0];
243
+            List<Point3d> itspt = new List<Point3d>();
244
+            int index1 = 0;
245
+            int index2 = 0;
246
+            List<Point3d> interplpts = new List<Point3d>();
247
+            for (int i = 0; i < pts1.Count; i++)
248
+            {
249
+                List<Angles> angle1 = new List<Angles>();//等高线1上的点
250
+                List<Angles> angle2 = new List<Angles>();//等高线2上的点
251
+                List<int> errindex1 = new List<int>();
252
+                List<int> errindex2 = new List<int>();
253
+                bool flag = false;
254
+
255
+                for (int j = i; j < pts1.Count - 1; j++)
256
+                {
257
+                    if (errindex1.Contains(j))
258
+                        continue;
259
+                    else
260
+                    {
261
+                        double angle = CalculateAngles(pt1, pts1[j + 1], pt2);
262
+                        Angles temp = new Angles();
263
+                        temp.angle = angle;
264
+                        temp.xh = j;
265
+                        angle1.Add(temp);
266
+                    }
267
+                }
268
+                for (int j = i; j < pts2.Count - 1; j++)
269
+                {
270
+                    if (errindex2.Contains(j))
271
+                        continue;
272
+                    else
273
+                    {
274
+                        double angle = CalculateAngles(pt1, pts2[j + 1], pt2);
275
+                        Angles temp = new Angles();
276
+                        temp.angle = angle;
277
+                        temp.xh = j;
278
+                        angle2.Add(temp);
279
+                    }
280
+                }
281
+                angle1.OrderByDescending(x => x.angle);
282
+                angle2.OrderByDescending(x => x.angle);
283
+                while (flag)
284
+                {
285
+                    double px = pts1[angle1[0].xh].X;
286
+                    double py = pts1[angle1[0].xh].Y;
287
+                    double qx = pts1[angle2[0].xh].X;
288
+                    double qy = pts1[angle2[0].xh].Y;
289
+                    double dx1 = pt1.X - px;
290
+                    double dy1 = pt1.Y - py;
291
+                    double dx2 = pt2.X - qx;
292
+                    double dy2 = pt2.Y - qy;
293
+                    bool interck1 = LineIntersect(pt1.X, pt1.Y, pts1[index1].X, pts1[index1].Y, pt2.X, pt2.Y, px, py);
294
+                    bool interck2 = LineIntersect(pt1.X, pt1.Y, px, py, pt2.X, pt2.Y, pts2[index2].X, pts2[index2].Y);
295
+                    bool interck3 = LineIntersect(pt1.X, pt1.Y, qx, qy, pt2.X, pt2.Y, pts2[index2].X, pts2[index2].Y);
296
+                    bool interck4 = LineIntersect(pt1.X, pt1.Y, pts1[index1].X, pts1[index1].Y, pt2.X, pt2.Y, qx, qy);
297
+                    if (interck1 & interck2)
298
+                    {
299
+                        if (interck3 & interck4)
300
+                        {
301
+                            if (angle1[0].angle > angle2[0].angle)
302
+                            {
303
+                                for (int ii = index1 + 1; ii < angle1[0].xh; ii++)
304
+                                {
305
+                                    Point3d pt = Interpolation(pt2, pts1[ii], targetgc);
306
+                                    itspt.Add(pt);
307
+                                    if(ii)
308
+                                    pt1 = pts1[ii];
309
+                                }
310
+                                flag = true;
311
+                            }
312
+                            else
313
+                            {
314
+                                
315
+                            }
316
+                        }
317
+                        else
318
+                        {
319
+                            angle2.RemoveAt(0);
320
+                            continue;
321
+                        }
322
+                    }
323
+                    else
324
+                    {
325
+                        angle1.RemoveAt(0);
326
+                        continue;
327
+                    }
328
+                }
329
+            }
330
+
331
+            Database db = HostApplicationServices.WorkingDatabase;
332
+            Document doc = Application.DocumentManager.MdiActiveDocument;
333
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
334
+            using (Transaction trans = db.TransactionManager.StartTransaction())
335
+            {
336
+                BlockTable blocktable = trans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
337
+                BlockTableRecord blctablerecord = trans.GetObject(blocktable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
338
+
339
+                Polyline pll = new Polyline();
340
+                for (int i = 0; i < itspt.Count; i++)
341
+                {
342
+                    pll.AddVertexAt(i, new Point2d(itspt[i].X, itspt[i].Y), 0, 0, 0);
343
+                }
344
+                blctablerecord.AppendEntity(pll);
345
+                trans.AddNewlyCreatedDBObject(pll, true);
346
+                trans.Commit();
347
+            }
348
+            doclock.Dispose();
349
+        }
350
+    }
351
+}

+ 398
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd.cs 查看文件

@@ -0,0 +1,398 @@
1
+using GrxCAD.DatabaseServices;
2
+using GrxCAD.EditorInput;
3
+using GrxCAD.Geometry;
4
+using System;
5
+using System.Collections.Generic;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace HCTools
11
+{
12
+    class Dgxthrorvrd
13
+    {
14
+        public static List<string> dgxlist;
15
+        public static List<string> rvrdlist;
16
+        public static List<string> kzlist;
17
+        public static int blc;
18
+
19
+
20
+        public void DgxCut()
21
+        {
22
+            string dgxname= "";
23
+            Database db = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
24
+            using (Transaction trans = db.TransactionManager.StartTransaction())
25
+            {
26
+                Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
27
+                LayerTable layerTable = trans.GetObject(db.LayerTableId, OpenMode.ForRead) as LayerTable;
28
+                for (int i = 0; i < dgxlist.Count; i++)
29
+                {
30
+                    if (i == 0)
31
+                        dgxname = dgxlist[i];
32
+                    else
33
+                        dgxname = dgxname + "," + dgxlist[i];
34
+                }
35
+                TypedValue[] value = new TypedValue[]
36
+                {
37
+                    new TypedValue((int)DxfCode.LayerName,dgxname)
38
+                };
39
+                SelectionFilter filter = new SelectionFilter(value);
40
+                PromptSelectionResult psr = ed.SelectAll(filter);
41
+                if (psr.Status == PromptStatus.OK)
42
+                {
43
+                    SelectionSet ss = psr.Value;
44
+                    ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
45
+                    for (int ii = 0; ii < idcoll.Count; ii++)
46
+                    {
47
+                        Polyline pll = trans.GetObject(idcoll[ii], OpenMode.ForWrite) as Polyline;
48
+                        Intersectcheck(pll, ed, trans, db);
49
+                    }
50
+                }
51
+                trans.Commit();
52
+            }
53
+            dgxlist.Clear();
54
+            rvrdlist.Clear();
55
+            kzlist.Clear();
56
+        }
57
+
58
+        private void Intersectcheck(Polyline pll, Editor ed, Transaction trans,Database db)
59
+        {
60
+            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
61
+            Point3dCollection pts = new Point3dCollection();
62
+            Point3dCollection pts1 = new Point3dCollection();
63
+            Point3dCollection kz_pts = new Point3dCollection();
64
+            string rvrdname = "";
65
+            string kzname = "";
66
+            //为坎子让出的长度
67
+            double cut_dist = 0.5;
68
+            if (blc == 1000)
69
+                cut_dist = cut_dist * 2;
70
+            if (blc == 2000)
71
+                cut_dist = cut_dist * 4;
72
+            if (blc == 5000)
73
+                cut_dist = cut_dist * 10;
74
+            if (blc == 10000)
75
+                cut_dist = cut_dist * 20;
76
+
77
+
78
+            //添加道路河流房屋的图层名并搜索相应图层上的实体
79
+            if (rvrdlist != null)
80
+            {
81
+                if (kzlist != null)
82
+                {
83
+                    rvrdlist.AddRange(kzlist);
84
+                }
85
+                List<string> lyrname = rvrdlist;
86
+                for (int i = 0; i < lyrname.Count; i++)
87
+                {
88
+                    if (i == 0)
89
+                        rvrdname = lyrname[i];
90
+                    else
91
+                        rvrdname = rvrdname + "," + lyrname[i];
92
+                }
93
+                TypedValue[] value = new TypedValue[]
94
+                {
95
+                    new TypedValue((int)DxfCode.LayerName,rvrdname)
96
+                };
97
+                SelectionFilter filter = new SelectionFilter(value);
98
+                PromptSelectionResult psr = ed.SelectAll(filter);
99
+                if (psr.Status == PromptStatus.OK)
100
+                {
101
+                    //创建新图层
102
+                    LayerControl layerscontrol = new LayerControl();
103
+                    string layname = "待删除等高线";
104
+                    if (!layerscontrol.haslayername(layname))
105
+                    {
106
+                        colorgb col = new colorgb(255, 0, 255);
107
+                        layerscontrol.creatlayer(layname, col);
108
+                        layerscontrol.movelayertofront(layname);
109
+                    }
110
+                    else
111
+                        layerscontrol.movelayertofront(layname);
112
+
113
+                    SelectionSet ss = psr.Value;
114
+                    ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
115
+                    for (int i = 0; i < idcoll.Count; i++)
116
+                    {
117
+                        Polyline pll_rvrd = trans.GetObject(idcoll[i], OpenMode.ForWrite) as Polyline;
118
+                        Point3dCollection intersectionPoints = new Point3dCollection();
119
+                        pll.IntersectWith(pll_rvrd, Intersect.OnBothOperands, plane, intersectionPoints, IntPtr.Zero, IntPtr.Zero);
120
+                        if (intersectionPoints.Count > 0)
121
+                        {
122
+                            foreach (Point3d pt in intersectionPoints)
123
+                            {
124
+                                pts.Add(pt);
125
+                            }
126
+                        }
127
+                    }
128
+                }
129
+            }
130
+
131
+
132
+
133
+            //添加坎子图层名并搜索相应图层上的实体
134
+            if (kzlist != null)
135
+            {
136
+                for (int i = 0; i < kzlist.Count; i++)
137
+                {
138
+                    if (i == 0)
139
+                        kzname = kzlist[i];
140
+                    else
141
+                        kzname = kzname + "," + kzlist[i];
142
+                }
143
+                TypedValue[] value_kz = new TypedValue[]
144
+                {
145
+                    new TypedValue((int)DxfCode.LayerName,kzname)
146
+                };
147
+                SelectionFilter filter_kz = new SelectionFilter(value_kz);
148
+                PromptSelectionResult psr_kz = ed.SelectAll(filter_kz);
149
+                if (psr_kz.Status == PromptStatus.OK)
150
+                {
151
+                    SelectionSet ss = psr_kz.Value;
152
+                    ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
153
+                    for (int i = 0; i < idcoll.Count; i++)
154
+                    {
155
+                        Polyline pll_rvrd = trans.GetObject(idcoll[i], OpenMode.ForWrite) as Polyline;
156
+                        Point3dCollection intersectionPoints = new Point3dCollection();
157
+                        pll.IntersectWith(pll_rvrd, Intersect.OnBothOperands, plane, intersectionPoints, IntPtr.Zero, IntPtr.Zero);
158
+                        if (intersectionPoints.Count > 0)
159
+                        {
160
+                            foreach (Point3d pt in intersectionPoints)
161
+                            {
162
+                                pts1.Add(pt);
163
+                            }
164
+                        }
165
+                    }
166
+                    #region
167
+                    //if (pts.Count > 0)
168
+                    //{
169
+                    //    //按参数值排序交点
170
+                    //    List<double> paramList = new List<double>();
171
+                    //    foreach (Point3d breakPoint in pts)
172
+                    //    {
173
+                    //        double param = pll.GetParameterAtPoint(breakPoint);
174
+                    //        paramList.Add(param);
175
+                    //    }
176
+                    //    paramList.Sort();
177
+
178
+                    //    //存储分割后的多段线
179
+                    //    List<Polyline> newPlls = new List<Polyline>();
180
+
181
+                    //    // 初始化第一条多段线
182
+                    //    Polyline currentPline = new Polyline();
183
+                    //    currentPline.SetDatabaseDefaults();
184
+                    //    currentPline.Layer = pll.Layer;
185
+                    //    currentPline.Color = pll.Color;
186
+
187
+                    //    // 遍历多段线的节点
188
+                    //    for (int i = 0; i < pll.NumberOfVertices; i++)
189
+                    //    {
190
+                    //        Point2d point = pll.GetPoint2dAt(i);
191
+                    //        double bulge = pll.GetBulgeAt(i);
192
+
193
+                    //        // 添加节点到当前多段线
194
+                    //        currentPline.AddVertexAt(currentPline.NumberOfVertices, point, bulge, 0, 0);
195
+
196
+                    //        // 检查是否需要分割
197
+                    //        if (paramList.Count > 0 && i == (int)paramList[0])
198
+                    //        {
199
+                    //            // 检查当前节点和下一个节点之间是否有交点
200
+                    //            while (paramList.Count > 0 && paramList[0] >= i && paramList[0] < i + 1)
201
+                    //            {
202
+                    //                // 计算交点处的精确位置
203
+                    //                double param = paramList[0];
204
+                    //                double dist = pll.GetDistanceAtParameter(param)- cut_dist;
205
+                    //                Point3d splitPoint3d = pll.GetPointAtDist(dist);
206
+                    //                Point2d splitPoint = new Point2d(splitPoint3d.X, splitPoint3d.Y);
207
+                    //                kz_pts.Add(splitPoint3d);
208
+
209
+                    //                // 添加当前多段线到结果列表
210
+                    //                currentPline.AddVertexAt(currentPline.NumberOfVertices, splitPoint, 0, 0, 0);
211
+                    //                BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
212
+                    //                BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
213
+                    //                btr.AppendEntity(currentPline);
214
+                    //                trans.AddNewlyCreatedDBObject(currentPline, true);
215
+                    //                newPlls.Add(currentPline);
216
+
217
+                    //                // 初始化下一条多段线
218
+                    //                currentPline = new Polyline();
219
+                    //                currentPline.SetDatabaseDefaults();
220
+                    //                currentPline.Layer = pll.Layer;
221
+                    //                currentPline.Color = pll.Color;
222
+
223
+                    //                // 添加分割点作为下一条多段线的起点
224
+                    //                double dist1 = pll.GetDistanceAtParameter(param) + cut_dist;
225
+                    //                Point3d splitPoint3d1 = pll.GetPointAtDist(dist1);
226
+                    //                Point2d splitPoint1 = new Point2d(splitPoint3d1.X, splitPoint3d1.Y);
227
+                    //                kz_pts.Add(splitPoint3d1);
228
+                    //                currentPline.AddVertexAt(0, splitPoint1, 0, 0, 0);
229
+
230
+                    //                // 移除已处理的交点
231
+                    //                paramList.RemoveAt(0);
232
+                    //            }
233
+                    //        }
234
+                    //    }
235
+
236
+                    //    if (currentPline.NumberOfVertices > 0)
237
+                    //    {
238
+                    //        BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
239
+                    //        BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
240
+                    //        btr.AppendEntity(currentPline);
241
+                    //        trans.AddNewlyCreatedDBObject(currentPline, true);
242
+                    //        newPlls.Add(currentPline);
243
+                    //    }
244
+                    //    pll.Erase();
245
+
246
+
247
+                    //    for (int i = 0; i < newPlls.Count; i++)
248
+                    //    {
249
+                    //        if (kz_pts.Contains(newPlls[i].StartPoint) &&
250
+                    //            kz_pts.Contains(newPlls[i].EndPoint) &&
251
+                    //            i % 2 == 1)
252
+                    //            newPlls[i].Layer = "待删除等高线";
253
+                    //        else if (newPlls.Count == 2)
254
+                    //        {
255
+                    //            if (newPlls[0].Length < newPlls[1].Length)
256
+                    //                newPlls[0].Layer = "待删除等高线";
257
+                    //            else
258
+                    //                newPlls[1].Layer = "待删除等高线";
259
+                    //        }
260
+                    //    }
261
+                    //}
262
+                    #endregion
263
+                }
264
+            }
265
+
266
+
267
+
268
+            if (pts.Count > 0)
269
+            {
270
+                //创建新图层
271
+                LayerControl layerscontrol = new LayerControl();
272
+                string layname = "待删除等高线";
273
+                if (!layerscontrol.haslayername(layname))
274
+                {
275
+                    colorgb col = new colorgb(255, 0, 255);
276
+                    layerscontrol.creatlayer(layname, col);
277
+                    layerscontrol.movelayertofront(layname);
278
+                }
279
+                else
280
+                    layerscontrol.movelayertofront(layname);
281
+
282
+
283
+                //按参数值排序交点
284
+                List<double> paramList = new List<double>();
285
+                List<double> kzparam = new List<double>();
286
+                foreach (Point3d breakPoint in pts)
287
+                {
288
+                    double param = pll.GetParameterAtPoint(breakPoint);
289
+                    if (pts1.Contains(breakPoint))
290
+                        kzparam.Add(param);
291
+                    paramList.Add(param);
292
+                }
293
+                paramList.Sort();
294
+
295
+                //存储分割后的多段线
296
+                List<Polyline> newPlls = new List<Polyline>();
297
+
298
+                // 初始化第一条多段线
299
+                Polyline currentPline = new Polyline();
300
+                currentPline.SetDatabaseDefaults();
301
+                currentPline.Layer = pll.Layer;
302
+                currentPline.Color = pll.Color;
303
+
304
+                // 遍历多段线的节点
305
+                for (int i = 0; i < pll.NumberOfVertices; i++)
306
+                {
307
+                    Point2d point = pll.GetPoint2dAt(i);
308
+                    double bulge = pll.GetBulgeAt(i);
309
+
310
+                    // 添加节点到当前多段线
311
+                    currentPline.AddVertexAt(currentPline.NumberOfVertices, point, bulge, 0, 0);
312
+
313
+                    // 检查是否需要分割
314
+                    if (paramList.Count > 0 && i == (int)paramList[0])
315
+                    {
316
+                        // 检查当前节点和下一个节点之间是否有交点
317
+                        while (paramList.Count > 0 && paramList[0] >= i && paramList[0] < i + 1)
318
+                        {
319
+                            // 计算交点处的精确位置
320
+                            double param = paramList[0];
321
+                            double dist;
322
+                            if (kzparam.Contains(param))
323
+                            {
324
+                                dist = pll.GetDistanceAtParameter(param) - cut_dist;
325
+                                kz_pts.Add(pll.GetPointAtDist(dist));
326
+                            }
327
+                            else
328
+                                dist = pll.GetDistanceAtParameter(param);
329
+                            Point3d splitPoint3d = pll.GetPointAtDist(dist);
330
+                            Point2d splitPoint = new Point2d(splitPoint3d.X, splitPoint3d.Y);
331
+
332
+                            // 添加当前多段线到结果列表
333
+                            currentPline.AddVertexAt(currentPline.NumberOfVertices, splitPoint, 0, 0, 0);
334
+                            BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
335
+                            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
336
+                            btr.AppendEntity(currentPline);
337
+                            trans.AddNewlyCreatedDBObject(currentPline, true);
338
+                            newPlls.Add(currentPline);
339
+
340
+                            // 初始化下一条多段线
341
+                            currentPline = new Polyline();
342
+                            currentPline.SetDatabaseDefaults();
343
+                            currentPline.Layer = pll.Layer;
344
+                            currentPline.Color = pll.Color;
345
+
346
+                            // 添加分割点作为下一条多段线的起点
347
+                            if (kzparam.Contains(param))
348
+                            {
349
+                                double dist1 = pll.GetDistanceAtParameter(param) + cut_dist;
350
+                                Point3d splitPoint3d1 = pll.GetPointAtDist(dist1);
351
+                                Point2d splitPoint1 = new Point2d(splitPoint3d1.X, splitPoint3d1.Y);
352
+                                kz_pts.Add(splitPoint3d1);
353
+                                currentPline.AddVertexAt(0, splitPoint1, 0, 0, 0);
354
+                            }
355
+                            else
356
+                                currentPline.AddVertexAt(0, splitPoint, 0, 0, 0);
357
+
358
+                            // 移除已处理的交点
359
+                            paramList.RemoveAt(0);
360
+                        }
361
+                    }
362
+                }
363
+
364
+                if (currentPline.NumberOfVertices > 0)
365
+                {
366
+                    BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
367
+                    BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
368
+                    btr.AppendEntity(currentPline);
369
+                    trans.AddNewlyCreatedDBObject(currentPline, true);
370
+                    newPlls.Add(currentPline);
371
+                }
372
+                pll.Erase();
373
+
374
+
375
+                for (int i = 0; i < newPlls.Count; i++)
376
+                {
377
+                    if (newPlls.Count == 2)
378
+                    {
379
+                        if (newPlls[0].Length < newPlls[1].Length)
380
+                            newPlls[0].Layer = "待删除等高线";
381
+                        else
382
+                            newPlls[1].Layer = "待删除等高线";
383
+                    }
384
+                    else if (pts.Contains(newPlls[i].StartPoint) &&
385
+                        pts.Contains(newPlls[i].EndPoint) &&
386
+                        i % 2 == 1)
387
+                        newPlls[i].Layer = "待删除等高线";
388
+                    else if (kz_pts.Contains(newPlls[i].StartPoint) &&
389
+                        kz_pts.Contains(newPlls[i].EndPoint) &&
390
+                        i % 2 == 1)
391
+                        newPlls[i].Layer = "待删除等高线";
392
+                }
393
+            }
394
+        }
395
+
396
+       
397
+    }
398
+}

+ 176
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.Designer.cs 查看文件

@@ -0,0 +1,176 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class Dgxthrorvrd_Form
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.label1 = new System.Windows.Forms.Label();
33
+            this.label2 = new System.Windows.Forms.Label();
34
+            this.checkedListBox_dgx = new System.Windows.Forms.CheckedListBox();
35
+            this.checkedListBox_rvrd = new System.Windows.Forms.CheckedListBox();
36
+            this.button_OK = new System.Windows.Forms.Button();
37
+            this.button_Cancel = new System.Windows.Forms.Button();
38
+            this.label3 = new System.Windows.Forms.Label();
39
+            this.checkedListBox_kz = new System.Windows.Forms.CheckedListBox();
40
+            this.label4 = new System.Windows.Forms.Label();
41
+            this.comboBox_blc = new System.Windows.Forms.ComboBox();
42
+            this.SuspendLayout();
43
+            // 
44
+            // label1
45
+            // 
46
+            this.label1.AutoSize = true;
47
+            this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
48
+            this.label1.Location = new System.Drawing.Point(44, 75);
49
+            this.label1.Name = "label1";
50
+            this.label1.Size = new System.Drawing.Size(127, 15);
51
+            this.label1.TabIndex = 0;
52
+            this.label1.Text = "等高线所在图层:";
53
+            // 
54
+            // label2
55
+            // 
56
+            this.label2.AutoSize = true;
57
+            this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
58
+            this.label2.Location = new System.Drawing.Point(196, 75);
59
+            this.label2.Name = "label2";
60
+            this.label2.Size = new System.Drawing.Size(172, 15);
61
+            this.label2.TabIndex = 1;
62
+            this.label2.Text = "河流道路房屋所在图层:";
63
+            // 
64
+            // checkedListBox_dgx
65
+            // 
66
+            this.checkedListBox_dgx.FormattingEnabled = true;
67
+            this.checkedListBox_dgx.Location = new System.Drawing.Point(47, 103);
68
+            this.checkedListBox_dgx.Name = "checkedListBox_dgx";
69
+            this.checkedListBox_dgx.Size = new System.Drawing.Size(124, 164);
70
+            this.checkedListBox_dgx.TabIndex = 2;
71
+            // 
72
+            // checkedListBox_rvrd
73
+            // 
74
+            this.checkedListBox_rvrd.FormattingEnabled = true;
75
+            this.checkedListBox_rvrd.Location = new System.Drawing.Point(211, 103);
76
+            this.checkedListBox_rvrd.Name = "checkedListBox_rvrd";
77
+            this.checkedListBox_rvrd.Size = new System.Drawing.Size(124, 164);
78
+            this.checkedListBox_rvrd.TabIndex = 3;
79
+            // 
80
+            // button_OK
81
+            // 
82
+            this.button_OK.Location = new System.Drawing.Point(175, 295);
83
+            this.button_OK.Name = "button_OK";
84
+            this.button_OK.Size = new System.Drawing.Size(75, 31);
85
+            this.button_OK.TabIndex = 4;
86
+            this.button_OK.Text = "确 认";
87
+            this.button_OK.UseVisualStyleBackColor = true;
88
+            this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
89
+            // 
90
+            // button_Cancel
91
+            // 
92
+            this.button_Cancel.Location = new System.Drawing.Point(333, 295);
93
+            this.button_Cancel.Name = "button_Cancel";
94
+            this.button_Cancel.Size = new System.Drawing.Size(75, 30);
95
+            this.button_Cancel.TabIndex = 5;
96
+            this.button_Cancel.Text = "取 消";
97
+            this.button_Cancel.UseVisualStyleBackColor = true;
98
+            // 
99
+            // label3
100
+            // 
101
+            this.label3.AutoSize = true;
102
+            this.label3.Location = new System.Drawing.Point(385, 75);
103
+            this.label3.Name = "label3";
104
+            this.label3.Size = new System.Drawing.Size(112, 15);
105
+            this.label3.TabIndex = 6;
106
+            this.label3.Text = "坎子所在图层:";
107
+            // 
108
+            // checkedListBox_kz
109
+            // 
110
+            this.checkedListBox_kz.FormattingEnabled = true;
111
+            this.checkedListBox_kz.Location = new System.Drawing.Point(388, 103);
112
+            this.checkedListBox_kz.Name = "checkedListBox_kz";
113
+            this.checkedListBox_kz.Size = new System.Drawing.Size(124, 164);
114
+            this.checkedListBox_kz.TabIndex = 7;
115
+            // 
116
+            // label4
117
+            // 
118
+            this.label4.AutoSize = true;
119
+            this.label4.Location = new System.Drawing.Point(47, 26);
120
+            this.label4.Name = "label4";
121
+            this.label4.Size = new System.Drawing.Size(67, 15);
122
+            this.label4.TabIndex = 8;
123
+            this.label4.Text = "比例尺:";
124
+            // 
125
+            // comboBox_blc
126
+            // 
127
+            this.comboBox_blc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
128
+            this.comboBox_blc.FormattingEnabled = true;
129
+            this.comboBox_blc.Items.AddRange(new object[] {
130
+            "1:500",
131
+            "1:1000",
132
+            "1:2000",
133
+            "1:5000",
134
+            "1:10000"});
135
+            this.comboBox_blc.Location = new System.Drawing.Point(120, 23);
136
+            this.comboBox_blc.Name = "comboBox_blc";
137
+            this.comboBox_blc.Size = new System.Drawing.Size(156, 23);
138
+            this.comboBox_blc.TabIndex = 9;
139
+            // 
140
+            // Dgxthrorvrd_Form
141
+            // 
142
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
143
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
144
+            this.ClientSize = new System.Drawing.Size(598, 349);
145
+            this.Controls.Add(this.comboBox_blc);
146
+            this.Controls.Add(this.label4);
147
+            this.Controls.Add(this.checkedListBox_kz);
148
+            this.Controls.Add(this.label3);
149
+            this.Controls.Add(this.button_Cancel);
150
+            this.Controls.Add(this.button_OK);
151
+            this.Controls.Add(this.checkedListBox_rvrd);
152
+            this.Controls.Add(this.checkedListBox_dgx);
153
+            this.Controls.Add(this.label2);
154
+            this.Controls.Add(this.label1);
155
+            this.Name = "Dgxthrorvrd_Form";
156
+            this.Text = "过河流道路的等高线裁剪";
157
+            this.Load += new System.EventHandler(this.Dgxthrorvrd_Form_Load);
158
+            this.ResumeLayout(false);
159
+            this.PerformLayout();
160
+
161
+        }
162
+
163
+        #endregion
164
+
165
+        private System.Windows.Forms.Label label1;
166
+        private System.Windows.Forms.Label label2;
167
+        private System.Windows.Forms.CheckedListBox checkedListBox_dgx;
168
+        private System.Windows.Forms.CheckedListBox checkedListBox_rvrd;
169
+        private System.Windows.Forms.Button button_OK;
170
+        private System.Windows.Forms.Button button_Cancel;
171
+        private System.Windows.Forms.Label label3;
172
+        private System.Windows.Forms.CheckedListBox checkedListBox_kz;
173
+        private System.Windows.Forms.Label label4;
174
+        private System.Windows.Forms.ComboBox comboBox_blc;
175
+    }
176
+}

+ 94
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.cs 查看文件

@@ -0,0 +1,94 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class Dgxthrorvrd_Form : Form
15
+    {
16
+        public Dgxthrorvrd_Form()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void Dgxthrorvrd_Form_Load(object sender, EventArgs e)
22
+        {
23
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
24
+            using (Transaction traction = database.TransactionManager.StartTransaction())
25
+            {
26
+                //存放所有图层名
27
+                List<string> alllayername = new List<string>();
28
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
29
+                foreach (ObjectId objid in layertable)
30
+                {
31
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
32
+                    alllayername.Add(layertablerecord.Name);
33
+                }
34
+                alllayername.Sort();
35
+
36
+                for (int i = 0; i < alllayername.Count; i++)
37
+                {
38
+                    this.checkedListBox_dgx.Items.Add(alllayername[i]);
39
+                    this.checkedListBox_rvrd.Items.Add(alllayername[i]);
40
+                    this.checkedListBox_kz.Items.Add(alllayername[i]);
41
+                }
42
+            }
43
+        }
44
+
45
+        private void button_OK_Click(object sender, EventArgs e)
46
+        {
47
+            if (comboBox_blc.SelectedItem == null)
48
+            {
49
+                MessageBox.Show("请选择比例尺!", "提示");
50
+                return;
51
+            }
52
+            if (checkedListBox_dgx.CheckedItems.Count == 0)
53
+            {
54
+                MessageBox.Show("等高线图层不能为空!", "提示");
55
+                return;
56
+            }
57
+            if (checkedListBox_rvrd.CheckedItems.Count == 0&&
58
+                checkedListBox_kz.CheckedItems.Count == 0)
59
+            {
60
+                MessageBox.Show("河流道路房屋图层和坎子图层不能都为空!", "提示");
61
+                return;
62
+            }
63
+            List<string> dgx = new List<string>();//存放等高线
64
+            List<string> rvrd = new List<string>();//存放河流道路房屋图层
65
+            List<string> kz = new List<string>();//存放坎子图层
66
+
67
+            for (int i = 0; i < checkedListBox_dgx.CheckedItems.Count; i++)
68
+            {
69
+                dgx.Add(checkedListBox_dgx.CheckedItems[i].ToString());
70
+            }
71
+            if (checkedListBox_rvrd.CheckedItems.Count != 0)
72
+            {
73
+                for (int i = 0; i < checkedListBox_rvrd.CheckedItems.Count; i++)
74
+                {
75
+                    rvrd.Add(checkedListBox_rvrd.CheckedItems[i].ToString());
76
+                }
77
+                Dgxthrorvrd.rvrdlist = rvrd;
78
+            }
79
+            if (checkedListBox_kz.CheckedItems.Count != 0)
80
+            {
81
+                for (int i = 0; i < checkedListBox_kz.CheckedItems.Count; i++)
82
+                {
83
+                    kz.Add(checkedListBox_kz.CheckedItems[i].ToString());
84
+                }
85
+                Dgxthrorvrd.kzlist = kz;
86
+            }
87
+            Dgxthrorvrd.dgxlist = dgx;
88
+            Dgxthrorvrd.blc = Convert.ToInt32(comboBox_blc.SelectedItem.ToString().Split(':')[1]);
89
+            Dgxthrorvrd cutdgx = new Dgxthrorvrd();
90
+            cutdgx.DgxCut();
91
+            this.Close();
92
+        }
93
+    }
94
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 288
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ElePtCheck.cs 查看文件

@@ -0,0 +1,288 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+using GrxCAD.ApplicationServices;
8
+using GrxCAD.DatabaseServices;
9
+using GrxCAD.EditorInput;
10
+using System.Collections;
11
+using GrxCAD.Geometry;
12
+
13
+namespace HCTools
14
+{
15
+    public struct points
16
+    {
17
+        public Point3d pt;
18
+        public ObjectId objID;
19
+    }
20
+
21
+    class ElePtCheck
22
+    {
23
+        public static int blc;//比例尺
24
+        public static string EleLayerName;//高程点图层名
25
+
26
+        public double radius;//半径
27
+        //public double length;//搜索半径
28
+
29
+        int j = 0;//记录错误点个数
30
+
31
+        //存放所有高程点数组
32
+        public List<points> pointarrlist = new List<points>();
33
+        //存放有问题的高程点数组
34
+        public List<points> errorpointarrlist = new List<points>();
35
+
36
+
37
+
38
+        /// <summary>
39
+        /// 检查错误的高程点并画圆标记
40
+        /// </summary>
41
+        public void pointcheck()
42
+        {
43
+            double flagradius = 4.0 * blc / 1000;//画圆标记半径
44
+
45
+            if (blc == 500)
46
+            {
47
+                radius = 1.5;
48
+            }
49
+            else if (blc == 1000)
50
+            {
51
+                radius = 2.5;
52
+            }
53
+            else if (blc == 2000)
54
+            {
55
+                radius = 4;
56
+            }
57
+            else if (blc == 5000)
58
+            {
59
+                radius = 10.5;
60
+            }
61
+            //外切圆半径
62
+            //length = radius * Math.Pow(2, 0.5);
63
+
64
+
65
+            //检查高程点与注记是否一致或为零
66
+            check();
67
+
68
+            //创建存放错误点的图层
69
+            LayerControl layerscontrol = new LayerControl();
70
+            string layname = "错误高程点";
71
+            if (!layerscontrol.haslayername(layname))
72
+            {
73
+                colorgb col = new colorgb(255, 0, 255);
74
+                layerscontrol.creatlayer(layname, col);
75
+                layerscontrol.movelayertofront(layname);
76
+            }
77
+            else
78
+                layerscontrol.movelayertofront(layname);
79
+
80
+            //创建错误点标记的图层
81
+            LayerControl layerscontrol1 = new LayerControl();
82
+            string layname1 = "错误高程点标记";
83
+            if (!layerscontrol1.haslayername(layname1))
84
+            {
85
+                colorgb col = new colorgb(0, 225, 255);
86
+                layerscontrol1.creatlayer(layname1, col);
87
+                layerscontrol1.movelayertofront(layname1);
88
+            }
89
+            else
90
+                layerscontrol1.movelayertofront(layname1);
91
+
92
+            Database database = HostApplicationServices.WorkingDatabase;
93
+            Document doc = Application.DocumentManager.MdiActiveDocument;
94
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
95
+            using (Transaction traction = database.TransactionManager.StartTransaction())
96
+            {
97
+                DocumentLock documentlock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
98
+                BlockTable blocktable = traction.GetObject(database.BlockTableId,OpenMode.ForWrite) as BlockTable;
99
+                
100
+                for (int i = 0; i < errorpointarrlist.Count; i++)
101
+                {
102
+                    BasicFunction functions = new BasicFunction();
103
+                    BlockReference blr= traction.GetObject(errorpointarrlist[i].objID,OpenMode.ForWrite)as BlockReference;
104
+                    blr.Layer = "错误高程点";
105
+                    functions.makeflag(errorpointarrlist[i].pt.X, errorpointarrlist[i].pt.Y, 0, flagradius, "错误高程点标记");
106
+
107
+                    Point3d p1 = new Point3d(errorpointarrlist[i].pt.X - radius, errorpointarrlist[i].pt.Y - radius, 0);
108
+                    Point3d p2 = new Point3d(errorpointarrlist[i].pt.X + radius, errorpointarrlist[i].pt.Y + radius, 0);
109
+                    TypedValue[] typedvalue = new TypedValue[2];
110
+
111
+                    typedvalue.SetValue(new TypedValue((int)DxfCode.Start, "Text"), 0);
112
+                    typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, EleLayerName), 1);
113
+
114
+                    SelectionFilter filter = new SelectionFilter(typedvalue);
115
+                    PromptSelectionResult psr = editor.SelectCrossingWindow(p1, p2, filter);
116
+
117
+                    if (psr.Status == PromptStatus.OK)
118
+                    {
119
+                        SelectionSet set = psr.Value;
120
+                        ObjectId[] objs = new ObjectId[set.Count];
121
+                        objs = set.GetObjectIds();
122
+                        for (int ii = 0; ii < objs.Length; ii++)
123
+                        {
124
+                            DBText Text = (DBText)traction.GetObject(objs[ii], OpenMode.ForWrite);
125
+                            Text.Layer = "错误高程点";
126
+                        }
127
+                    }
128
+                }
129
+
130
+                traction.Commit();
131
+                documentlock.Dispose();
132
+                traction.Dispose();
133
+            }
134
+
135
+            editor.WriteMessage("\n共有" + j + "处错误");
136
+        }
137
+
138
+        /// <summary>
139
+        /// 检查高程点与注记是否一致或为零
140
+        /// </summary>
141
+        private void check()
142
+        {
143
+            string LayerName = EleLayerName;
144
+            getptInLayer(LayerName);
145
+
146
+            if (pointarrlist == null)
147
+                return;
148
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
149
+            for (int i = 0; i < pointarrlist.Count; i++)
150
+            {
151
+                Point3d pt = pointarrlist[i].pt;
152
+                string getword = GetTxt(pt, LayerName);
153
+                if (pt.Z == 0)
154
+                {
155
+                    errorpointarrlist.Add(pointarrlist[i]);
156
+                    j++;
157
+                }
158
+                else if (!getword.Contains('.') || getword.Contains(".0"))
159
+                {
160
+                    errorpointarrlist.Add(pointarrlist[i]);
161
+                    j++;
162
+                }
163
+                else
164
+                {
165
+                    if (pt.Z.ToString("f1") == getword && pt.Z % (blc / 1000) != 0)
166
+                    {
167
+                        continue;
168
+                    }
169
+                    else
170
+                    {
171
+                        errorpointarrlist.Add(pointarrlist[i]);
172
+                        j++;
173
+                    }
174
+                }
175
+            }
176
+        }
177
+
178
+
179
+        /// <summary>
180
+        /// 获取图层上高程点坐标
181
+        /// </summary>
182
+        private void getptInLayer(string LayerName)
183
+        {
184
+            Document document = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
185
+            Database db = HostApplicationServices.WorkingDatabase;
186
+            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
187
+            
188
+            TypedValue[] value = new TypedValue[]
189
+            {
190
+                new TypedValue((int)DxfCode.LayerName,LayerName),
191
+                new TypedValue((int)DxfCode.Start,"Insert")
192
+            };//设置筛选条件
193
+            SelectionFilter filter = new SelectionFilter(value);
194
+
195
+            //选择区域中全部对象
196
+            //PromptSelectionResult psr = ed.SelectAll(filter);
197
+            // 要求在图形区域中手动选择对象
198
+            PromptSelectionResult psr = ed.GetSelection(filter);
199
+
200
+
201
+            if (psr.Status == PromptStatus.OK)
202
+            {
203
+                using (Transaction transaction = db.TransactionManager.StartTransaction())
204
+                {
205
+                    SelectionSet ss = psr.Value;
206
+                    ObjectId[] ids = ss.GetObjectIds();
207
+
208
+                    points ptlist = new points();
209
+                    foreach (ObjectId etId in ids)
210
+                    {
211
+                        BlockReference blr = transaction.GetObject(etId, OpenMode.ForRead) as BlockReference;
212
+                        ptlist.pt = blr.Position;
213
+                        ptlist.objID = blr.Id;
214
+                        pointarrlist.Add(ptlist);
215
+                    }
216
+
217
+                    transaction.Commit();
218
+                }
219
+            }
220
+        }
221
+
222
+        /// <summary>
223
+        /// 筛选坐标点附近文字信息
224
+        /// </summary>
225
+        private static String GetTxt(Point3d pt, string LayerName)
226
+        {
227
+            ObjectId[] objss = null;//文本对象的ID数组
228
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
229
+
230
+            TypedValue[] val = new TypedValue[] 
231
+            { new TypedValue(0, "TEXT"),
232
+              new TypedValue((int)DxfCode.LayerName,LayerName)
233
+            };//需要筛选的类型值
234
+            SelectionFilter fil = new SelectionFilter(val);//选择过滤器
235
+            PromptSelectionResult pro = ed.SelectCrossingWindow(new Point3d(pt.X - 4.0 * blc / 2000, pt.Y - 4.0 * blc / 2000, 0),
236
+                new Point3d(pt.X + 4.0 * blc / 2000, pt.Y + 4.0 * blc / 2000, 0), fil);
237
+            //PromptSelectionResult pro = ed.SelectAll(fil);//获取结果
238
+            SelectionSet ss = pro.Value;//赋值给选择集
239
+            String txt = null;
240
+
241
+            if (ss != null)
242
+            {
243
+                objss = ss.GetObjectIds();//将选择集内对象ID赋值给ID数组
244
+                if (objss.Length > 1)
245
+                {
246
+                    for (int i = 0; i < objss.Length; i++)
247
+                    {
248
+                        DBText buftext = GetDBObject(objss[i]) as DBText;
249
+                        if (pt.Z.ToString("f1") == buftext.TextString)
250
+                            txt = buftext.TextString;
251
+                    }
252
+                }
253
+                else
254
+                {
255
+                    DBText buftext = GetDBObject(objss[0]) as DBText;
256
+                    txt = buftext.TextString;
257
+                }
258
+            }
259
+            //for (int i = 0; i < objss.Length; i++)
260
+            //{
261
+            //    DBText buftext = GetDBObject(objss[i]) as DBText;//遍历数组ID将对象赋值给单行文本
262
+            //    Point3d po = buftext.Position;//获取单行文本的坐标点
263
+            //    if (Math.Sqrt((po.X - x) * (po.X - x) + (po.Y - y) * (po.Y - y)) < 10)
264
+            //    {
265
+            //        txt = buftext.TextString;//筛选出的单行文本对象
266
+            //    }
267
+            //    else
268
+            //        continue;
269
+            //}
270
+            return txt;
271
+        }
272
+
273
+        private static Entity GetDBObject(ObjectId i)
274
+        {
275
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
276
+            Database db = doc.Database;
277
+            Entity ent = null;
278
+            using (Transaction tr = db.TransactionManager.StartTransaction())
279
+            {
280
+                ent = (Entity)tr.GetObject(i, OpenMode.ForRead, true);
281
+                tr.Commit();
282
+            }
283
+            return ent;
284
+        }
285
+
286
+        }
287
+    }
288
+

+ 124
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.Designer.cs 查看文件

@@ -0,0 +1,124 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class EleRd
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.comboBox_sqx = new System.Windows.Forms.ComboBox();
33
+            this.label1 = new System.Windows.Forms.Label();
34
+            this.comboBox_jqx = new System.Windows.Forms.ComboBox();
35
+            this.label2 = new System.Windows.Forms.Label();
36
+            this.btn_Cancel = new System.Windows.Forms.Button();
37
+            this.btn_OK = new System.Windows.Forms.Button();
38
+            this.SuspendLayout();
39
+            // 
40
+            // comboBox_sqx
41
+            // 
42
+            this.comboBox_sqx.FormattingEnabled = true;
43
+            this.comboBox_sqx.Location = new System.Drawing.Point(155, 80);
44
+            this.comboBox_sqx.Name = "comboBox_sqx";
45
+            this.comboBox_sqx.Size = new System.Drawing.Size(160, 23);
46
+            this.comboBox_sqx.TabIndex = 67;
47
+            // 
48
+            // label1
49
+            // 
50
+            this.label1.AutoSize = true;
51
+            this.label1.Location = new System.Drawing.Point(52, 83);
52
+            this.label1.Name = "label1";
53
+            this.label1.Size = new System.Drawing.Size(97, 15);
54
+            this.label1.TabIndex = 66;
55
+            this.label1.Text = "首曲线图层:";
56
+            // 
57
+            // comboBox_jqx
58
+            // 
59
+            this.comboBox_jqx.FormattingEnabled = true;
60
+            this.comboBox_jqx.Location = new System.Drawing.Point(155, 34);
61
+            this.comboBox_jqx.Name = "comboBox_jqx";
62
+            this.comboBox_jqx.Size = new System.Drawing.Size(160, 23);
63
+            this.comboBox_jqx.TabIndex = 65;
64
+            // 
65
+            // label2
66
+            // 
67
+            this.label2.AutoSize = true;
68
+            this.label2.Location = new System.Drawing.Point(52, 37);
69
+            this.label2.Name = "label2";
70
+            this.label2.Size = new System.Drawing.Size(97, 15);
71
+            this.label2.TabIndex = 64;
72
+            this.label2.Text = "计曲线图层:";
73
+            // 
74
+            // btn_Cancel
75
+            // 
76
+            this.btn_Cancel.Location = new System.Drawing.Point(215, 124);
77
+            this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4);
78
+            this.btn_Cancel.Name = "btn_Cancel";
79
+            this.btn_Cancel.Size = new System.Drawing.Size(100, 29);
80
+            this.btn_Cancel.TabIndex = 63;
81
+            this.btn_Cancel.Text = "取 消";
82
+            this.btn_Cancel.UseVisualStyleBackColor = true;
83
+            this.btn_Cancel.Click += new System.EventHandler(this.btn_Cancel_Click);
84
+            // 
85
+            // btn_OK
86
+            // 
87
+            this.btn_OK.Location = new System.Drawing.Point(52, 124);
88
+            this.btn_OK.Margin = new System.Windows.Forms.Padding(4);
89
+            this.btn_OK.Name = "btn_OK";
90
+            this.btn_OK.Size = new System.Drawing.Size(100, 29);
91
+            this.btn_OK.TabIndex = 62;
92
+            this.btn_OK.Text = "确 定";
93
+            this.btn_OK.UseVisualStyleBackColor = true;
94
+            this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
95
+            // 
96
+            // EleRd
97
+            // 
98
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
99
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
100
+            this.ClientSize = new System.Drawing.Size(380, 184);
101
+            this.Controls.Add(this.comboBox_sqx);
102
+            this.Controls.Add(this.label1);
103
+            this.Controls.Add(this.comboBox_jqx);
104
+            this.Controls.Add(this.label2);
105
+            this.Controls.Add(this.btn_Cancel);
106
+            this.Controls.Add(this.btn_OK);
107
+            this.Name = "EleRd";
108
+            this.Text = "等高线高程取整";
109
+            this.Load += new System.EventHandler(this.EleRd_Load);
110
+            this.ResumeLayout(false);
111
+            this.PerformLayout();
112
+
113
+        }
114
+
115
+        #endregion
116
+
117
+        private System.Windows.Forms.ComboBox comboBox_sqx;
118
+        private System.Windows.Forms.Label label1;
119
+        private System.Windows.Forms.ComboBox comboBox_jqx;
120
+        private System.Windows.Forms.Label label2;
121
+        private System.Windows.Forms.Button btn_Cancel;
122
+        private System.Windows.Forms.Button btn_OK;
123
+    }
124
+}

+ 85
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.cs 查看文件

@@ -0,0 +1,85 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class EleRd : Form
15
+    {
16
+        public EleRd()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void EleRd_Load(object sender, EventArgs e)
22
+        {
23
+            this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList;
24
+            this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList;
25
+
26
+            //自动填充下拉框
27
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
28
+            using (Transaction traction = database.TransactionManager.StartTransaction())
29
+            {
30
+                //存放所有图层名
31
+                List<string> alllayername = new List<string>();
32
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
33
+                foreach (ObjectId objid in layertable)
34
+                {
35
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
36
+                    alllayername.Add(layertablerecord.Name);
37
+                }
38
+
39
+                alllayername.Sort();
40
+
41
+                for (int i = 0; i < alllayername.Count; i++)
42
+                {
43
+                    this.comboBox_jqx.Items.Add(alllayername[i]);
44
+                    this.comboBox_sqx.Items.Add(alllayername[i]);
45
+                }
46
+
47
+                if (alllayername.Contains("8110"))
48
+                {
49
+                    int index = alllayername.IndexOf("8110");
50
+                    this.comboBox_sqx.SelectedIndex = index;
51
+                }
52
+                if (alllayername.Contains("8120"))
53
+                {
54
+                    int index = alllayername.IndexOf("8120");
55
+                    this.comboBox_jqx.SelectedIndex = index;
56
+                }
57
+                traction.Commit();
58
+            }
59
+        }
60
+
61
+        private void btn_OK_Click(object sender, EventArgs e)
62
+        {
63
+            if (comboBox_sqx.Text == "")
64
+            {
65
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线");
66
+                return;
67
+            }
68
+            if (comboBox_sqx.Text == "")
69
+            {
70
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线");
71
+                return;
72
+            }
73
+            EleRound.jqx = comboBox_jqx.Text;
74
+            EleRound.sqx = comboBox_sqx.Text;
75
+            this.Close();
76
+            EleRound elerd = new EleRound();
77
+            elerd.eleround();
78
+        }
79
+
80
+        private void btn_Cancel_Click(object sender, EventArgs e)
81
+        {
82
+            this.Close();
83
+        }
84
+    }
85
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 71
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRound.cs 查看文件

@@ -0,0 +1,71 @@
1
+using GrxCAD.DatabaseServices;
2
+using GrxCAD.Geometry;
3
+using GrxCAD.ApplicationServices;
4
+using GrxCAD.EditorInput;
5
+using System.Windows.Forms;
6
+
7
+using System;
8
+using System.Collections.Generic;
9
+using System.Linq;
10
+using System.Text;
11
+using System.Threading.Tasks;
12
+
13
+namespace HCTools
14
+{
15
+    class EleRound
16
+    {
17
+        public static string jqx;
18
+        public static string sqx;
19
+        public void eleround()
20
+        {
21
+            Database db = HostApplicationServices.WorkingDatabase;
22
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
23
+
24
+            string lyrname = jqx + "," + sqx;
25
+            //选择要取整等高线
26
+            TypedValue[] value = new TypedValue[]
27
+            {
28
+                new TypedValue((int)DxfCode.LayerName,lyrname),
29
+                new TypedValue((int)DxfCode.Start,"LWPOLYLINE")
30
+            };//设置筛选条件
31
+            SelectionFilter filter = new SelectionFilter(value);//选择区域中全部对象
32
+            //PromptSelectionResult psr = ed.SelectAll(filter);// 要求在图形区域中手动选择对象
33
+            PromptSelectionResult psr = ed.GetSelection(filter);
34
+
35
+            if (psr.Status == PromptStatus.OK)
36
+            {
37
+                int elelines = 0;
38
+                SelectionSet ss = psr.Value;
39
+                if (ss == null)
40
+                    return;
41
+                ObjectIdCollection idcoll1 = new ObjectIdCollection(ss.GetObjectIds());
42
+                for (int i = 0; i < idcoll1.Count; i++)
43
+                {
44
+                    DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
45
+                    using (Transaction trans = db.TransactionManager.StartTransaction())
46
+                    {
47
+                        BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);
48
+                        BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
49
+                        Polyline pll = (Polyline)idcoll1[i].GetObject(OpenMode.ForWrite);
50
+                        if ((Math.Round(pll.Elevation, 4, MidpointRounding.AwayFromZero) != Math.Truncate((Math.Round(pll.Elevation, 4, MidpointRounding.AwayFromZero)))))
51
+                        {
52
+                            LayerControl layerscontrol = new LayerControl();
53
+                            string layname = "已修改";
54
+                            if (layerscontrol.haslayername(layname) == false)
55
+                            {
56
+                                colorgb col = new colorgb(255, 0, 0);
57
+                                layerscontrol.creatlayer(layname, col);
58
+                            }
59
+                            pll.Elevation = Math.Round(pll.Elevation, 0, MidpointRounding.AwayFromZero);
60
+                            pll.Layer = "已修改";
61
+                            elelines++;
62
+                        }
63
+                        trans.Commit();
64
+                    }
65
+                    doclock.Dispose();
66
+                }
67
+                ed.WriteMessage("\n" + "已修改" + elelines.ToString() + "条高程非整数等高线");
68
+            }
69
+        }
70
+    }
71
+}

+ 156
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDenck.cs 查看文件

@@ -0,0 +1,156 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+
11
+namespace HCTools
12
+{
13
+    class EleptDenck
14
+    {
15
+        public static string ptlayer;
16
+        public static string tklayer;
17
+        public static double density;
18
+        public static int flag;
19
+        public void Ptdensity()
20
+        {
21
+            ObjectId[] ids = TKget();
22
+
23
+            Database db = HostApplicationServices.WorkingDatabase;
24
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
25
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
26
+
27
+            TypedValue[] typedvalue = new TypedValue[2];
28
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, ptlayer), 0);
29
+            typedvalue.SetValue(new TypedValue((int)DxfCode.Start, "Insert"), 1);
30
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
31
+
32
+            for (int i = 0; i < ids.Length; i++)
33
+            {
34
+                Entity current_entity = BasicFunction.GetDBObject(ids[i]);
35
+                ZoomToExtent(current_entity.GeometricExtents);
36
+                using (Transaction trans = db.TransactionManager.StartTransaction())
37
+                {
38
+                    Polyline pll = (Polyline)trans.GetObject(ids[i], OpenMode.ForWrite);
39
+                    Point3dCollection ptcoll = new Point3dCollection();
40
+                    for (int j = 0; j < pll.NumberOfVertices; j++)
41
+                    {
42
+                        ptcoll.Add(pll.GetPoint3dAt(j));
43
+                    }
44
+                    PromptSelectionResult psr = editor.SelectCrossingPolygon(ptcoll,selectionfilter);
45
+
46
+                    if (psr.Status == PromptStatus.OK)
47
+                    {
48
+                        SelectionSet selectionset = psr.Value;
49
+                        int ptnums = selectionset.Count;
50
+                        double den = ptnums / pll.Area;
51
+                        if (den < density && flag == 1)
52
+                        {
53
+                            LayerControl layerscontrol = new LayerControl();
54
+                            string layname = "小于密度";
55
+                            if (!layerscontrol.haslayername(layname))
56
+                            {
57
+                                colorgb col = new colorgb(255, 0, 0);
58
+                                layerscontrol.creatlayer(layname, col);
59
+                                pll.Layer = "小于密度";
60
+                            }
61
+                            else
62
+                                pll.Layer = "小于密度";
63
+                            //pll.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
64
+                        }
65
+                        else if (den > density && flag == 2)
66
+                        {
67
+                            LayerControl layerscontrol = new LayerControl();
68
+                            string layname = "大于密度";
69
+                            if (!layerscontrol.haslayername(layname))
70
+                            {
71
+                                colorgb col = new colorgb(255, 0, 0);
72
+                                layerscontrol.creatlayer(layname, col);
73
+                                pll.Layer = "大于密度";
74
+                            }
75
+                            else
76
+                                pll.Layer = "大于密度";
77
+                            //pll.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
78
+                        }
79
+                        else if (flag == 3)
80
+                        {
81
+                            if (den < density || den > density)
82
+                            {
83
+                                LayerControl layerscontrol = new LayerControl();
84
+                                string layname = "不等于密度";
85
+                                if (!layerscontrol.haslayername(layname))
86
+                                {
87
+                                    colorgb col = new colorgb(255, 0, 0);
88
+                                    layerscontrol.creatlayer(layname, col);
89
+                                    pll.Layer = "不等于密度";
90
+                                }
91
+                                else
92
+                                    pll.Layer = "不等于密度";
93
+                                //pll.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
94
+                            }
95
+                        }
96
+                    }
97
+                    trans.Commit();
98
+                }
99
+            }
100
+            doclock.Dispose();
101
+        }
102
+
103
+        private static ObjectId[] TKget()
104
+        {
105
+            Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; 
106
+            TypedValue[] typedvalue = new TypedValue[1];
107
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, tklayer), 0);
108
+           
109
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
110
+            PromptSelectionResult psr = editor.SelectAll(selectionfilter);
111
+            SelectionSet selectionset = psr.Value;
112
+            ObjectId[] obj = new ObjectId[selectionset.Count];
113
+
114
+            if (psr.Status == PromptStatus.OK)
115
+            {
116
+                obj = selectionset.GetObjectIds();
117
+            }
118
+            return obj;
119
+        }
120
+
121
+        public static void ZoomToExtent(Extents3d extent)
122
+        {
123
+            try
124
+            {
125
+                Point3d pMin = extent.MinPoint;
126
+                Point3d pMax = extent.MaxPoint;
127
+                //获取当前文档及数据库
128
+                Document acDoc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
129
+                Database acCurDb = acDoc.Database;
130
+
131
+                // 启动事务
132
+                using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
133
+                {
134
+                    using (ViewTableRecord acView = acDoc.Editor.GetCurrentView())
135
+                    {
136
+                        //设置视图的高
137
+                        acView.Height = Math.Abs(pMin.Y - pMax.Y);
138
+                        //设置视图的宽
139
+                        acView.Width = Math.Abs(pMin.X - pMax.X);
140
+                        // 设置视图中心
141
+                        acView.CenterPoint = new Point2d((pMin.X + pMax.X) / 2, (pMin.Y + pMax.Y) / 2);
142
+                        // 更新当前视图
143
+                        acDoc.Editor.SetCurrentView(acView);
144
+                    }
145
+                    // 提交更改
146
+                    acTrans.Commit();
147
+                }
148
+            }
149
+            catch (Exception)
150
+            {
151
+
152
+                throw;
153
+            }
154
+        }
155
+    }
156
+}

+ 170
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.Designer.cs 查看文件

@@ -0,0 +1,170 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class EleptDensity
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.label1 = new System.Windows.Forms.Label();
33
+            this.label2 = new System.Windows.Forms.Label();
34
+            this.comboBox_ptLayer = new System.Windows.Forms.ComboBox();
35
+            this.comboBox_gw = new System.Windows.Forms.ComboBox();
36
+            this.button_ok = new System.Windows.Forms.Button();
37
+            this.button_cancel = new System.Windows.Forms.Button();
38
+            this.label3 = new System.Windows.Forms.Label();
39
+            this.textBox_density = new System.Windows.Forms.TextBox();
40
+            this.checkBox_upon = new System.Windows.Forms.CheckBox();
41
+            this.checkBox_below = new System.Windows.Forms.CheckBox();
42
+            this.SuspendLayout();
43
+            // 
44
+            // label1
45
+            // 
46
+            this.label1.AutoSize = true;
47
+            this.label1.Location = new System.Drawing.Point(51, 26);
48
+            this.label1.Name = "label1";
49
+            this.label1.Size = new System.Drawing.Size(127, 15);
50
+            this.label1.TabIndex = 0;
51
+            this.label1.Text = "高程点所在图层:";
52
+            // 
53
+            // label2
54
+            // 
55
+            this.label2.AutoSize = true;
56
+            this.label2.Location = new System.Drawing.Point(66, 75);
57
+            this.label2.Name = "label2";
58
+            this.label2.Size = new System.Drawing.Size(112, 15);
59
+            this.label2.TabIndex = 1;
60
+            this.label2.Text = "格网所在图层:";
61
+            // 
62
+            // comboBox_ptLayer
63
+            // 
64
+            this.comboBox_ptLayer.FormattingEnabled = true;
65
+            this.comboBox_ptLayer.Location = new System.Drawing.Point(184, 23);
66
+            this.comboBox_ptLayer.Name = "comboBox_ptLayer";
67
+            this.comboBox_ptLayer.Size = new System.Drawing.Size(197, 23);
68
+            this.comboBox_ptLayer.TabIndex = 2;
69
+            // 
70
+            // comboBox_gw
71
+            // 
72
+            this.comboBox_gw.FormattingEnabled = true;
73
+            this.comboBox_gw.Location = new System.Drawing.Point(184, 72);
74
+            this.comboBox_gw.Name = "comboBox_gw";
75
+            this.comboBox_gw.Size = new System.Drawing.Size(197, 23);
76
+            this.comboBox_gw.TabIndex = 3;
77
+            // 
78
+            // button_ok
79
+            // 
80
+            this.button_ok.Location = new System.Drawing.Point(99, 167);
81
+            this.button_ok.Name = "button_ok";
82
+            this.button_ok.Size = new System.Drawing.Size(75, 29);
83
+            this.button_ok.TabIndex = 6;
84
+            this.button_ok.Text = "确 定";
85
+            this.button_ok.UseVisualStyleBackColor = true;
86
+            this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
87
+            // 
88
+            // button_cancel
89
+            // 
90
+            this.button_cancel.Location = new System.Drawing.Point(289, 167);
91
+            this.button_cancel.Name = "button_cancel";
92
+            this.button_cancel.Size = new System.Drawing.Size(75, 29);
93
+            this.button_cancel.TabIndex = 7;
94
+            this.button_cancel.Text = "取 消";
95
+            this.button_cancel.UseVisualStyleBackColor = true;
96
+            this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click);
97
+            // 
98
+            // label3
99
+            // 
100
+            this.label3.AutoSize = true;
101
+            this.label3.Location = new System.Drawing.Point(45, 128);
102
+            this.label3.Name = "label3";
103
+            this.label3.Size = new System.Drawing.Size(52, 15);
104
+            this.label3.TabIndex = 8;
105
+            this.label3.Text = "密度:";
106
+            // 
107
+            // textBox_density
108
+            // 
109
+            this.textBox_density.Location = new System.Drawing.Point(103, 122);
110
+            this.textBox_density.Name = "textBox_density";
111
+            this.textBox_density.Size = new System.Drawing.Size(100, 25);
112
+            this.textBox_density.TabIndex = 9;
113
+            // 
114
+            // checkBox_upon
115
+            // 
116
+            this.checkBox_upon.AutoSize = true;
117
+            this.checkBox_upon.Location = new System.Drawing.Point(345, 124);
118
+            this.checkBox_upon.Name = "checkBox_upon";
119
+            this.checkBox_upon.Size = new System.Drawing.Size(89, 19);
120
+            this.checkBox_upon.TabIndex = 10;
121
+            this.checkBox_upon.Text = "大于密度";
122
+            this.checkBox_upon.UseVisualStyleBackColor = true;
123
+            // 
124
+            // checkBox_below
125
+            // 
126
+            this.checkBox_below.AutoSize = true;
127
+            this.checkBox_below.Location = new System.Drawing.Point(235, 124);
128
+            this.checkBox_below.Name = "checkBox_below";
129
+            this.checkBox_below.Size = new System.Drawing.Size(89, 19);
130
+            this.checkBox_below.TabIndex = 11;
131
+            this.checkBox_below.Text = "小于密度";
132
+            this.checkBox_below.UseVisualStyleBackColor = true;
133
+            // 
134
+            // EleptDensity
135
+            // 
136
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
137
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138
+            this.ClientSize = new System.Drawing.Size(468, 219);
139
+            this.Controls.Add(this.checkBox_below);
140
+            this.Controls.Add(this.checkBox_upon);
141
+            this.Controls.Add(this.textBox_density);
142
+            this.Controls.Add(this.label3);
143
+            this.Controls.Add(this.button_cancel);
144
+            this.Controls.Add(this.button_ok);
145
+            this.Controls.Add(this.comboBox_gw);
146
+            this.Controls.Add(this.comboBox_ptLayer);
147
+            this.Controls.Add(this.label2);
148
+            this.Controls.Add(this.label1);
149
+            this.Name = "EleptDensity";
150
+            this.Text = "高程点密度检查";
151
+            this.Load += new System.EventHandler(this.EleptDensity_Load);
152
+            this.ResumeLayout(false);
153
+            this.PerformLayout();
154
+
155
+        }
156
+
157
+        #endregion
158
+
159
+        private System.Windows.Forms.Label label1;
160
+        private System.Windows.Forms.Label label2;
161
+        private System.Windows.Forms.ComboBox comboBox_ptLayer;
162
+        private System.Windows.Forms.ComboBox comboBox_gw;
163
+        private System.Windows.Forms.Button button_ok;
164
+        private System.Windows.Forms.Button button_cancel;
165
+        private System.Windows.Forms.Label label3;
166
+        private System.Windows.Forms.TextBox textBox_density;
167
+        private System.Windows.Forms.CheckBox checkBox_upon;
168
+        private System.Windows.Forms.CheckBox checkBox_below;
169
+    }
170
+}

+ 100
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.cs 查看文件

@@ -0,0 +1,100 @@
1
+using GrxCAD.DatabaseServices;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace HCTools
13
+{
14
+    public partial class EleptDensity : Form
15
+    {
16
+        public EleptDensity()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void EleptDensity_Load(object sender, EventArgs e)
22
+        {
23
+            this.comboBox_ptLayer.DropDownStyle = ComboBoxStyle.DropDownList;
24
+            this.comboBox_gw.DropDownStyle = ComboBoxStyle.DropDownList;
25
+
26
+            this.MaximizeBox = false;
27
+            this.StartPosition = FormStartPosition.CenterScreen;
28
+
29
+            //自动填充下拉框
30
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
31
+            using (Transaction traction = database.TransactionManager.StartTransaction())
32
+            {
33
+                //存放所有图层名
34
+                List<string> alllayername = new List<string>();
35
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
36
+                foreach (ObjectId objid in layertable)
37
+                {
38
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
39
+                    alllayername.Add(layertablerecord.Name);
40
+                }
41
+                alllayername.Sort();
42
+
43
+                for (int i = 0; i < alllayername.Count; i++)
44
+                {
45
+                    this.comboBox_ptLayer.Items.Add(alllayername[i]);
46
+                    this.comboBox_gw.Items.Add(alllayername[i]);
47
+                }
48
+
49
+                if (alllayername.Contains("8300"))
50
+                {
51
+                    int index = alllayername.IndexOf("8300");
52
+                    this.comboBox_ptLayer.SelectedIndex = index;
53
+                }
54
+                traction.Commit();
55
+            }
56
+        }
57
+
58
+        private void button_cancel_Click(object sender, EventArgs e)
59
+        {
60
+            this.Close();
61
+        }
62
+
63
+        private void button_ok_Click(object sender, EventArgs e)
64
+        {
65
+            if(comboBox_ptLayer.Text == "")
66
+            { 
67
+                MessageBox.Show("请选择高程点所在图层!");
68
+                return;
69
+            }
70
+            if (comboBox_gw.Text == "")
71
+            { 
72
+                MessageBox.Show("请选择格网所在图层!");
73
+                return;
74
+            }
75
+            if (textBox_density.Text == "")
76
+            {
77
+                MessageBox.Show("请输入密度!");
78
+                return;
79
+            }
80
+            EleptDenck.ptlayer = comboBox_ptLayer.Text;
81
+            EleptDenck.tklayer = comboBox_gw.Text;
82
+            EleptDenck.density = Convert.ToDouble(textBox_density.Text);
83
+            if(checkBox_below.Checked && !checkBox_upon.Checked)
84
+                EleptDenck.flag = 1;
85
+            else if (!checkBox_below.Checked && checkBox_upon.Checked)
86
+                EleptDenck.flag = 2;
87
+            else if(checkBox_below.Checked && checkBox_upon.Checked)
88
+                EleptDenck.flag = 3;
89
+            else if(!checkBox_below.Checked && !checkBox_upon.Checked)
90
+            { 
91
+                MessageBox.Show("请选择“大于密度”/“小于密度”!");
92
+                return;
93
+            }
94
+
95
+            EleptDenck denck = new EleptDenck();
96
+            denck.Ptdensity();
97
+            this.Close();
98
+        }
99
+    }
100
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 612
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/FeatureOverlap.cs 查看文件

@@ -0,0 +1,612 @@
1
+using GrxCAD.ApplicationServices;
2
+using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
4
+using GrxCAD.Geometry;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+
11
+namespace HCTools
12
+{
13
+    class FeatureOverlap
14
+    {
15
+
16
+        //比例尺
17
+        public static int blc;
18
+        //重叠地物数量
19
+        private int number = 0;
20
+        public void check()
21
+        {
22
+            LayerControl lc = new LayerControl();
23
+            if (lc.haslayername("地物重叠") == false)
24
+            {
25
+                lc.creatlayer("地物重叠", new colorgb(255, 0, 255));
26
+                lc.movelayertofront("地物重叠");
27
+            }
28
+            else
29
+            {
30
+                lc.movelayertofront("地物重叠");
31
+            }
32
+            //选择块
33
+            selecblock();
34
+            search(blocklist,entitylist);
35
+        }
36
+
37
+        /// <summary>
38
+        /// 定义一个块类,主要包括位置和名字
39
+        /// </summary>
40
+        public struct Block
41
+        {
42
+            public double x;
43
+            public double y;
44
+            public double z;
45
+            public string name;
46
+
47
+            public Block(double x, double y, double z, string name)
48
+            {
49
+                this.x = x;
50
+                this.y = y;
51
+                this.z = z;
52
+                this.name = name;
53
+            }
54
+        }
55
+
56
+        //块列表
57
+        private List<Block> blocklist = new List<Block>();
58
+        private List<Entity> entitylist = new List<Entity>();
59
+        private void selecblock()
60
+        {
61
+            Document document = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
62
+            Database database = HostApplicationServices.WorkingDatabase;
63
+            DocumentLock documentlock = null;
64
+            Transaction traction = null;
65
+            try
66
+            {
67
+                traction = database.TransactionManager.StartTransaction();
68
+                documentlock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
69
+                BlockTable blocktable = traction.GetObject(database.BlockTableId,
70
+                                          OpenMode.ForRead) as BlockTable;
71
+                Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
72
+                TypedValue[] typedvalue = new TypedValue[1];
73
+                typedvalue.SetValue(new TypedValue((int)DxfCode.Start, "Insert"), 0);
74
+                SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
75
+                PromptSelectionResult psr = editor.GetSelection(selectionfilter); ///手动选择块参照
76
+                //PromptSelectionResult psr = editor.SelectAll();
77
+                if (psr.Status == PromptStatus.OK)
78
+                {
79
+                    SelectionSet selectionset = psr.Value;
80
+                    ObjectId[] obj = new ObjectId[selectionset.Count];
81
+                    obj = selectionset.GetObjectIds();
82
+                    for (int i = 0; i < obj.Length; i++)
83
+                    {
84
+                        ObjectId objid = obj[i];
85
+                        Entity entity = (Entity)traction.GetObject(objid, OpenMode.ForWrite);
86
+                        if (entity is BlockReference)
87
+                        {
88
+                            BlockReference block = entity as BlockReference;
89
+                            ObjectId id = block.BlockTableRecord;
90
+                            BlockTableRecord blocktablerecord = traction.GetObject(id,
91
+                                                            OpenMode.ForRead) as BlockTableRecord;
92
+                            string blockname = blocktablerecord.Name.ToLower();
93
+                            Block blc = new Block();
94
+                            ///块参照的位置
95
+                            blc.x = block.Position.X;
96
+                            blc.y = block.Position.Y;
97
+                            blc.z = block.Position.Z;
98
+                            blc.name = blockname;
99
+                            ///块参照的名称
100
+                            switch (blockname)
101
+                            {
102
+                                case "gc028":
103
+                                case "gc090":
104
+                                case "gc110":
105
+                                case "gc111":
106
+                                case "gc119":
107
+                                case "gc120":
108
+                                case "gc121":
109
+                                case "gc122":
110
+                                case "gc124":
111
+                                case "gc125":
112
+                                case "gc126":
113
+                                case "gc143":
114
+                                case "gc144":
115
+                                case "gc145":
116
+                                case "gc160":
117
+                                case "gc163":
118
+                                case "gc164":
119
+                                case "gc165":
120
+                                case "gc200":
121
+                                case "gc205":
122
+                                case "gc206":
123
+                                case "gc207":
124
+                                case "gc208":
125
+                                case "gc210":
126
+                                case "gc211":
127
+                                case "gc213":
128
+                                case "gc246":
129
+                                case "gc251":
130
+                                case "gc253":
131
+                                case "gc254":
132
+                                case "gc319":
133
+                                case "gc320":
134
+                                case "gc322":
135
+                                case "gc323":
136
+                                case "gc325":
137
+                                case "gc326":
138
+                                    entitylist.Add(entity);
139
+                                    blocklist.Add(blc);
140
+                                    break;
141
+                                case "gc170":
142
+                                    if (block.Layer == "9000")
143
+                                    {
144
+                                        entitylist.Add(entity);
145
+                                        blocklist.Add(blc);
146
+                                    }
147
+                                    break;
148
+
149
+                                default:
150
+                                    break;
151
+                            }
152
+                        }
153
+                    }
154
+                    editor.WriteMessage("\n" + "选中块数量:" + blocklist.Count.ToString());
155
+                }
156
+                traction.Commit();
157
+            }
158
+            catch (GrxCAD.Runtime.Exception)
159
+            {
160
+                traction.Abort();
161
+                return;
162
+            }
163
+            finally
164
+            {
165
+                traction.Dispose();
166
+                documentlock.Dispose();
167
+            }
168
+        }
169
+
170
+
171
+        /// <summary>
172
+        /// 寻找与上面已选实体相交的那部分
173
+        /// </summary>
174
+        /// <param name="list"></param>
175
+        public void search(List<Block> list, List<Entity> list1)
176
+        {
177
+            Database database = HostApplicationServices.WorkingDatabase;
178
+            Transaction traction = null;
179
+            DocumentLock documentlock = null;
180
+            try
181
+            {
182
+                Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
183
+                for (int i = 0; i < list.Count; i++)
184
+                {
185
+                    double x = Math.Round((double)list[i].x, 3, MidpointRounding.AwayFromZero);
186
+                    double y = Math.Round((double)list[i].y, 3, MidpointRounding.AwayFromZero);
187
+                    Entity entity1 = list1[i];
188
+                    string name = list[i].name;
189
+                    rebound reb = get_boundary(name);
190
+                    double height = reb.height;
191
+                    double width = reb.width;
192
+                    int type = reb.type;
193
+                    ///按照比例尺决定大小
194
+                    if (blc == 1000)
195
+                    {
196
+                        height = height / 2;
197
+                        width = width / 2;
198
+                    }
199
+                    else if (blc == 500)
200
+                    {
201
+                        height = height / 4;
202
+                        width = width / 4;
203
+                    }
204
+                    else if (blc == 2000)
205
+                    {
206
+                        height = height * 1;
207
+                        width = width * 1;
208
+                    }
209
+                    ///是为了获得四个角,好框选整个图形
210
+                    Point3d p1 = new Point3d(x - width, y, 0);
211
+                    Point3d p2 = new Point3d(x + width, y, 0);
212
+                    Point3d p3 = new Point3d(x + width, y + height, 0);
213
+                    Point3d p4 = new Point3d(x - width, y + height, 0);
214
+                    if (type == 2)
215
+                    {
216
+                        p1 = new Point3d(x - width, y - height, 0);
217
+                        p2 = new Point3d(x + width, y - height, 0);
218
+                        p3 = new Point3d(x + width, y + height, 0);
219
+                        p4 = new Point3d(x - width, y + height, 0);
220
+                    }
221
+                    else if (type == 3)
222
+                    {
223
+                        p1 = new Point3d(x - width, y - height, 0);
224
+                        p2 = new Point3d(x + width, y - height, 0);
225
+                        p3 = new Point3d(x + width, y, 0);
226
+                        p4 = new Point3d(x - width, y, 0);
227
+                    }
228
+                    using (Transaction acTrans = database.TransactionManager.StartTransaction())
229
+                    {
230
+                        ViewTableRecord currview = editor.GetCurrentView();
231
+                        currview.CenterPoint = new Point2d(x, y);
232
+                        currview.ViewDirection = new Vector3d(0, 0, 1);
233
+                        currview.Width = 40;
234
+                        currview.Height = 40;
235
+                        editor.SetCurrentView(currview);
236
+                        acTrans.Commit();
237
+                    }
238
+
239
+                    PromptSelectionResult pselectresult = editor.SelectCrossingWindow(p1, p3);///框选范围内相交的实体
240
+                                                                                              ///如果有,按照类型对相交实体进行判断
241
+
242
+                    traction = database.TransactionManager.StartTransaction();
243
+                    documentlock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
244
+                    BlockTable blocktable = traction.GetObject(database.BlockTableId,
245
+                                                 OpenMode.ForRead) as BlockTable;
246
+                    BlockTableRecord blocktablerecord = traction.GetObject(blocktable[BlockTableRecord.ModelSpace],
247
+                                                    OpenMode.ForWrite) as BlockTableRecord;
248
+                    if (pselectresult.Status == PromptStatus.OK)
249
+                    {
250
+                        SelectionSet selectionset = pselectresult.Value;
251
+                        ObjectId[] obj = new ObjectId[selectionset.Count];
252
+                        obj = selectionset.GetObjectIds();
253
+                        int count = 0;
254
+                        for (int j = 0; j < obj.Length; j++)
255
+                        {
256
+                            ObjectId objid = obj[j];
257
+                            Entity entity = (Entity)traction.GetObject(objid, OpenMode.ForWrite);
258
+                            ///块参照
259
+                            if (entity is BlockReference)
260
+                            {
261
+                                BlockReference cblock = entity as BlockReference;
262
+                                ObjectId cid = cblock.BlockTableRecord;
263
+                                BlockTableRecord crecord = traction.GetObject(cid,
264
+                                                                OpenMode.ForRead) as BlockTableRecord;
265
+                                string blockname = crecord.Name.ToLower();
266
+                                if (blockname != "gc086")
267
+                                {
268
+                                    count++;
269
+                                }
270
+                            }
271
+                            ///文字
272
+                            else if (entity is DBText)
273
+                            {
274
+                                string layer = entity.Layer;
275
+                                if (layer != "0")
276
+                                {
277
+                                    if (entity1 is BlockReference)
278
+                                    {
279
+                                        BlockReference cblock = entity1 as BlockReference;
280
+                                        DBText txt = entity as DBText;
281
+                                        if (cblock.Position.Z.ToString("N1") != txt.TextString)
282
+                                            count++;
283
+                                    }
284
+                                }
285
+                            }
286
+                            ///线
287
+                            else if (entity is Polyline || entity is Polyline2d)
288
+                            {
289
+                                string layer = entity.Layer;
290
+                                if (layer == "4400" || layer == "6100" || layer == "4300" || layer == "2000")
291
+                                {
292
+                                    if (name != "gc200")
293
+                                    {
294
+                                        count++;
295
+                                    }
296
+                                }
297
+                            }
298
+
299
+                        }
300
+                        if (count > 1)
301
+                        {
302
+                            double height1 = 2 * height;
303
+                            Point3d orip = new Point3d(x, y, 0);
304
+                            Point3d newp = new Point3d(x, y + height1, 0);
305
+                            if (name == "gc120" || name == "gc119" || name == "gc126" || name == "gc123" || name == "gc325" || name == "gc205"
306
+                                     || name == "gc206" || name == "gc207" || name == "gc125" || name == "gc165" || name == "gc326" || name == "gc170"
307
+                                     || name == "gc160" || name == "gc246" || name == "gc208" || name == "gc121" || name == "gc163" || name == "gc164"
308
+                                     || name == "gc090" || name == "gc124" || name == "gc379")
309
+                            {
310
+                                if (entity1.IsWriteEnabled == true)
311
+                                {
312
+                                    Move(entity1, orip, newp);
313
+                                }
314
+                            }
315
+                            
316
+                            double px1 = p1.X;
317
+                            double py1 = p1.Y;
318
+                            double px2 = p2.X;
319
+                            double py2 = p2.Y;
320
+                            double px3 = p3.X;
321
+                            double py3 = p3.Y;
322
+                            double px4 = p4.X;
323
+                            double py4 = p4.Y;
324
+                            p1 = new Point3d(px1, py1 + height1, 0);
325
+                            p2 = new Point3d(px2, py2 + height1, 0);
326
+                            p3 = new Point3d(px3, py3 + height1, 0);
327
+                            p4 = new Point3d(px4, py4 + height1, 0);
328
+                            Point3dCollection coll = new Point3dCollection();
329
+                            coll.Add(p1);
330
+                            coll.Add(p2);
331
+                            coll.Add(p3);
332
+                            coll.Add(p4);
333
+                            Polyline2d line2d = new Polyline2d(Poly2dType.SimplePoly, coll, 0, true, 0, 0, null);
334
+                            line2d.SetDatabaseDefaults();
335
+                            line2d.Layer = "地物重叠";
336
+                            blocktablerecord.AppendEntity(line2d);
337
+                            traction.AddNewlyCreatedDBObject(line2d, true);
338
+                            number++;
339
+                        }
340
+                    }
341
+                    traction.Commit();
342
+                }
343
+                editor.WriteMessage("\n");
344
+                editor.WriteMessage("检测到重叠地物:" + number);
345
+                editor.WriteMessage("\n");
346
+                number = 0;
347
+            }
348
+            catch (GrxCAD.Runtime.Exception)
349
+            {
350
+                traction.Abort();
351
+                return;
352
+            }
353
+            finally
354
+            {
355
+                if (documentlock != null)
356
+                {
357
+                    documentlock.Dispose();
358
+                }
359
+                if (traction != null)
360
+                {
361
+                    traction.Dispose();
362
+                }
363
+            }
364
+        }
365
+
366
+        /// <summary>
367
+        /// type=1表示图形为上半部分,type=2表示图形为上下两部分,type=3表示下半部分(中心点跟图形的关系)
368
+        /// </summary>
369
+        private struct rebound
370
+        {
371
+            public double height;
372
+            public double width;
373
+            public int type;
374
+
375
+            public rebound(double height, double width, int type)
376
+            {
377
+                this.height = height;
378
+                this.width = width;
379
+                this.type = type;
380
+            }
381
+        }
382
+
383
+        /// <summary>
384
+        /// 对每个地物图标的大小进行绘制
385
+        /// </summary>
386
+        /// <param name="name"></param>
387
+        /// <returns></returns>
388
+        private rebound get_boundary(string name)
389
+        {
390
+            double height = 0;
391
+            double width = 0;
392
+            int type = 0;
393
+
394
+            switch (name)
395
+            {
396
+                case "gc028":
397
+                    height = 5;
398
+                    width = 4;
399
+                    type = 2;
400
+                    break;
401
+                case "gc090":
402
+                    height = 2.5;
403
+                    width = 2.5;
404
+                    type = 2;
405
+                    break;
406
+                //case "gc110":
407
+                //    height = 4;
408
+                //    width = 4;
409
+                //    type = 2;
410
+                //    break;
411
+
412
+                //case "gc111":
413
+                //    height = 4;
414
+                //    width = 4;
415
+                //    type = 2;
416
+                //    break;
417
+
418
+                case "gc119":
419
+                    height = 2.6;
420
+                    width = 2.6;
421
+                    type = 1;
422
+                    break;
423
+                case "gc120":
424
+                    height = 5;
425
+                    width = 1;
426
+                    type = 1;
427
+                    break;
428
+                case "gc121":
429
+                    height = 1.1;
430
+                    width = 1.1;
431
+                    type = 2;
432
+                    break;
433
+                case "gc122":
434
+                    height = 2.1;
435
+                    width = 1.1;
436
+                    type = 2;
437
+                    break;
438
+                case "gc123":
439
+                    height = 4.2;
440
+                    width = 2.1;
441
+                    type = 2;
442
+                    break;
443
+                case "gc124":
444
+                    height = 3;
445
+                    width = 1.5;
446
+                    type = 1;
447
+                    break;
448
+                case "gc125":
449
+                    height = 3.8;
450
+                    width = 1.2;
451
+                    type = 2;
452
+                    break;
453
+                case "gc126":
454
+                    height = 2.5;
455
+                    width = 3;
456
+                    type = 2;
457
+                    break;
458
+                case "gc143":
459
+                    height = 6;
460
+                    width = 2;
461
+                    type = 1;
462
+                    break;
463
+                case "gc144":
464
+                    height = 6;
465
+                    width = 2;
466
+                    type = 1;
467
+                    break;
468
+                case "gc145":
469
+                    height = 6;
470
+                    width = 2;
471
+                    type = 1;
472
+                    break;
473
+                case "gc160":
474
+                    height = 4.7;
475
+                    width = 4.7;
476
+                    type = 2;
477
+                    break;
478
+                case "gc163":
479
+                    height = 0.6;
480
+                    width = 2.5;
481
+                    type = 2;
482
+                    break;
483
+                case "gc164":
484
+                    height = 0.7;
485
+                    width = 0.7;
486
+                    type = 2;
487
+                    break;
488
+                case "gc165":
489
+                    height = 5;
490
+                    width = 1;
491
+                    type = 2;
492
+                    break;
493
+                case "gc170":
494
+                    height = 1.1;
495
+                    width = 1.1;
496
+                    type = 2;
497
+                    break;
498
+                case "gc200":
499
+                    height = 1.5;
500
+                    width = 1.5;
501
+                    type = 2;
502
+                    break;
503
+                case "gc205":
504
+                    height = 5;
505
+                    width = 2;
506
+                    type = 1;
507
+                    break;
508
+                case "gc206":
509
+                    height = 5;
510
+                    width = 2;
511
+                    type = 1;
512
+                    break;
513
+                case "gc207":
514
+                    height = 4;
515
+                    width = 1;
516
+                    type = 2;
517
+                    break;
518
+                case "gc208":
519
+                    height = 1.6;
520
+                    width = 2.4;
521
+                    type = 2;
522
+                    break;
523
+                case "gc210":
524
+                    height = 6;
525
+                    width = 2.2;
526
+                    type = 1;
527
+                    break;
528
+                case "gc211":
529
+                    height = 3;
530
+                    width = 2.8;
531
+                    type = 3;
532
+                    break;
533
+                case "gc212":
534
+                    height = 5;
535
+                    width = 2.6;
536
+                    type = 1;
537
+                    break;
538
+                case "gc246":
539
+                    height = 6;
540
+                    width = 4;
541
+                    type = 1;
542
+                    break;
543
+                case "gc251":
544
+                    height = 1;
545
+                    width = 3.5;
546
+                    type = 2;
547
+                    break;
548
+                case "gc253":
549
+                    height = 0.7;
550
+                    width = 0.7;
551
+                    type = 2;
552
+                    break;
553
+                case "gc254":
554
+                    height = 3;
555
+                    width = 2.5;
556
+                    type = 2;
557
+                    break;
558
+                case "gc319":
559
+                    height = 6;
560
+                    width = 2;
561
+                    type = 1;
562
+                    break;
563
+                case "gc320":
564
+                    height = 6;
565
+                    width = 2;
566
+                    type = 1;
567
+                    break;
568
+                case "gc322":
569
+                    height = 6;
570
+                    width = 2;
571
+                    type = 1;
572
+                    break;
573
+                case "gc323":
574
+                    height = 4;
575
+                    width = 1.1;
576
+                    type = 1;
577
+                    break;
578
+                case "gc325":
579
+                    height = 5;
580
+                    width = 0.7;
581
+                    type = 1;
582
+                    break;
583
+                case "gc326":
584
+                    height = 1.6;
585
+                    width = 1.6;
586
+                    type = 2;
587
+                    break;
588
+
589
+                default:
590
+                    height = 2.5;
591
+                    width = 2;
592
+                    type = 2;
593
+                    break;
594
+            }
595
+            rebound rec = new rebound(height, width, type);
596
+            return rec;
597
+        }
598
+
599
+        /// <summary>
600
+        /// 指定基点与目标点移动实体
601
+        /// </summary>
602
+        /// <param name="ent">实体对象</param>
603
+        /// <param name="BasePt">基点</param>
604
+        /// <param name="TargetPt">目标点</param>
605
+        public static void Move(Entity ent, Point3d basePt, Point3d targetPt)
606
+        {
607
+            Vector3d vec = targetPt - basePt;
608
+            Matrix3d mt = Matrix3d.Displacement(vec);
609
+            ent.TransformBy(mt);
610
+        }
611
+    }
612
+}

+ 114
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.Designer.cs 查看文件

@@ -0,0 +1,114 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class GCDdelete_Form
5
+    {
6
+        /// <summary>
7
+        /// Required designer variable.
8
+        /// </summary>
9
+        private System.ComponentModel.IContainer components = null;
10
+
11
+        /// <summary>
12
+        /// Clean up any resources being used.
13
+        /// </summary>
14
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15
+        protected override void Dispose(bool disposing)
16
+        {
17
+            if (disposing && (components != null))
18
+            {
19
+                components.Dispose();
20
+            }
21
+            base.Dispose(disposing);
22
+        }
23
+
24
+        #region Windows Form Designer generated code
25
+
26
+        /// <summary>
27
+        /// Required method for Designer support - do not modify
28
+        /// the contents of this method with the code editor.
29
+        /// </summary>
30
+        private void InitializeComponent()
31
+        {
32
+            this.label1 = new System.Windows.Forms.Label();
33
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
34
+            this.button1 = new System.Windows.Forms.Button();
35
+            this.label2 = new System.Windows.Forms.Label();
36
+            this.comboBox_blc = new System.Windows.Forms.ComboBox();
37
+            this.SuspendLayout();
38
+            // 
39
+            // label1
40
+            // 
41
+            this.label1.AutoSize = true;
42
+            this.label1.Location = new System.Drawing.Point(52, 93);
43
+            this.label1.Name = "label1";
44
+            this.label1.Size = new System.Drawing.Size(127, 15);
45
+            this.label1.TabIndex = 0;
46
+            this.label1.Text = "高程点所在图层:";
47
+            // 
48
+            // comboBox1
49
+            // 
50
+            this.comboBox1.FormattingEnabled = true;
51
+            this.comboBox1.Location = new System.Drawing.Point(185, 90);
52
+            this.comboBox1.Name = "comboBox1";
53
+            this.comboBox1.Size = new System.Drawing.Size(172, 23);
54
+            this.comboBox1.TabIndex = 1;
55
+            // 
56
+            // button1
57
+            // 
58
+            this.button1.Location = new System.Drawing.Point(176, 135);
59
+            this.button1.Name = "button1";
60
+            this.button1.Size = new System.Drawing.Size(67, 29);
61
+            this.button1.TabIndex = 2;
62
+            this.button1.Text = "确 定";
63
+            this.button1.UseVisualStyleBackColor = true;
64
+            this.button1.Click += new System.EventHandler(this.button1_Click);
65
+            // 
66
+            // label2
67
+            // 
68
+            this.label2.AutoSize = true;
69
+            this.label2.Location = new System.Drawing.Point(112, 41);
70
+            this.label2.Name = "label2";
71
+            this.label2.Size = new System.Drawing.Size(67, 15);
72
+            this.label2.TabIndex = 3;
73
+            this.label2.Text = "比例尺:";
74
+            // 
75
+            // comboBox_blc
76
+            // 
77
+            this.comboBox_blc.FormattingEnabled = true;
78
+            this.comboBox_blc.Items.AddRange(new object[] {
79
+            "1:500",
80
+            "1:2000",
81
+            "1:5000",
82
+            "1:10000"});
83
+            this.comboBox_blc.Location = new System.Drawing.Point(185, 38);
84
+            this.comboBox_blc.Name = "comboBox_blc";
85
+            this.comboBox_blc.Size = new System.Drawing.Size(172, 23);
86
+            this.comboBox_blc.TabIndex = 4;
87
+            // 
88
+            // GCDdelete_Form
89
+            // 
90
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
91
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
92
+            this.ClientSize = new System.Drawing.Size(427, 176);
93
+            this.Controls.Add(this.comboBox_blc);
94
+            this.Controls.Add(this.label2);
95
+            this.Controls.Add(this.button1);
96
+            this.Controls.Add(this.comboBox1);
97
+            this.Controls.Add(this.label1);
98
+            this.Name = "GCDdelete_Form";
99
+            this.Text = "删除整数值高程点";
100
+            this.Load += new System.EventHandler(this.GCDdelete_Form_Load);
101
+            this.ResumeLayout(false);
102
+            this.PerformLayout();
103
+
104
+        }
105
+
106
+        #endregion
107
+
108
+        private System.Windows.Forms.Label label1;
109
+        private System.Windows.Forms.ComboBox comboBox1;
110
+        private System.Windows.Forms.Button button1;
111
+        private System.Windows.Forms.Label label2;
112
+        private System.Windows.Forms.ComboBox comboBox_blc;
113
+    }
114
+}

+ 159
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.cs 查看文件

@@ -0,0 +1,159 @@
1
+using GrxCAD.DatabaseServices;
2
+using GrxCAD.EditorInput;
3
+using GrxCAD.Geometry;
4
+using System;
5
+using System.Collections.Generic;
6
+using System.ComponentModel;
7
+using System.Data;
8
+using System.Drawing;
9
+using System.Linq;
10
+using System.Text;
11
+using System.Threading.Tasks;
12
+using System.Windows.Forms;
13
+
14
+namespace HCTools
15
+{
16
+    public partial class GCDdelete_Form : Form
17
+    {
18
+        public GCDdelete_Form()
19
+        {
20
+            InitializeComponent();
21
+        }
22
+        string lyr = "";
23
+        int blc = -999;
24
+
25
+        private void GCDdelete_Form_Load(object sender, EventArgs e)
26
+        {
27
+            this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
28
+            this.comboBox_blc.DropDownStyle = ComboBoxStyle.DropDownList;
29
+
30
+            //自动填充下拉框
31
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
32
+            using (Transaction traction = database.TransactionManager.StartTransaction())
33
+            {
34
+                //存放所有图层名
35
+                List<string> alllayername = new List<string>();
36
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
37
+                foreach (ObjectId objid in layertable)
38
+                {
39
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
40
+                    alllayername.Add(layertablerecord.Name);
41
+                }
42
+
43
+                alllayername.Sort();
44
+
45
+                for (int i = 0; i < alllayername.Count; i++)
46
+                {
47
+                    this.comboBox1.Items.Add(alllayername[i]);
48
+                }
49
+
50
+                if (alllayername.Contains("8300"))
51
+                {
52
+                    int index = alllayername.IndexOf("8300");
53
+                    this.comboBox1.SelectedIndex = index;
54
+                }
55
+                traction.Commit();
56
+            }
57
+        }
58
+
59
+        private void button1_Click(object sender, EventArgs e)
60
+        {
61
+            if (comboBox1.Text == "")
62
+            {
63
+                MessageBox.Show("请选择高程点所在图层!");
64
+                return;
65
+            }
66
+            if (comboBox_blc.Text == "")
67
+            {
68
+                MessageBox.Show("请选择比例尺所在图层!");
69
+                return;
70
+            }
71
+            string blctext = comboBox_blc.Text;
72
+            int blcindex = blctext.LastIndexOf(':');
73
+            string strblc = blctext.Substring(blcindex + 1);
74
+            blc = Convert.ToInt32(strblc);
75
+            lyr = comboBox1.Text;
76
+            deletegcd();
77
+        }
78
+
79
+        private void deletegcd()
80
+        {
81
+            Database db = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
82
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
83
+            //获取高程点
84
+            TypedValue[] typedvalue = new TypedValue[1];
85
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, lyr), 0);
86
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
87
+            PromptSelectionResult psr = ed.SelectAll(selectionfilter);
88
+
89
+            if (psr.Status == PromptStatus.OK)
90
+            {
91
+                LayerControl layerscontrol = new LayerControl();
92
+                string layname = "整数值高程点";
93
+                if (layerscontrol.haslayername(layname) == false)
94
+                {
95
+                    colorgb col = new colorgb(255, 255, 0);
96
+                    layerscontrol.creatlayer(layname, col);
97
+                }
98
+
99
+
100
+                SelectionSet selectionset = psr.Value;
101
+                ObjectId[] obj = new ObjectId[selectionset.Count];
102
+                obj = selectionset.GetObjectIds();
103
+                for (int i = 0; i < obj.Length; i++)
104
+                {
105
+
106
+                    using (Transaction tran = db.TransactionManager.StartTransaction())
107
+                    {
108
+                        ObjectId objid = obj[i];
109
+
110
+                        //找到实体获取并判断高程
111
+                        Entity entity = (Entity)tran.GetObject(objid, OpenMode.ForWrite);
112
+
113
+                        if (entity is BlockReference)
114
+                        {
115
+                            BlockReference bref = (BlockReference)entity;
116
+                            double z = Math.Round(bref.Position.Z, 2, MidpointRounding.AwayFromZero);
117
+                            //判断四舍五入后是否为整数
118
+                            if (Math.Truncate(z) == Math.Round(z, MidpointRounding.AwayFromZero))
119
+                            {
120
+                                bref.Layer = "整数值高程点";
121
+                                //获取高程点旁的高程标注
122
+                                Point3d p1 = new Point3d(bref.Position.X - 4 * blc / 2000, bref.Position.Y - 4 * blc / 2000, 0);
123
+                                Point3d p2 = new Point3d(bref.Position.X + 4 * blc / 2000, bref.Position.Y + 4 * blc / 2000, 0);
124
+                                TypedValue[] typedvalue1 = new TypedValue[2];
125
+
126
+                                typedvalue1.SetValue(new TypedValue((int)DxfCode.Start, "Text"), 0);
127
+                                typedvalue1.SetValue(new TypedValue((int)DxfCode.LayerName, lyr), 1);
128
+
129
+                                SelectionFilter filter1 = new SelectionFilter(typedvalue1);
130
+                                PromptSelectionResult psr1 = ed.SelectCrossingWindow(p1, p2, filter1);
131
+
132
+                                if (psr1.Status == PromptStatus.OK)
133
+                                {
134
+                                    SelectionSet ss = psr1.Value;
135
+                                    ObjectId[] objids = new ObjectId[ss.Count];
136
+                                    objids = selectionset.GetObjectIds();
137
+                                    for (int ii = 0; ii < objids.Length; ii++)
138
+                                    {
139
+                                        ObjectId objid1 = objids[ii];
140
+                                        Entity ent = (Entity)tran.GetObject(objid1, OpenMode.ForWrite);
141
+                                        if(ent is DBText)
142
+                                        {
143
+                                            DBText txt = (DBText)ent;
144
+                                            if(Convert.ToDouble(txt.TextString)== Math.Round(bref.Position.Z, 2, MidpointRounding.AwayFromZero))
145
+                                                txt.Layer = "整数值高程点";
146
+                                        }
147
+                                    }
148
+                                }
149
+                            }
150
+                        }
151
+                        tran.Commit();
152
+                    }
153
+                }
154
+                ed.WriteMessage("删除完成\n");
155
+            }
156
+        }
157
+    }
158
+
159
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.resx 查看文件

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 331
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/HCTools.csproj 查看文件

@@ -0,0 +1,331 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{ABB97F2C-1CCA-4782-B144-A796879EBE66}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <RootNamespace>HCTools</RootNamespace>
10
+    <AssemblyName>HCTools</AssemblyName>
11
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12
+    <FileAlignment>512</FileAlignment>
13
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14
+    <Deterministic>true</Deterministic>
15
+  </PropertyGroup>
16
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
+    <PlatformTarget>AnyCPU</PlatformTarget>
18
+    <DebugSymbols>true</DebugSymbols>
19
+    <DebugType>full</DebugType>
20
+    <Optimize>false</Optimize>
21
+    <OutputPath>bin\Debug\</OutputPath>
22
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
23
+    <ErrorReport>prompt</ErrorReport>
24
+    <WarningLevel>4</WarningLevel>
25
+  </PropertyGroup>
26
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27
+    <PlatformTarget>AnyCPU</PlatformTarget>
28
+    <DebugType>pdbonly</DebugType>
29
+    <Optimize>true</Optimize>
30
+    <OutputPath>bin\Release\</OutputPath>
31
+    <DefineConstants>TRACE</DefineConstants>
32
+    <ErrorReport>prompt</ErrorReport>
33
+    <WarningLevel>4</WarningLevel>
34
+  </PropertyGroup>
35
+  <PropertyGroup>
36
+    <StartupObject />
37
+  </PropertyGroup>
38
+  <ItemGroup>
39
+    <Reference Include="gmap">
40
+      <HintPath>..\..\..\..\..\..\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc\gmap.dll</HintPath>
41
+      <Private>False</Private>
42
+    </Reference>
43
+    <Reference Include="gmdb">
44
+      <HintPath>..\..\..\..\..\..\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc\gmdb.dll</HintPath>
45
+      <Private>False</Private>
46
+    </Reference>
47
+    <Reference Include="GrxCAD.Interop">
48
+      <HintPath>..\..\..\..\..\..\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc-x64\GrxCAD.Interop.dll</HintPath>
49
+      <EmbedInteropTypes>True</EmbedInteropTypes>
50
+    </Reference>
51
+    <Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
52
+      <SpecificVersion>False</SpecificVersion>
53
+      <EmbedInteropTypes>True</EmbedInteropTypes>
54
+      <HintPath>..\..\..\CADTools\CADtools\bin\Debug\Microsoft.Office.Interop.Excel.dll</HintPath>
55
+    </Reference>
56
+    <Reference Include="NetTopologySuite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=f580a05016ebada1, processorArchitecture=MSIL">
57
+      <HintPath>..\packages\NetTopologySuite.2.6.0\lib\netstandard2.0\NetTopologySuite.dll</HintPath>
58
+    </Reference>
59
+    <Reference Include="System" />
60
+    <Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
61
+      <HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
62
+    </Reference>
63
+    <Reference Include="System.Core" />
64
+    <Reference Include="System.Management" />
65
+    <Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
66
+      <HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
67
+    </Reference>
68
+    <Reference Include="System.Numerics" />
69
+    <Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
70
+      <HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
71
+    </Reference>
72
+    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
73
+      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
74
+    </Reference>
75
+    <Reference Include="System.Xml.Linq" />
76
+    <Reference Include="System.Data.DataSetExtensions" />
77
+    <Reference Include="Microsoft.CSharp" />
78
+    <Reference Include="System.Data" />
79
+    <Reference Include="System.Deployment" />
80
+    <Reference Include="System.Drawing" />
81
+    <Reference Include="System.Net.Http" />
82
+    <Reference Include="System.Windows.Forms" />
83
+    <Reference Include="System.Xml" />
84
+  </ItemGroup>
85
+  <ItemGroup>
86
+    <Compile Include="AttributeForm.cs">
87
+      <SubType>Form</SubType>
88
+    </Compile>
89
+    <Compile Include="AttributeForm.Designer.cs">
90
+      <DependentUpon>AttributeForm.cs</DependentUpon>
91
+    </Compile>
92
+    <Compile Include="Attributeget.cs" />
93
+    <Compile Include="Chaginfos.cs">
94
+      <SubType>Form</SubType>
95
+    </Compile>
96
+    <Compile Include="Chaginfos.Designer.cs">
97
+      <DependentUpon>Chaginfos.cs</DependentUpon>
98
+    </Compile>
99
+    <Compile Include="CheckContourLine.cs" />
100
+    <Compile Include="CheckL.cs">
101
+      <SubType>Form</SubType>
102
+    </Compile>
103
+    <Compile Include="CheckL.Designer.cs">
104
+      <DependentUpon>CheckL.cs</DependentUpon>
105
+    </Compile>
106
+    <Compile Include="CheckPLOverlay.cs" />
107
+    <Compile Include="ChPLContradiction.cs" />
108
+    <Compile Include="CMCgis_Basicfunction.cs" />
109
+    <Compile Include="Conn.cs">
110
+      <SubType>Form</SubType>
111
+    </Compile>
112
+    <Compile Include="Conn.Designer.cs">
113
+      <DependentUpon>Conn.cs</DependentUpon>
114
+    </Compile>
115
+    <Compile Include="Connect.cs" />
116
+    <Compile Include="ContourLineFix.cs" />
117
+    <Compile Include="CutContourLine.cs" />
118
+    <Compile Include="CutCountL.cs">
119
+      <SubType>Form</SubType>
120
+    </Compile>
121
+    <Compile Include="CutCountL.Designer.cs">
122
+      <DependentUpon>CutCountL.cs</DependentUpon>
123
+    </Compile>
124
+    <Compile Include="DeleteElept.cs">
125
+      <SubType>Form</SubType>
126
+    </Compile>
127
+    <Compile Include="DeleteElept.Designer.cs">
128
+      <DependentUpon>DeleteElept.cs</DependentUpon>
129
+    </Compile>
130
+    <Compile Include="DeletePts.cs" />
131
+    <Compile Include="DgxAnnck.cs" />
132
+    <Compile Include="DgxAnno.cs">
133
+      <SubType>Form</SubType>
134
+    </Compile>
135
+    <Compile Include="DgxAnno.Designer.cs">
136
+      <DependentUpon>DgxAnno.cs</DependentUpon>
137
+    </Compile>
138
+    <Compile Include="DGXGeneral.cs">
139
+      <SubType>Form</SubType>
140
+    </Compile>
141
+    <Compile Include="DGXGeneral.Designer.cs">
142
+      <DependentUpon>DGXGeneral.cs</DependentUpon>
143
+    </Compile>
144
+    <Compile Include="DGXGeneralization.cs" />
145
+    <Compile Include="Dgxthrorvrd.cs" />
146
+    <Compile Include="Dgxthrorvrd_Form.cs">
147
+      <SubType>Form</SubType>
148
+    </Compile>
149
+    <Compile Include="Dgxthrorvrd_Form.Designer.cs">
150
+      <DependentUpon>Dgxthrorvrd_Form.cs</DependentUpon>
151
+    </Compile>
152
+    <Compile Include="ElePtCheck.cs" />
153
+    <Compile Include="EleptDenck.cs" />
154
+    <Compile Include="EleptDensity.cs">
155
+      <SubType>Form</SubType>
156
+    </Compile>
157
+    <Compile Include="EleptDensity.Designer.cs">
158
+      <DependentUpon>EleptDensity.cs</DependentUpon>
159
+    </Compile>
160
+    <Compile Include="EleRd.cs">
161
+      <SubType>Form</SubType>
162
+    </Compile>
163
+    <Compile Include="EleRd.Designer.cs">
164
+      <DependentUpon>EleRd.cs</DependentUpon>
165
+    </Compile>
166
+    <Compile Include="EleRound.cs" />
167
+    <Compile Include="FeatureOverlap.cs" />
168
+    <Compile Include="GCDdelete_Form.cs">
169
+      <SubType>Form</SubType>
170
+    </Compile>
171
+    <Compile Include="GCDdelete_Form.Designer.cs">
172
+      <DependentUpon>GCDdelete_Form.cs</DependentUpon>
173
+    </Compile>
174
+    <Compile Include="Hierak.cs">
175
+      <SubType>Form</SubType>
176
+    </Compile>
177
+    <Compile Include="Hierak.Designer.cs">
178
+      <DependentUpon>Hierak.cs</DependentUpon>
179
+    </Compile>
180
+    <Compile Include="Hierarchy.cs" />
181
+    <Compile Include="InsertDOM.cs" />
182
+    <Compile Include="InstDOM.cs">
183
+      <SubType>Form</SubType>
184
+    </Compile>
185
+    <Compile Include="InstDOM.Designer.cs">
186
+      <DependentUpon>InstDOM.cs</DependentUpon>
187
+    </Compile>
188
+    <Compile Include="Inters.cs" />
189
+    <Compile Include="Joinedge_Form.cs">
190
+      <SubType>Form</SubType>
191
+    </Compile>
192
+    <Compile Include="Joinedge_Form.Designer.cs">
193
+      <DependentUpon>Joinedge_Form.cs</DependentUpon>
194
+    </Compile>
195
+    <Compile Include="LayerChange.cs" />
196
+    <Compile Include="Layerchange_Form.cs">
197
+      <SubType>Form</SubType>
198
+    </Compile>
199
+    <Compile Include="Layerchange_Form.Designer.cs">
200
+      <DependentUpon>Layerchange_Form.cs</DependentUpon>
201
+    </Compile>
202
+    <Compile Include="MainClass.cs" />
203
+    <Compile Include="Menus.cs" />
204
+    <Compile Include="OutputbyTK_Form.cs">
205
+      <SubType>Form</SubType>
206
+    </Compile>
207
+    <Compile Include="OutputbyTK_Form.Designer.cs">
208
+      <DependentUpon>OutputbyTK_Form.cs</DependentUpon>
209
+    </Compile>
210
+    <Compile Include="PickupPoint.cs" />
211
+    <Compile Include="PicPts.cs">
212
+      <SubType>Form</SubType>
213
+    </Compile>
214
+    <Compile Include="PicPts.Designer.cs">
215
+      <DependentUpon>PicPts.cs</DependentUpon>
216
+    </Compile>
217
+    <Compile Include="PLError_Overlay.cs">
218
+      <SubType>Form</SubType>
219
+    </Compile>
220
+    <Compile Include="PLError_Overlay.Designer.cs">
221
+      <DependentUpon>PLError_Overlay.cs</DependentUpon>
222
+    </Compile>
223
+    <Compile Include="Properties\AssemblyInfo.cs" />
224
+    <Compile Include="PtCheck.cs">
225
+      <SubType>Form</SubType>
226
+    </Compile>
227
+    <Compile Include="PtCheck.Designer.cs">
228
+      <DependentUpon>PtCheck.cs</DependentUpon>
229
+    </Compile>
230
+    <Compile Include="Scale.cs">
231
+      <SubType>Form</SubType>
232
+    </Compile>
233
+    <Compile Include="Scale.Designer.cs">
234
+      <DependentUpon>Scale.cs</DependentUpon>
235
+    </Compile>
236
+    <Compile Include="TKInfo.cs">
237
+      <SubType>Form</SubType>
238
+    </Compile>
239
+    <Compile Include="TKInfo.Designer.cs">
240
+      <DependentUpon>TKInfo.cs</DependentUpon>
241
+    </Compile>
242
+    <EmbeddedResource Include="AttributeForm.resx">
243
+      <DependentUpon>AttributeForm.cs</DependentUpon>
244
+      <SubType>Designer</SubType>
245
+    </EmbeddedResource>
246
+    <EmbeddedResource Include="Chaginfos.resx">
247
+      <DependentUpon>Chaginfos.cs</DependentUpon>
248
+    </EmbeddedResource>
249
+    <EmbeddedResource Include="CheckL.resx">
250
+      <DependentUpon>CheckL.cs</DependentUpon>
251
+    </EmbeddedResource>
252
+    <EmbeddedResource Include="Conn.resx">
253
+      <DependentUpon>Conn.cs</DependentUpon>
254
+    </EmbeddedResource>
255
+    <EmbeddedResource Include="CutCountL.resx">
256
+      <DependentUpon>CutCountL.cs</DependentUpon>
257
+    </EmbeddedResource>
258
+    <EmbeddedResource Include="DeleteElept.resx">
259
+      <DependentUpon>DeleteElept.cs</DependentUpon>
260
+    </EmbeddedResource>
261
+    <EmbeddedResource Include="DgxAnno.resx">
262
+      <DependentUpon>DgxAnno.cs</DependentUpon>
263
+    </EmbeddedResource>
264
+    <EmbeddedResource Include="DGXGeneral.resx">
265
+      <DependentUpon>DGXGeneral.cs</DependentUpon>
266
+    </EmbeddedResource>
267
+    <EmbeddedResource Include="Dgxthrorvrd_Form.resx">
268
+      <DependentUpon>Dgxthrorvrd_Form.cs</DependentUpon>
269
+    </EmbeddedResource>
270
+    <EmbeddedResource Include="EleptDensity.resx">
271
+      <DependentUpon>EleptDensity.cs</DependentUpon>
272
+    </EmbeddedResource>
273
+    <EmbeddedResource Include="EleRd.resx">
274
+      <DependentUpon>EleRd.cs</DependentUpon>
275
+    </EmbeddedResource>
276
+    <EmbeddedResource Include="GCDdelete_Form.resx">
277
+      <DependentUpon>GCDdelete_Form.cs</DependentUpon>
278
+    </EmbeddedResource>
279
+    <EmbeddedResource Include="Hierak.resx">
280
+      <DependentUpon>Hierak.cs</DependentUpon>
281
+    </EmbeddedResource>
282
+    <EmbeddedResource Include="InstDOM.resx">
283
+      <DependentUpon>InstDOM.cs</DependentUpon>
284
+    </EmbeddedResource>
285
+    <EmbeddedResource Include="Joinedge_Form.resx">
286
+      <DependentUpon>Joinedge_Form.cs</DependentUpon>
287
+    </EmbeddedResource>
288
+    <EmbeddedResource Include="Layerchange_Form.resx">
289
+      <DependentUpon>Layerchange_Form.cs</DependentUpon>
290
+    </EmbeddedResource>
291
+    <EmbeddedResource Include="OutputbyTK_Form.resx">
292
+      <DependentUpon>OutputbyTK_Form.cs</DependentUpon>
293
+    </EmbeddedResource>
294
+    <EmbeddedResource Include="PicPts.resx">
295
+      <DependentUpon>PicPts.cs</DependentUpon>
296
+    </EmbeddedResource>
297
+    <EmbeddedResource Include="PLError_Overlay.resx">
298
+      <DependentUpon>PLError_Overlay.cs</DependentUpon>
299
+    </EmbeddedResource>
300
+    <EmbeddedResource Include="Properties\Resources.resx">
301
+      <Generator>ResXFileCodeGenerator</Generator>
302
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
303
+      <SubType>Designer</SubType>
304
+    </EmbeddedResource>
305
+    <Compile Include="Properties\Resources.Designer.cs">
306
+      <AutoGen>True</AutoGen>
307
+      <DependentUpon>Resources.resx</DependentUpon>
308
+    </Compile>
309
+    <EmbeddedResource Include="PtCheck.resx">
310
+      <DependentUpon>PtCheck.cs</DependentUpon>
311
+    </EmbeddedResource>
312
+    <EmbeddedResource Include="Scale.resx">
313
+      <DependentUpon>Scale.cs</DependentUpon>
314
+    </EmbeddedResource>
315
+    <EmbeddedResource Include="TKInfo.resx">
316
+      <DependentUpon>TKInfo.cs</DependentUpon>
317
+    </EmbeddedResource>
318
+    <None Include="App.config" />
319
+    <None Include="packages.config" />
320
+    <None Include="Properties\Settings.settings">
321
+      <Generator>SettingsSingleFileGenerator</Generator>
322
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
323
+    </None>
324
+    <Compile Include="Properties\Settings.Designer.cs">
325
+      <AutoGen>True</AutoGen>
326
+      <DependentUpon>Settings.settings</DependentUpon>
327
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
328
+    </Compile>
329
+  </ItemGroup>
330
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
331
+</Project>

+ 10
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/HCTools.csproj.user 查看文件

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <PropertyGroup>
4
+    <ProjectView>ProjectFiles</ProjectView>
5
+  </PropertyGroup>
6
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
7
+    <StartAction>Program</StartAction>
8
+    <StartProgram>E:\浩辰CAD 2020\gcad.exe</StartProgram>
9
+  </PropertyGroup>
10
+</Project>

+ 0
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.Designer.cs 查看文件


部分文件因为文件数量过多而无法显示

正在加载...
取消
保存