Bladeren bron

20250722提交

hctool最新版
qyx 3 dagen geleden
bovenliggende
commit
de86c917ac
100 gewijzigde bestanden met toevoegingen van 1793 en 15063 verwijderingen
  1. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/.vs/HCTools/v16/.suo
  2. 51
    1
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/App.config
  3. 71
    2
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/AttributeForm.Designer.cs
  4. 140
    1
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/AttributeForm.cs
  5. 177
    70
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/CMCgis_Basicfunction.cs
  6. 2
    2
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ChPLContradiction.cs
  7. 9
    7
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Chaginfos.cs
  8. 2
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Conn.cs
  9. 2
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ContourLineFix.cs
  10. 0
    97
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinterpl.Designer.cs
  11. 0
    38
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinterpl.cs
  12. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinterpl.resx
  13. 521
    233
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinters.cs
  14. 224
    1
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/HCTools.csproj
  15. 2
    2
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/HCTools.csproj.user
  16. 2
    1
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/InsertDOM.cs
  17. 128
    26
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/LayerChange.cs
  18. 48
    8
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Layerchange_Form.Designer.cs
  19. 32
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Layerchange_Form.cs
  20. 85
    6
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/MainClass.cs
  21. 21
    3
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Menus.cs
  22. 134
    16
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Properties/Settings.Designer.cs
  23. 38
    6
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Properties/Settings.settings
  24. 55
    81
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/TKInfo.Designer.cs
  25. 31
    10
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/TKInfo.cs
  26. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/HCTools.dll
  27. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/HCTools.pdb
  28. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  29. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  30. 1
    1
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.CoreCompileInputs.cache
  31. 17
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.FileListAbsolute.txt
  32. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.GenerateResource.cache
  33. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.dll
  34. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.pdb
  35. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/.suo
  36. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/000.testlog
  37. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/testlog.manifest
  38. 0
    25
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools.sln
  39. 0
    53
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/App.config
  40. 0
    158
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.Designer.cs
  41. 0
    277
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.cs
  42. 0
    123
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/AttributeForm.resx
  43. 0
    263
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Attributeget.cs
  44. 0
    2636
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CMCgis_Basicfunction.cs
  45. 0
    1103
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ChPLContradiction.cs
  46. 0
    171
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.Designer.cs
  47. 0
    352
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.cs
  48. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Chaginfos.resx
  49. 0
    95
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckContourLine.cs
  50. 0
    147
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.Designer.cs
  51. 0
    101
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.cs
  52. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckL.resx
  53. 0
    422
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CheckPLOverlay.cs
  54. 0
    154
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.Designer.cs
  55. 0
    113
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.cs
  56. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Conn.resx
  57. 0
    479
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Connect.cs
  58. 0
    173
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ContourLineFix.cs
  59. 0
    856
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutContourLine.cs
  60. 0
    244
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.Designer.cs
  61. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.cs
  62. 0
    143
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CutCountL.resx
  63. 0
    131
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.Designer.cs
  64. 0
    76
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.cs
  65. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneral.resx
  66. 0
    193
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DGXGeneralization.cs
  67. 0
    150
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.Designer.cs
  68. 0
    93
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.cs
  69. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeleteElept.resx
  70. 0
    149
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DeletePts.cs
  71. 0
    153
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnnck.cs
  72. 0
    170
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.Designer.cs
  73. 0
    101
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.cs
  74. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/DgxAnno.resx
  75. 0
    97
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.Designer.cs
  76. 0
    38
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.cs
  77. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinterpl.resx
  78. 0
    351
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxinters.cs
  79. 0
    398
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd.cs
  80. 0
    176
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.Designer.cs
  81. 0
    94
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.cs
  82. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Dgxthrorvrd_Form.resx
  83. 0
    288
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ElePtCheck.cs
  84. 0
    124
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.Designer.cs
  85. 0
    85
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.cs
  86. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRd.resx
  87. 0
    71
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleRound.cs
  88. 0
    156
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDenck.cs
  89. 0
    170
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.Designer.cs
  90. 0
    100
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.cs
  91. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/EleptDensity.resx
  92. 0
    612
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/FeatureOverlap.cs
  93. 0
    114
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.Designer.cs
  94. 0
    159
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.cs
  95. 0
    120
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/GCDdelete_Form.resx
  96. 0
    331
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/HCTools.csproj
  97. 0
    10
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/HCTools.csproj.user
  98. 0
    126
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.Designer.cs
  99. 0
    87
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.cs
  100. 0
    0
      加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.resx

BIN
加密后软件工具/CAD插件工具/源代码/HCTools/.vs/HCTools/v16/.suo Bestand weergeven


+ 51
- 1
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/App.config Bestand weergeven

@@ -1,6 +1,56 @@
1
-<?xml version="1.0" encoding="utf-8" ?>
1
+<?xml version="1.0" encoding="utf-8"?>
2 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>
3 8
     <startup> 
4 9
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5 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
+      <setting name="dgj" serializeAs="String">
52
+        <value>1</value>
53
+      </setting>
54
+    </HCTools.Properties.Settings>
55
+  </userSettings>
6 56
 </configuration>

+ 71
- 2
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/AttributeForm.Designer.cs Bestand weergeven

@@ -33,8 +33,16 @@ namespace HCTools
33 33
             this.dataGridView_Info = new System.Windows.Forms.DataGridView();
34 34
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
35 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();
36 40
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Info)).BeginInit();
37 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();
38 46
             this.SuspendLayout();
39 47
             // 
40 48
             // dataGridView_Info
@@ -46,8 +54,10 @@ namespace HCTools
46 54
             this.dataGridView_Info.Name = "dataGridView_Info";
47 55
             this.dataGridView_Info.RowHeadersWidth = 51;
48 56
             this.dataGridView_Info.RowTemplate.Height = 27;
49
-            this.dataGridView_Info.Size = new System.Drawing.Size(1010, 499);
57
+            this.dataGridView_Info.Size = new System.Drawing.Size(1010, 451);
50 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);
51 61
             this.dataGridView_Info.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.dataGridView_Info_SortCompare);
52 62
             // 
53 63
             // contextMenuStrip1
@@ -65,17 +75,72 @@ namespace HCTools
65 75
             this.缩放至ToolStripMenuItem.Text = "缩放至";
66 76
             this.缩放至ToolStripMenuItem.Click += new System.EventHandler(this.缩放至ToolStripMenuItem_Click);
67 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
+            // 
68 128
             // AttributeForm
69 129
             // 
70 130
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
71 131
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
72 132
             this.ClientSize = new System.Drawing.Size(1010, 499);
73
-            this.Controls.Add(this.dataGridView_Info);
133
+            this.Controls.Add(this.splitContainer1);
74 134
             this.Name = "AttributeForm";
75 135
             this.Text = "属性表";
136
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AttributeForm_FormClosed);
76 137
             this.Load += new System.EventHandler(this.AttributeForm_Load);
77 138
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Info)).EndInit();
78 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);
79 144
             this.ResumeLayout(false);
80 145
 
81 146
         }
@@ -85,5 +150,9 @@ namespace HCTools
85 150
         private System.Windows.Forms.DataGridView dataGridView_Info;
86 151
         private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
87 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;
88 157
     }
89 158
 }

+ 140
- 1
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/AttributeForm.cs Bestand weergeven

@@ -1,11 +1,13 @@
1 1
 using GrxCAD.ApplicationServices;
2 2
 using GrxCAD.DatabaseServices;
3
+using GrxCAD.EditorInput;
3 4
 using GrxCAD.Geometry;
4 5
 using System;
5 6
 using System.Collections.Generic;
6 7
 using System.ComponentModel;
7 8
 using System.Data;
8 9
 using System.Drawing;
10
+using System.IO;
9 11
 using System.Linq;
10 12
 using System.Text;
11 13
 using System.Threading.Tasks;
@@ -49,7 +51,7 @@ namespace HCTools
49 51
             //this.dataGridView_Info.RowHeadersVisible = false;
50 52
             this.dataGridView_Info.ReadOnly = true;
51 53
 
52
-            for (int i = 0;i<info_all.Count;i++)
54
+            for (int i = 0; i < info_all.Count; i++)
53 55
             {
54 56
                 dataGridView_Info.Rows.Add();
55 57
             }
@@ -134,5 +136,142 @@ namespace HCTools
134 136
                 throw;
135 137
             }
136 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
+        }
137 276
     }
138 277
 }

+ 177
- 70
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/CMCgis_Basicfunction.cs Bestand weergeven

@@ -9,7 +9,7 @@ using GrxCAD.DatabaseServices;
9 9
 using GrxCAD.ApplicationServices;
10 10
 using GrxCAD.EditorInput;
11 11
 using GrxCAD.Internal;
12
-
12
+using System.Windows.Forms;
13 13
 
14 14
 namespace HCTools
15 15
 {
@@ -54,9 +54,9 @@ namespace HCTools
54 54
         {
55 55
             ObjectId[] ids = null;
56 56
 
57
-            Document doc = Application.DocumentManager.MdiActiveDocument;
57
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
58 58
             Database db = doc.Database;
59
-            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
59
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
60 60
 
61 61
             TypedValue[] value = new TypedValue[]
62 62
             {
@@ -90,9 +90,9 @@ namespace HCTools
90 90
         {
91 91
             ObjectId[] ids = null;
92 92
 
93
-            Document doc = Application.DocumentManager.MdiActiveDocument;
93
+            Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
94 94
             Database db = doc.Database;
95
-            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
95
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
96 96
 
97 97
             TypedValue[] value = new TypedValue[]
98 98
             {
@@ -137,6 +137,21 @@ namespace HCTools
137 137
             doclock.Dispose();
138 138
             return ent;
139 139
         }
140
+        public static Entity GetDBObjectforW(ObjectId i)
141
+        {
142
+            //Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
143
+            //Database db = doc.Database;
144
+            Database db = HostApplicationServices.WorkingDatabase;
145
+            Entity ent = null;
146
+            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
147
+            using (Transaction tr = db.TransactionManager.StartTransaction())
148
+            {
149
+                ent = (Entity)tr.GetObject(i, OpenMode.ForWrite, true);
150
+                tr.Commit();
151
+            }
152
+            doclock.Dispose();
153
+            return ent;
154
+        }
140 155
 
141 156
 
142 157
         /// <summary>
@@ -863,6 +878,11 @@ namespace HCTools
863 878
             {
864 879
                 dist = 100;
865 880
 
881
+            }
882
+            if (BLC == 500)
883
+            {
884
+                dist = 50;
885
+
866 886
             }
867 887
             getinfo();
868 888
             for (int i = 0; i < TKpts.Count; i++)
@@ -912,7 +932,7 @@ namespace HCTools
912 932
 
913 933
                 //新建一个dwg
914 934
                 string templatePath = "acad.dwt";
915
-                DocumentCollection documentcoll = Application.DocumentManager;
935
+                DocumentCollection documentcoll = GrxCAD.ApplicationServices.Application.DocumentManager;
916 936
                 Document document = documentcoll.Add(templatePath);
917 937
                 Database database = document.Database;
918 938
 
@@ -934,8 +954,10 @@ namespace HCTools
934 954
                 draw();
935 955
 
936 956
                 zoom();
937
-                database.SaveAs(TKInfo.SV + "\\" + Number.ToString() + ".dwg", DwgVersion.AC1024);
938
-                document.CloseAndSave(Number.ToString() + ".dwg");
957
+                //database.SaveAs(TKInfo.SV + "\\" + Number.ToString() + ".dwg", DwgVersion.AC1024);
958
+                database.SaveAs(TKInfo.SV + "\\" + Number.ToString() + ".dwg", true, DwgVersion.AC1021, database.SecurityParameters);
959
+                //document.CloseAndSave(Number.ToString() + ".dwg");
960
+                document.CloseAndDiscard();
939 961
             }
940 962
         }
941 963
 
@@ -1079,6 +1101,30 @@ namespace HCTools
1079 1101
 
1080 1102
             }
1081 1103
 
1104
+            if (BLC == 500)
1105
+            {
1106
+                len = len / 4;        //分幅框标长度
1107
+                D22 = D22 / 4;        //内图廓线和外图廓线距离
1108
+                D1 = D1 / 4;        //间距为1
1109
+                D2 = D2 / 4;        //间距为2
1110
+                D3 = D3 / 4;        //间距为3
1111
+                D4 = D4 / 4;        //间距为4
1112
+                D4_8 = D4_8 / 4;      //间距为4.8   
1113
+                D5 = D5 / 4;        //间距为5  
1114
+                D6 = D6 / 4;        //间距为6
1115
+                D7 = D7 / 4;        //间距为7
1116
+                D8 = D8 / 4;        //间距为8
1117
+                D10 = D10 / 4;      //间距为10
1118
+                D12 = D12 / 4;      //间距为12
1119
+                D140 = D140 / 4;      //右下角附注
1120
+                D90 = D90 / 4;
1121
+                D48 = D48 / 4;
1122
+
1123
+                dist1 = dist1 / 4;        //接图表第一格填充间距
1124
+                dist2 = dist2 / 4;  //接图表填充间距
1125
+
1126
+            }
1127
+
1082 1128
 
1083 1129
             ObjectId HZ = gettextstyleID("HZ");
1084 1130
             ObjectId st = gettextstyleID("st");
@@ -1112,8 +1158,8 @@ namespace HCTools
1112 1158
             Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
1113 1159
 
1114 1160
 
1115
-            try
1116
-            {
1161
+            //try
1162
+            //{
1117 1163
 
1118 1164
 
1119 1165
                 //内图廓
@@ -1122,7 +1168,7 @@ namespace HCTools
1122 1168
                 Point3dCollection In1 = new Point3dCollection();
1123 1169
                 In1.Add(new Point3d(LT.X, LT.Y + D22 + D1, 0));
1124 1170
                 In1.Add(new Point3d(LB.X, LB.Y - D22 - D1, 0));
1125
-                Polyline2d LeftLine = new Polyline2d(Poly2dType.SimplePoly, In1, 0, true, 0, 0, null);
1171
+                Polyline2d LeftLine = new Polyline2d(Poly2dType.SimplePoly, In1, 0, false, 0, 0, null);
1126 1172
                 //LeftLine.Color = GrxCAD.Colors.Color.FromColor(System.Drawing.Color.Red);
1127 1173
                 LeftLine.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
1128 1174
                 LeftLine.Layer = layername;
@@ -1135,7 +1181,7 @@ namespace HCTools
1135 1181
                 Point3dCollection In2 = new Point3dCollection();
1136 1182
                 In2.Add(new Point3d(LB.X - D22 - D1, LB.Y, 0));
1137 1183
                 In2.Add(new Point3d(RB.X + D22 + D1, RB.Y, 0));
1138
-                Polyline2d LowLine = new Polyline2d(Poly2dType.SimplePoly, In2, 0, true, 0, 0, null);
1184
+                Polyline2d LowLine = new Polyline2d(Poly2dType.SimplePoly, In2, 0, false, 0, 0, null);
1139 1185
                 LowLine.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
1140 1186
 
1141 1187
                 LowLine.SetDatabaseDefaults();
@@ -1146,7 +1192,7 @@ namespace HCTools
1146 1192
                 Point3dCollection In3 = new Point3dCollection();
1147 1193
                 In3.Add(new Point3d(RT.X, RT.Y + D22 + D1, 0));
1148 1194
                 In3.Add(new Point3d(RB.X, RB.Y - D22 - D1, 0));
1149
-                Polyline2d RightLine = new Polyline2d(Poly2dType.SimplePoly, In3, 0, true, 0, 0, null);
1195
+                Polyline2d RightLine = new Polyline2d(Poly2dType.SimplePoly, In3, 0, false, 0, 0, null);
1150 1196
                 RightLine.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
1151 1197
                 RightLine.Layer = layername;
1152 1198
 
@@ -1158,7 +1204,7 @@ namespace HCTools
1158 1204
                 Point3dCollection In4 = new Point3dCollection();
1159 1205
                 In4.Add(new Point3d(LT.X - D22 - D1, LT.Y, 0));
1160 1206
                 In4.Add(new Point3d(RT.X + D22 + D1, RT.Y, 0));
1161
-                Polyline2d TOPLine = new Polyline2d(Poly2dType.SimplePoly, In4, 0, true, 0, 0, null);
1207
+                Polyline2d TOPLine = new Polyline2d(Poly2dType.SimplePoly, In4, 0, false, 0, 0, null);
1162 1208
                 TOPLine.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
1163 1209
                 TOPLine.Layer = layername;
1164 1210
 
@@ -1175,18 +1221,21 @@ namespace HCTools
1175 1221
                 Outcoll.Add(new Point3d(LT.X - D22 - D1, LT.Y + D22 + D1, 0));
1176 1222
 
1177 1223
                 Polyline2d line = new Polyline2d(Poly2dType.SimplePoly, Outcoll, 0, true, D2, D2, null);
1224
+            
1178 1225
                 line.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 1);
1179 1226
                 line.Layer = layername;
1180 1227
 
1181 1228
                 line.SetDatabaseDefaults();
1182 1229
                 blocktablerecord.AppendEntity(line);
1183 1230
                 traction.AddNewlyCreatedDBObject(line, true);
1231
+            line.UpgradeOpen();
1232
+            line.ConstantWidth = D2;
1184 1233
 
1185 1234
 
1186 1235
 
1187 1236
 
1188
-                //分幅框标
1189
-                for (int i = 1; i <= 4; i++)
1237
+            //分幅框标
1238
+            for (int i = 1; i <= 4; i++)
1190 1239
                 {
1191 1240
                     for (int j = 1; j <= 4; j++)
1192 1241
                     {
@@ -1310,21 +1359,50 @@ namespace HCTools
1310 1359
 
1311 1360
                 List<string> RLnote = new List<string>();
1312 1361
                 string str = "";
1313
-                str = "测图员 " + TKInfo.CTY;
1362
+            if (string.IsNullOrEmpty(TKInfo.CTY) == false)
1363
+            {
1364
+                str = TKInfo.CTY;
1314 1365
                 RLnote.Add(str);
1366
+            }
1315 1367
                 if (string.IsNullOrEmpty(TKInfo.TDY) == false)
1316 1368
                 {
1317
-                    str = "土调员 " + TKInfo.TDY;
1369
+                    str = TKInfo.TDY;
1318 1370
                     RLnote.Add(str);
1319 1371
                 }
1320
-                str = "数化员 " + TKInfo.SHY;
1372
+            if (string.IsNullOrEmpty(TKInfo.SHY) == false)
1373
+            {
1374
+                str = TKInfo.SHY;
1321 1375
                 RLnote.Add(str);
1322
-                str = "检查员 " + TKInfo.JCY;
1376
+            }
1377
+            if (string.IsNullOrEmpty(TKInfo.JCY) == false)
1378
+            {
1379
+                str = TKInfo.JCY;
1323 1380
                 RLnote.Add(str);
1381
+            }
1324 1382
                 str = "复查员 ";
1325 1383
                 RLnote.Add(str);
1384
+            //秘密等级
1385
+            if (string.IsNullOrEmpty(TKInfo.Secret) == false)
1386
+            {
1387
+                str = TKInfo.Secret;
1388
+                DBText text1_secret = new DBText();
1389
+                text1_secret.TextString = str;
1390
+                text1_secret.WidthFactor = 1.333;
1391
+                text1_secret.HorizontalMode = TextHorizontalMode.TextLeft;
1392
+                text1_secret.Height = D6;
1393
+                text1_secret.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
1394
+                text1_secret.Layer = layername;
1395
+                text1_secret.TextStyleId = ht;
1396
+                double s_x = RT.X - (text1_secret.Bounds.Value.MaxPoint.X - text1_secret.Bounds.Value.MinPoint.X) - D1;
1397
+                double s_y = LT.Y + D22 + D2 + D10;
1398
+                text1_secret.Position = new Point3d(s_x, s_y, 0);
1399
+
1400
+                text1_secret.SetDatabaseDefaults();
1401
+                blocktablerecord.AppendEntity(text1_secret);
1402
+                traction.AddNewlyCreatedDBObject(text1_secret, true);
1403
+            }
1326 1404
 
1327
-                for (int i = 0; i < RLnote.Count; i++)
1405
+            for (int i = 0; i < RLnote.Count; i++)
1328 1406
                 {
1329 1407
                     yy = yy - D6;
1330 1408
                     DBText text1_fz = new DBText();
@@ -1351,7 +1429,7 @@ namespace HCTools
1351 1429
                 DBText text2_blc = new DBText();
1352 1430
                 text2_blc.TextString = "1:" + BLC;
1353 1431
                 text2_blc.Position = new Point3d(xx, yy, 0);
1354
-                text2_blc.Height = D6;
1432
+                text2_blc.Height = D8;
1355 1433
                 text2_blc.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 2);
1356 1434
                 text2_blc.Layer = layername;
1357 1435
                 text2_blc.HorizontalMode = TextHorizontalMode.TextCenter;
@@ -1405,30 +1483,30 @@ namespace HCTools
1405 1483
 
1406 1484
 
1407 1485
                 //图名后的日期
1408
-                string Time_str = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString("00");
1409
-
1410
-                //左括号
1411
-                string tem_str = text4_tm.TextString;
1412
-                xx = (RB.X - LB.X) / 2 + LB.X + tem_str.Length / 2.0 * (D12);
1413
-                yy = LT.Y + D22 + D2 + D10 + D10 + D6;
1414
-                DBText text_F = new DBText();
1415
-                string black = "";
1416
-                for (int i = 0; i < D12; i++)
1417
-                {
1418
-                    black += " ";
1419
-                }
1420
-                text_F.TextString = "(" + Time_str + ")";
1421
-                text_F.Position = new Point3d(xx, yy, 0);
1422
-                text_F.Height = D12;
1423
-                text_F.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 2);
1424
-                text_F.Layer = layername;
1425
-                text_F.HorizontalMode = TextHorizontalMode.TextLeft;
1426
-                //text_F.TextStyleId = ID12;
1427
-                text_F.TextStyleId = ht;
1486
+                //string Time_str = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString("00");
1428 1487
 
1429
-                text_F.SetDatabaseDefaults();
1430
-                blocktablerecord.AppendEntity(text_F);
1431
-                traction.AddNewlyCreatedDBObject(text_F, true);
1488
+                ////左括号
1489
+                //string tem_str = text4_tm.TextString;
1490
+                //xx = (RB.X - LB.X) / 2 + LB.X + tem_str.Length / 2.0 * (D12);
1491
+                //yy = LT.Y + D22 + D2 + D10 + D10 + D6;
1492
+                //DBText text_F = new DBText();
1493
+                //string black = "";
1494
+                //for (int i = 0; i < D12; i++)
1495
+                //{
1496
+                //    black += " ";
1497
+                //}
1498
+                //text_F.TextString = "(" + Time_str + ")";
1499
+                //text_F.Position = new Point3d(xx, yy, 0);
1500
+                //text_F.Height = D12;
1501
+                //text_F.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 2);
1502
+                //text_F.Layer = layername;
1503
+                //text_F.HorizontalMode = TextHorizontalMode.TextLeft;
1504
+                ////text_F.TextStyleId = ID12;
1505
+                //text_F.TextStyleId = ht;
1506
+
1507
+                //text_F.SetDatabaseDefaults();
1508
+                //blocktablerecord.AppendEntity(text_F);
1509
+                //traction.AddNewlyCreatedDBObject(text_F, true);
1432 1510
 
1433 1511
 
1434 1512
                 //日期
@@ -1465,8 +1543,9 @@ namespace HCTools
1465 1543
 
1466 1544
                     if (i == strs.Length - 3)
1467 1545
                     {
1546
+                    string[] str1 = strs[i].Split(' ');
1468 1547
                         DBText text_fz1 = new DBText();
1469
-                        text_fz1.TextString = "GB/T20257.1-2007";
1548
+                        text_fz1.TextString = str1[0];
1470 1549
                         text_fz1.Position = new Point3d(xx, yy, 0);
1471 1550
                         text_fz1.Height = D6;
1472 1551
                         text_fz1.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
@@ -1478,9 +1557,9 @@ namespace HCTools
1478 1557
                         blocktablerecord.AppendEntity(text_fz1);
1479 1558
                         traction.AddNewlyCreatedDBObject(text_fz1, true);
1480 1559
 
1481
-                        xx = xx + D140 / 2;
1560
+                        xx = xx + D140 / 2 + D2;
1482 1561
                         DBText text_fz2 = new DBText();
1483
-                        text_fz2.TextString = "国家基本比例尺地图图式 第一部分:";
1562
+                        text_fz2.TextString = str1[1] + " " + str1[2];
1484 1563
                         text_fz2.Position = new Point3d(xx, yy, 0);
1485 1564
                         text_fz2.Height = D6;
1486 1565
                         text_fz2.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
@@ -1497,8 +1576,9 @@ namespace HCTools
1497 1576
                     }
1498 1577
                     else if (i == strs.Length - 2)
1499 1578
                     {
1579
+                    string[] str2 = strs[i].Split(' ');
1500 1580
                         DBText text_1 = new DBText();
1501
-                        text_1.TextString = "1:500 1:1000 1:2000";
1581
+                        text_1.TextString = str2[0]+" "+ str2[1] + " "+ str2[2];
1502 1582
                         text_1.Position = new Point3d(xx, yy, 0);
1503 1583
                         text_1.Height = D6;
1504 1584
                         text_1.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
@@ -1512,7 +1592,7 @@ namespace HCTools
1512 1592
 
1513 1593
                         xx = xx + D90;
1514 1594
                         DBText text_2 = new DBText();
1515
-                        text_2.TextString = "地形图图式";
1595
+                        text_2.TextString = str2[3];
1516 1596
                         text_2.Position = new Point3d(xx, yy, 0);
1517 1597
                         text_2.Height = D6;
1518 1598
                         text_2.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
@@ -1680,7 +1760,7 @@ namespace HCTools
1680 1760
                     text_L.TextString = Left_Number;
1681 1761
                     text_L.Position = new Point3d(xx2, yy2, 0);
1682 1762
                     text_L.Height = D5;
1683
-                    text_L.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 3);
1763
+                    text_L.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
1684 1764
                     text_L.Layer = layername;
1685 1765
                     text_L.TextStyleId = HZ;
1686 1766
                     text_L.HorizontalMode = TextHorizontalMode.TextCenter;
@@ -1706,7 +1786,7 @@ namespace HCTools
1706 1786
                     text_R.TextString = Right_Number;
1707 1787
                     text_R.Position = new Point3d(xx2, yy2, 0);
1708 1788
                     text_R.Height = D5;
1709
-                    text_R.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 3);
1789
+                    text_R.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
1710 1790
                     text_R.Layer = layername;
1711 1791
                     text_R.TextStyleId = HZ;
1712 1792
                     text_R.HorizontalMode = TextHorizontalMode.TextCenter;
@@ -1725,7 +1805,7 @@ namespace HCTools
1725 1805
 
1726 1806
                     xx2 = xx1 + D90 / 3 / 2;
1727 1807
                     yy2 = yy1 + D48 / 3 * 2.5;
1728
-                    filjtb(Leftup_Number,traction, HZ, blocktablerecord, xx2, yy2);
1808
+                    filjtb(Leftup_Number,traction, HZ, blocktablerecord, xx2, yy2, D5);
1729 1809
                 }
1730 1810
                 //接图表首行——中
1731 1811
                 if (string.IsNullOrEmpty(Centrolup_Number) == false)
@@ -1735,7 +1815,7 @@ namespace HCTools
1735 1815
 
1736 1816
                     xx2 = xx1 + D90 / 3 * 1.5;
1737 1817
                     yy2 = yy1 + D48 / 3 * 2.5;
1738
-                    filjtb(Centrolup_Number,traction, HZ, blocktablerecord, xx2, yy2);
1818
+                    filjtb(Centrolup_Number,traction, HZ, blocktablerecord, xx2, yy2, D5);
1739 1819
                 }
1740 1820
                 //接图表首行——右
1741 1821
                 if (string.IsNullOrEmpty(Rightup_Number) == false)
@@ -1745,7 +1825,7 @@ namespace HCTools
1745 1825
 
1746 1826
                     xx2 = xx1 + D90 / 3 * 2.5;
1747 1827
                     yy2 = yy1 + D48 / 3 * 2.5;
1748
-                    filjtb(Rightup_Number,traction, HZ, blocktablerecord, xx2, yy2);
1828
+                    filjtb(Rightup_Number,traction, HZ, blocktablerecord, xx2, yy2, D5);
1749 1829
                 }
1750 1830
                 //接图表尾行——左
1751 1831
                 if (string.IsNullOrEmpty(Leftdown_Number) == false)
@@ -1755,7 +1835,7 @@ namespace HCTools
1755 1835
 
1756 1836
                     xx2 = xx1 + D90 / 3 / 2;
1757 1837
                     yy2 = yy1 + D48 / 3 / 2;
1758
-                    filjtb(Leftdown_Number,traction, HZ, blocktablerecord, xx2, yy2);
1838
+                    filjtb(Leftdown_Number,traction, HZ, blocktablerecord, xx2, yy2, D5);
1759 1839
                 }
1760 1840
                 //接图表尾行——中
1761 1841
                 if (string.IsNullOrEmpty(Centroldown_Number) == false)
@@ -1765,7 +1845,7 @@ namespace HCTools
1765 1845
 
1766 1846
                     xx2 = xx1 + D90 / 3 * 1.5;
1767 1847
                     yy2 = yy1 + D48 / 3 / 2;
1768
-                    filjtb(Centroldown_Number,traction, HZ, blocktablerecord, xx2, yy2);
1848
+                    filjtb(Centroldown_Number,traction, HZ, blocktablerecord, xx2, yy2, D5);
1769 1849
                 }
1770 1850
                 //接图表尾行——右
1771 1851
                 if (string.IsNullOrEmpty(Rightdown_Number) == false)
@@ -1775,7 +1855,7 @@ namespace HCTools
1775 1855
 
1776 1856
                     xx2 = xx1 + D90 / 3 * 2.5;
1777 1857
                     yy2 = yy1 + D48 / 3 / 2;
1778
-                    filjtb(Rightdown_Number,traction, HZ, blocktablerecord, xx2, yy2);
1858
+                    filjtb(Rightdown_Number,traction, HZ, blocktablerecord, xx2, yy2, D5);
1779 1859
                 }
1780 1860
 
1781 1861
 
@@ -2213,19 +2293,22 @@ namespace HCTools
2213 2293
                 blocktablerecord.AppendEntity(text22);
2214 2294
                 traction.AddNewlyCreatedDBObject(text22, true);
2215 2295
 
2296
+
2297
+
2298
+                //document.Database.SaveAs(TKInfo.SV + "\\" + Number.ToString() + ".dwg", true, DwgVersion.AC1021, document.Database.SecurityParameters);
2216 2299
                 //database.SaveAs(TKInfo.SV + "\\" + Number.ToString() + ".dwg", DwgVersion.AC1024);
2217 2300
                 traction.Commit();
2218 2301
 
2219
-            }
2220
-            catch (GrxCAD.Runtime.Exception)
2221
-            {
2222
-
2223
-            }
2224
-            finally
2225
-            {
2302
+            //}
2303
+            //catch (GrxCAD.Runtime.Exception e)
2304
+            //{
2305
+            //    MessageBox.Show (e.Message);
2306
+            //}
2307
+            //finally
2308
+            //{
2226 2309
                 traction.Dispose();
2227 2310
                 documentlock.Dispose();
2228
-            }
2311
+            //}
2229 2312
 
2230 2313
         }
2231 2314
 
@@ -2415,6 +2498,23 @@ namespace HCTools
2415 2498
             Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
2416 2499
             using (Transaction traction = database.TransactionManager.StartTransaction())
2417 2500
             {
2501
+
2502
+                //删除坐标原点多段线
2503
+                Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
2504
+                Point3d pt1 = new Point3d(-1, 1, 0);
2505
+                Point3d pt2 = new Point3d(0, 0, 0);
2506
+                PromptSelectionResult psr = ed.SelectCrossingWindow(pt1, pt2);
2507
+                if (psr.Status == PromptStatus.OK)
2508
+                {
2509
+                    SelectionSet sSet = psr.Value;
2510
+                    ObjectId[] ids = sSet.GetObjectIds();
2511
+                    foreach (ObjectId id in ids)
2512
+                    {
2513
+                        Entity entity1 = traction.GetObject(id, OpenMode.ForWrite) as Entity;
2514
+                        entity1.Erase();
2515
+                    }
2516
+                }
2517
+
2418 2518
                 ViewTableRecord currview = editor.GetCurrentView();
2419 2519
                 currview.CenterPoint = new Point2d((RT.X - LT.X) / 2 + LT.X, (LT.Y - LB.Y) / 2 + LB.Y);
2420 2520
                 currview.ViewDirection = new Vector3d(0, 0, 1);
@@ -2445,9 +2545,16 @@ namespace HCTools
2445 2545
 
2446 2546
                 Editor editor = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
2447 2547
                 TypedValue[] typed = new TypedValue[1];
2448
-                typed.SetValue(new TypedValue((int)DxfCode.Start, "3dFace,LWPolyline"), 0);
2548
+                typed.SetValue(new TypedValue((int)DxfCode.Start, "Polyline,LWPolyline"), 0);
2449 2549
                 SelectionFilter filter = new SelectionFilter(typed);
2450 2550
 
2551
+                ViewTableRecord currview = editor.GetCurrentView();
2552
+                currview.CenterPoint = new Point2d((RT.X - LT.X) / 2 + LT.X, (LT.Y - LB.Y) / 2 + LB.Y);
2553
+                currview.ViewDirection = new Vector3d(0, 0, 1);
2554
+                currview.Width = RT.X - LT.X + TKInfo.BLC / 10;
2555
+                currview.Height = LT.Y - LB.Y + TKInfo.BLC / 10;
2556
+                editor.SetCurrentView(currview);
2557
+
2451 2558
                 PromptSelectionResult psr = editor.SelectWindow(p1, p2, filter);
2452 2559
                 if (psr.Status == PromptStatus.OK)
2453 2560
                 {
@@ -2528,13 +2635,13 @@ namespace HCTools
2528 2635
         }
2529 2636
 
2530 2637
 
2531
-        private void filjtb(string num,Transaction traction,ObjectId HZ,BlockTableRecord blocktablerecord,double xx2,double yy2)
2638
+        private void filjtb(string num,Transaction traction,ObjectId HZ,BlockTableRecord blocktablerecord,double xx2,double yy2,double height)
2532 2639
         {
2533 2640
             DBText text_L = new DBText();
2534 2641
             text_L.TextString = num;
2535 2642
             text_L.Position = new Point3d(xx2, yy2, 0);
2536
-            text_L.Height = 5;
2537
-            text_L.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 3);
2643
+            text_L.Height = height;
2644
+            text_L.Color = GrxCAD.Colors.Color.FromColorIndex(GrxCAD.Colors.ColorMethod.ByColor, 4);
2538 2645
             text_L.Layer = layername;
2539 2646
             text_L.TextStyleId = HZ;
2540 2647
             text_L.HorizontalMode = TextHorizontalMode.TextCenter;

+ 2
- 2
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ChPLContradiction.cs Bestand weergeven

@@ -161,8 +161,8 @@ namespace HCTools
161 161
                 //currview.Height = windowheight;
162 162
                 //editor.SetCurrentView(currview);
163 163
 
164
-                Point3d p1 = new Point3d(p.x - 4, p.y - 4, 0);
165
-                Point3d p2 = new Point3d(p.x + 4, p.y + 4, 0);
164
+                Point3d p1 = new Point3d(p.x - 4 * blc / 2000, p.y - 4 * blc / 2000, 0);
165
+                Point3d p2 = new Point3d(p.x + 4 * blc / 2000, p.y + 4 * blc / 2000, 0);
166 166
                 TypedValue[] typedvalue = new TypedValue[2];
167 167
 
168 168
                 typedvalue.SetValue(new TypedValue((int)DxfCode.Start, "Text"), 0);

+ 9
- 7
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Chaginfos.cs Bestand weergeven

@@ -12,6 +12,7 @@ using GrxCAD.EditorInput;
12 12
 using GrxCAD.DatabaseServices;
13 13
 using GrxCAD.Geometry;
14 14
 using System.IO;
15
+using GrxCAD.ApplicationServices;
15 16
 
16 17
 namespace HCTools
17 18
 {
@@ -87,7 +88,7 @@ namespace HCTools
87 88
                 return;
88 89
             }
89 90
 
90
-            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
91
+            //Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
91 92
             dataGridView_Update.ReadOnly = true;
92 93
             for (int i = 0; i < dataGridView_Update.Rows.Count; i++)
93 94
             {
@@ -275,9 +276,10 @@ namespace HCTools
275 276
                     trans.Commit();
276 277
                 }
277 278
 
278
-
279
-                //2010版本格式
280
-                data.SaveAs(path_Save + "\\" + name, DwgVersion.AC1024);
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);
281 283
                 //2004版本格式
282 284
                 //data.SaveAs(path_Save + "\\" + name, DwgVersion.AC1800);
283 285
                 //2000版本格式
@@ -297,14 +299,14 @@ namespace HCTools
297 299
                 deleterecord = name + "\t" + deleterecord;
298 300
                 deleterecord += "\r\n";
299 301
 
300
-                System.IO.StreamWriter writer = new StreamWriter("F:\\recore.txt", true);
302
+                System.IO.StreamWriter writer = new StreamWriter(path_Save+"\\改动文件.txt", true);
301 303
                 writer.Write(deleterecord);
302 304
                 writer.Dispose();
303 305
             }
304 306
             if (j > 0)
305
-                ed.WriteMessage("修改成功!");
307
+                MessageBox.Show("修改成功!");
306 308
             else
307
-                ed.WriteMessage("未找到原始内容,修改失败!");
309
+                MessageBox.Show("未找到原始内容,修改失败!");
308 310
             this.Close();
309 311
         }
310 312
 

+ 2
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Conn.cs Bestand weergeven

@@ -103,6 +103,8 @@ namespace HCTools
103 103
                 int blcindex = blctext.LastIndexOf(':');
104 104
                 string strblc = blctext.Substring(blcindex + 1);
105 105
                 Inters.blc = Convert.ToInt32(strblc);
106
+                Inters.jqx = comboBox_jqx.Text;
107
+                Inters.sqx = comboBox_sqx.Text;
106 108
 
107 109
                 this.Close();
108 110
                 Inters eachints = new Inters();

+ 2
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ContourLineFix.cs Bestand weergeven

@@ -168,6 +168,8 @@ namespace HCTools
168 168
             return true;
169 169
         }
170 170
     }
171
+
172
+
171 173
 }
172 174
 
173 175
 

+ 0
- 97
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinterpl.Designer.cs Bestand weergeven

@@ -1,97 +0,0 @@
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
-}

+ 0
- 38
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinterpl.cs Bestand weergeven

@@ -1,38 +0,0 @@
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
-}

+ 0
- 120
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinterpl.resx Bestand weergeven

@@ -1,120 +0,0 @@
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>

+ 521
- 233
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Dgxinters.cs Bestand weergeven

@@ -12,21 +12,29 @@ namespace HCTools
12 12
 {
13 13
     class Dgxinters
14 14
     {
15
-        public struct Dgx_ct
15
+        public struct SQX
16 16
         {
17 17
             public Polyline pll;
18
-            public double elevation;
18
+            public List<Point3d> intersepts;
19 19
         }
20 20
 
21
-        public struct Angles
22
-        {
23
-            public double angle;
24
-            public int xh;
25
-        }
26
-
27
-        public static int dgj;
28 21
         public void Interdgx()
29 22
         {
23
+            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
24
+            //输入等高距
25
+            PromptDoubleOptions opts = new PromptDoubleOptions("\n请输入等高距: ");
26
+            opts.AllowNegative = false;  // 不允许负数
27
+            opts.AllowZero = false;     // 不允许0
28
+            opts.DefaultValue = Properties.Settings.Default.dgj;     // 默认值
29
+            PromptDoubleResult res = ed.GetDouble(opts);
30
+            if (res.Status != PromptStatus.OK)
31
+            {
32
+                ed.WriteMessage("\n操作取消。");
33
+                return;
34
+            }
35
+            double dgj = res.Value;
36
+            Properties.Settings.Default.dgj = dgj;
37
+
30 38
             Line jigl1 = Fzx();
31 39
             Line jigl2 = Fzx();
32 40
             List<Point3d> ptonline = new List<Point3d>();//两辅助拉线之间的线段上的点
@@ -35,8 +43,6 @@ namespace HCTools
35 43
             var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
36 44
             ptcoll.Add(jigl1.StartPoint);
37 45
             ptcoll.Add(jigl1.EndPoint);
38
-
39
-            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
40 46
             TypedValue[] value = new TypedValue[]
41 47
                 {
42 48
                 new TypedValue((int)DxfCode.Start,"LWPOLYLINE"),
@@ -44,308 +50,590 @@ namespace HCTools
44 50
             SelectionFilter filter = new SelectionFilter(value);
45 51
             // 要求在图形区域中手动选择对象
46 52
             PromptSelectionResult psr = ed.SelectFence(ptcoll, filter);
47
-
48 53
             if (psr.Status == PromptStatus.OK)
49 54
             {
50 55
                 SelectionSet ss = psr.Value;
51 56
                 ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
52
-                List<Dgx_ct> dgx_ct = new List<Dgx_ct>();
57
+                List<Polyline> dgx = new List<Polyline>();
58
+                List<Polyline> dgx_sqxs = new List<Polyline>();
53 59
                 for (int i = 0; i < idcoll.Count; i++)
54 60
                 {
55
-                    Dgx_ct temp = getpll(idcoll[i]);
56
-                    dgx_ct.Add(temp);
61
+                    Database db = HostApplicationServices.WorkingDatabase;
62
+                    Entity ent = null;
63
+                    DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
64
+                    using (Transaction tr = db.TransactionManager.StartTransaction())
65
+                    {
66
+                        ent = (Polyline)tr.GetObject(idcoll[i], OpenMode.ForWrite, true);
67
+                        doclock.Dispose();
68
+                        Polyline temp = (Polyline)BasicFunction.GetDBObject(idcoll[i]);
69
+                        if (temp.Layer == "8120" || temp.Layer == "jqx" || temp.Layer == "JQX")
70
+                            dgx.Add(temp);
71
+                        else
72
+                        {
73
+                            dgx_sqxs.Add(temp);
74
+                            temp.Erase();
75
+                        }
76
+                        tr.Commit();
77
+                    }
78
+                }
79
+                //按高程排序
80
+                var dgx_ct = dgx.OrderBy(x => x.Elevation).ToList();
81
+                var dgx_sqx = dgx_sqxs.OrderBy(x => x.Elevation).ToList();
82
+                //记录首曲线以及首曲线与拉线交点
83
+                List<SQX> sqxlist = new List<SQX>();
84
+                for (int i = 0; i < dgx_sqx.Count; i++)
85
+                {
86
+                    List<Point3d> itsresult1 = new List<Point3d>();
87
+                    List<Point3d> itsresult2 = new List<Point3d>();
88
+                    itsresult1 = GetIntersections(dgx_sqx[i], jigl1);
89
+                    itsresult2 = GetIntersections(dgx_sqx[i], jigl2);
90
+                    Point3d start = new Point3d();
91
+                    Point3d end = new Point3d();
92
+                    SQX temp = new SQX();
93
+                    temp.intersepts = new List<Point3d>();
94
+                    if (itsresult1.Count != 0)
95
+                    {
96
+                        start = new Point3d(itsresult1[0].X, itsresult1[0].Y, dgx_sqx[i].Elevation);
97
+                        temp.intersepts.Add(start);
98
+                    }
99
+                    if (itsresult2.Count != 0)
100
+                    {
101
+                        end = new Point3d(itsresult2[0].X, itsresult2[0].Y, dgx_sqx[i].Elevation);
102
+                        temp.intersepts.Add(end);
103
+                    }
104
+                    temp.pll = dgx_sqx[i];
105
+                    sqxlist.Add(temp);
57 106
                 }
58
-                dgx_ct.OrderByDescending(x => x.elevation);
59
-
107
+                //获取计曲线与拉线交点
60 108
                 for (int i = 0; i < dgx_ct.Count - 1; i++)
61 109
                 {
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);
110
+                    List<Point3d> itsresult1 = new List<Point3d>();
111
+                    List<Point3d> itsresult2 = new List<Point3d>();
112
+                    itsresult1 = GetIntersections(dgx_ct[i], jigl1);
113
+                    itsresult2 = GetIntersections(dgx_ct[i], jigl2);
114
+                    Point3d start = new Point3d(itsresult1[0].X, itsresult1[0].Y, dgx_ct[i].Elevation);
115
+                    Point3d end = new Point3d(itsresult2[0].X, itsresult2[0].Y, dgx_ct[i].Elevation);
116
+                    //List<Point3d> pts1 = GetPtsBetweenpts(dgx_ct[i], start, end);
117
+                    Polyline pl1 = GetPlBetweenpts(dgx_ct[i], start, end);
118
+
119
+                    List<Point3d> itsresult3 = new List<Point3d>();
120
+                    List<Point3d> itsresult4 = new List<Point3d>();
121
+                    itsresult3 = GetIntersections(dgx_ct[i + 1], jigl1);
122
+                    itsresult4 = GetIntersections(dgx_ct[i + 1], jigl2);
123
+                    Point3d start1 = new Point3d(itsresult3[0].X, itsresult3[0].Y, dgx_ct[i + 1].Elevation);
124
+                    Point3d end1 = new Point3d(itsresult4[0].X, itsresult4[0].Y, dgx_ct[i + 1].Elevation);
77 125
                     List<Point3d> linearinterpt = new List<Point3d>();
126
+                    Polyline pl2 = GetPlBetweenpts(dgx_ct[i + 1], start1, end1);
78 127
 
79
-                    double gcc = dgx_ct[i + 1].pll.Elevation - dgx_ct[i].pll.Elevation;
80
-                    for (int ii = 0; ii < gcc / dgj; ii++)
128
+                    double gcc = dgx_ct[i + 1].Elevation - dgx_ct[i].Elevation;
129
+                    int count = (int)(gcc / dgj - 1);
130
+                    Document doc = Application.DocumentManager.MdiActiveDocument;
131
+                    Database db = doc.Database;
132
+                    using (Transaction tr = db.TransactionManager.StartTransaction())
81 133
                     {
82
-                        double targetgc = dgx_ct[i].pll.Elevation + dgj * (ii + 1);
83
-                        Interpolationpts(pts1, pts2, targetgc);
134
+                        // 执行内插
135
+                        List<Polyline> newContours = InterpolateContours(pl1, pl2, count);
136
+
137
+                        // 将新等高线添加到图形
138
+                        BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
139
+                        LayerTableRecord layer = (LayerTableRecord)tr.GetObject(db.Clayer, OpenMode.ForRead);
140
+                        if (dgx_sqxs.Count == 0)
141
+                        {
142
+                            foreach (Polyline contour in newContours)
143
+                            {
144
+                                btr.AppendEntity(contour);
145
+                                tr.AddNewlyCreatedDBObject(contour, true);
146
+                            }
147
+                        }
148
+                        else
149
+                        {
150
+                            foreach (Polyline contour in newContours)
151
+                            {
152
+                                Selesqx(contour, ed, btr, tr, sqxlist);
153
+                            }
154
+                        }
155
+                        tr.Commit();
156
+                        ed.WriteMessage($"\n成功创建 {newContours.Count} 条内插等高线。");
84 157
                     }
85 158
                 }
86
-                ed.WriteMessage("\n等高线内插完成");
87 159
             }
160
+            else
161
+                ed.WriteMessage("\n未选中等高线!");
88 162
         }
89 163
 
90
-
91
-        private static Line Fzx()
164
+        public static List<Polyline> InterpolateContours(Polyline lowerContour,Polyline upperContour,int numberOfInterpolations)
92 165
         {
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;
166
+            List<Polyline> interpolatedContours = new List<Polyline>();
102 167
 
103
-            if (pPtRes.Status == PromptStatus.OK)
168
+            // 检查曲线方向,必要时反转其中一条
169
+            if (!CheckContourDirections(lowerContour, upperContour))
104 170
             {
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
-                }
171
+                upperContour = ReversePolyline(upperContour);
112 172
             }
113
-            return jigl;
114
-        }
115 173
 
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
-        }
174
+            // 初始化起点
175
+            Point3d A = lowerContour.GetPoint3dAt(0);
176
+            Point3d B = upperContour.GetPoint3dAt(0);
177
+            Line l = new Line(A, B);
124 178
 
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++)
179
+            int i = 0, j = 0;
180
+            int m = lowerContour.NumberOfVertices - 1;
181
+            int n = upperContour.NumberOfVertices - 1;
182
+
183
+            // 存储所有插值点
184
+            List<Point3d>[] allInterpolatedPoints = new List<Point3d>[numberOfInterpolations];
185
+            for (int k = 0; k < numberOfInterpolations; k++)
131 186
             {
132
-                allvertex.Add(pll.GetPoint3dAt(i));
187
+                allInterpolatedPoints[k] = new List<Point3d>();
133 188
             }
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++)
189
+
190
+            while (i < m && j < n)
140 191
             {
141
-                if (start.DistanceTo(allvertex[i]) < dist1)
192
+                //在当前AB辅助线上插值
193
+                for (int L = 1; L <= numberOfInterpolations; L++)
142 194
                 {
143
-                    dist1 = start.DistanceTo(allvertex[i]);
144
-                    start_index = i;
195
+                    double ratio = (double)L / (numberOfInterpolations + 1);
196
+                    Point3d interpolatedPoint = InterpolatePoint(A, B, ratio);
197
+                    if (!allInterpolatedPoints[L - 1].Contains(interpolatedPoint))
198
+                        allInterpolatedPoints[L - 1].Add(interpolatedPoint);
199
+                }
200
+
201
+                //寻找最大角点
202
+                int k1 = FindMaxAnglePoint(lowerContour, i, A, B);
203
+                int k2 = FindMaxAnglePoint(upperContour, j, A, B);
204
+
205
+                //比较角度并选择辅助线
206
+                double angle1 = CalculateAngle(lowerContour.GetPoint3dAt(k1), A, B);
207
+                double angle2 = CalculateAngle(upperContour.GetPoint3dAt(k2), A, B);
208
+
209
+                if (angle1 > angle2)
210
+                {
211
+                    // 选择lowerContour上的点
212
+                    //if (CheckNoIntersection(lowerContour, i, k1, B))
213
+                    for (int x = i + 1; x <= k1; x++)
214
+                    {
215
+                        //for (int x = i + 1; x <= k1; x++)
216
+                        if (CheckNoIntersection(lowerContour, x, k1, B))
217
+                        {
218
+                            Point3d P = lowerContour.GetPoint3dAt(x);
219
+                            for (int L = 1; L <= numberOfInterpolations; L++)
220
+                            {
221
+                                double ratio = (double)L / (numberOfInterpolations + 1);
222
+                                Point3d interpolatedPoint = InterpolatePoint(P, B, ratio);
223
+                                if (!allInterpolatedPoints[L - 1].Contains(interpolatedPoint))
224
+                                    allInterpolatedPoints[L - 1].Add(interpolatedPoint);
225
+                            }
226
+                        }
227
+                        //i = k1;
228
+                        //A = lowerContour.GetPoint3dAt(i);
229
+                    }
230
+                    i = k1;
231
+                    A = lowerContour.GetPoint3dAt(i);
145 232
                 }
146
-                if (end.DistanceTo(allvertex[i]) < dist2)
233
+                else
147 234
                 {
148
-                    dist2 = end.DistanceTo(allvertex[i]);
149
-                    end_index = i;
235
+                    // 选择upperContour上的点
236
+                    //if (CheckNoIntersection(upperContour, j, k2, A))
237
+                    for (int y = j + 2; y <= k2; y++)
238
+                    {
239
+                        //for (int y = j + 1; y <= k2; y++)
240
+                        if (CheckNoIntersection(upperContour, y, k2, A))
241
+                        {
242
+                            Point3d Q = upperContour.GetPoint3dAt(y);
243
+                            for (int L = 1; L <= numberOfInterpolations; L++)
244
+                            {
245
+                                double ratio = (double)L / (numberOfInterpolations + 1);
246
+                                Point3d interpolatedPoint = InterpolatePoint(A, Q, ratio);
247
+                                if (!allInterpolatedPoints[L - 1].Contains(interpolatedPoint))
248
+                                    allInterpolatedPoints[L - 1].Add(interpolatedPoint);
249
+                                Document doc = Application.DocumentManager.MdiActiveDocument;
250
+                                Database db = doc.Database;
251
+                            }
252
+                        }
253
+                        //j = k2;
254
+                        //B = upperContour.GetPoint3dAt(j);
255
+                    }
256
+                    j = k2;
257
+                    B = upperContour.GetPoint3dAt(j);
150 258
                 }
151 259
             }
152
-            if (start_index > end_index)
260
+
261
+            // 处理剩余点
262
+            while (i < m)
153 263
             {
154
-                int temp = start_index;
155
-                start_index = end_index;
156
-                end_index = temp;
157
-                sort = true;
264
+                i++;
265
+                Point3d P = lowerContour.GetPoint3dAt(i);
266
+                for (int L = 1; L <= numberOfInterpolations; L++)
267
+                {
268
+                    double ratio = (double)L / (numberOfInterpolations + 1);
269
+                    Point3d interpolatedPoint = InterpolatePoint(P, B, ratio);
270
+                    if (!allInterpolatedPoints[L - 1].Contains(interpolatedPoint))
271
+                        allInterpolatedPoints[L - 1].Add(interpolatedPoint);
272
+                }
158 273
             }
159
-            for (int i = start_index; i < end_index + 1; i++)
274
+
275
+            while (j < n)
160 276
             {
161
-                if (!vertexbt.Contains(allvertex[i]))
277
+                j++;
278
+                Point3d Q = upperContour.GetPoint3dAt(j);
279
+                for (int L = 1; L <= numberOfInterpolations; L++)
162 280
                 {
163
-                    vertexbt.Add(allvertex[i]);
164
-                    if (i == end_index && !vertexbt.Contains(end))
165
-                        vertexbt.Add(end);
281
+                    double ratio = (double)L / (numberOfInterpolations + 1);
282
+                    Point3d interpolatedPoint = InterpolatePoint(A, Q, ratio);
283
+                    if (!allInterpolatedPoints[L - 1].Contains(interpolatedPoint))
284
+                        allInterpolatedPoints[L - 1].Add(interpolatedPoint);
166 285
                 }
167 286
             }
168
-            if (sort)
169
-                vertexbt.Reverse();
170
-            return vertexbt;
171
-        }
172 287
 
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);
288
+            // 创建插值后的等高线
289
+            for (int L = 0; L < numberOfInterpolations; L++)
290
+            {
291
+                Polyline newContour = new Polyline();
292
+                for (int idx = 0; idx < allInterpolatedPoints[L].Count; idx++)
293
+                {
294
+                    Point3d pt = allInterpolatedPoints[L][idx];
295
+                    newContour.AddVertexAt(idx, new Point2d(pt.X, pt.Y), 0, 0, 0);
296
+                }
178 297
 
179
-            double dotProduct = vectorAB.DotProduct(vectorBC);
298
+                // 设置高程
299
+                double elevation = lowerContour.Elevation +
300
+                                 (upperContour.Elevation - lowerContour.Elevation) *
301
+                                 (double)(L + 1) / (numberOfInterpolations + 1);
302
+                newContour.Elevation = elevation;
303
+                Polyline smoothpl = Smooth(newContour);
304
+                interpolatedContours.Add(smoothpl);
305
+            }
180 306
 
181
-            // 计算两个向量的长度  
182
-            double lengthAB = vectorAB.Length;
183
-            double lengthBC = vectorBC.Length;
307
+            return interpolatedContours;
308
+        }
184 309
 
185
-            double angleDegrees = new double();
186
-            // 防止除以零的错误  
187
-            if (lengthAB > 0 && lengthBC > 0)
188
-            {
189
-                // 计算两个向量之间夹角的余弦值  
190
-                double cosAngle = dotProduct / (lengthAB * lengthBC);
310
+        // 检查两条等高线方向是否一致
311
+        private static bool CheckContourDirections(Polyline pline1, Polyline pline2)
312
+        {
313
+            bool result;
314
+            Point3d pl1st = pline1.StartPoint;
315
+            Point3d pl2st = pline2.StartPoint;
316
+            Point3d pl2ed = pline2.EndPoint;
317
+            Line l1 = new Line(pl1st, pl2st);
318
+            Line l2 = new Line(pl1st, pl2ed);
319
+            if (l1.Length < l2.Length)
320
+                result = true;
321
+            else
322
+                result = false;
323
+            return result;
191 324
 
192
-                // 使用反余弦函数计算夹角(以弧度为单位)  
193
-                double angleRadians = Math.Acos(cosAngle);
325
+        }
194 326
 
195
-                // 将弧度转换为度  
196
-                angleDegrees = angleRadians * (180.0 / Math.PI);
327
+        // 反转多段线顶点顺序
328
+        private static Polyline ReversePolyline(Polyline pline)
329
+        {
330
+            Polyline reversed = new Polyline();
331
+            for (int i = pline.NumberOfVertices - 1; i >= 0; i--)
332
+            {
333
+                Point3d pt = pline.GetPoint3dAt(i);
334
+                reversed.AddVertexAt(reversed.NumberOfVertices,
335
+                                   new Point2d(pt.X, pt.Y), 0, 0, 0);
197 336
             }
198
-            return angleDegrees;
337
+            reversed.Elevation = pline.Elevation;
338
+            return reversed;
199 339
         }
200 340
 
201
-        private static bool LineIntersect(double x1, double y1, double x2, double y2,
202
-                                          double x3, double y3, double x4, double y4)
341
+        // 在两点之间插值
342
+        private static Point3d InterpolatePoint(Point3d pt1, Point3d pt2, double ratio)
203 343
         {
204
-            double d1x = x2 - x1;
205
-            double d1y = y2 - y1;
206
-            double d2x = x4 - x3;
207
-            double d2y = y4 - y3;
344
+            return new Point3d(
345
+                pt1.X + ratio * (pt2.X - pt1.X),
346
+                pt1.Y + ratio * (pt2.Y - pt1.Y),
347
+                pt1.Z + ratio * (pt2.Z - pt1.Z));
348
+        }
208 349
 
209
-            // 计算点1和点2相对于线段CD的叉积  
210
-            double cp1 = d2x * (y1 - y3) - (x1 - x3) * d2y;
211
-            double cp2 = d2x * (y2 - y3) - (x2 - x3) * d2y;
350
+        // 寻找最大角点
351
+        private static int FindMaxAnglePoint(Polyline pline, int startIdx, Point3d A, Point3d B)
352
+        {
353
+            int maxIndex = startIdx;
354
+            double maxAngle = 0;
212 355
 
213
-            // 如果点1和点2相对于线段CD的叉积符号相反,则它们跨立在CD的两侧  
214
-            if (cp1 * cp2 < 0)
356
+            for (int i = startIdx + 1; i < pline.NumberOfVertices; i++)
215 357
             {
216
-                // 计算点3和点4相对于线段AB的叉积  
217
-                double cp3 = d1x * (y3 - y1) - (x3 - x1) * d1y;
218
-                double cp4 = d1x * (y4 - y1) - (x4 - x1) * d1y;
358
+                Point3d P = pline.GetPoint3dAt(i);
359
+                double angle = CalculateAngle(P, A, B);
219 360
 
220
-                // 如果点3和点4相对于线段AB的叉积符号也相反,则它们跨立在AB的两侧  
221
-                if (cp3 * cp4 < 0)
361
+                if (angle > maxAngle)
222 362
                 {
223
-                    // 根据跨立实验,如果以上条件都满足,则线段一定相交  
224
-                    return true;
363
+                    maxAngle = angle;
364
+                    maxIndex = i;
225 365
                 }
226 366
             }
227
-            // 线段不相交  
228
-            return false;
367
+
368
+            return maxIndex;
229 369
         }
230 370
 
231
-        private static Point3d Interpolation(Point3d p1, Point3d p2, double targetZ)
371
+        // 计算角度(使用余弦定理)
372
+        private static double CalculateAngle(Point3d P, Point3d A, Point3d B)
232 373
         {
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);
374
+            Vector3d PA = A - P;
375
+            Vector3d PB = B - P;
376
+
377
+            double dotProduct = PA.DotProduct(PB);
378
+            double magnitudePA = PA.Length;
379
+            double magnitudePB = PB.Length;
380
+
381
+            // 避免除以零
382
+            if (magnitudePA < 1e-9 || magnitudePB < 1e-9)
383
+                return 0;
384
+
385
+            double cosTheta = dotProduct / (magnitudePA * magnitudePB);
386
+            cosTheta = Math.Max(-1, Math.Min(1, cosTheta)); // 确保在[-1,1]范围内
387
+
388
+            return Math.Acos(cosTheta);
237 389
         }
238 390
 
239
-        public static void Interpolationpts(List<Point3d> pts1, List<Point3d> pts2, double targetgc)
391
+        // 检查辅助线是否与曲线相交
392
+        private static bool CheckNoIntersection(Polyline pline, int startIdx, int endIdx, Point3d point)
240 393
         {
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;
394
+            //LineSegment3d testSegment = new LineSegment3d(
395
+            //    pline.GetPoint3dAt(startIdx), point);
254 396
 
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)
397
+            //for (int i = 0; i < pline.NumberOfVertices - 1; i++)
398
+            //{
399
+            //    if (i == startIdx) continue;
400
+
401
+            //    LineSegment3d plineSegment = new LineSegment3d(
402
+            //        pline.GetPoint3dAt(i), pline.GetPoint3dAt(i + 1));
403
+
404
+            //    Point3d intersection = new Point3d();
405
+            //    if (testSegment.IntersectWith(plineSegment, out intersection))
406
+            //    {
407
+            //        return false;
408
+            //    }
409
+            //}
410
+            Line line = new Line(point, pline.GetPoint3dAt(startIdx));
411
+            List<Point3d> pts = GetIntersections(pline, line);
412
+            if (pts.Count > 1)
413
+                return false;
414
+
415
+            return true;
416
+        }
417
+
418
+        private static void Selesqx(Polyline pll, Editor ed, BlockTableRecord btr, Transaction tr, List<SQX> sqxlist)
419
+        {
420
+            for (int i = 0; i < sqxlist.Count; i++)
421
+            {
422
+                if(sqxlist[i].pll.Elevation==pll.Elevation)
284 423
                 {
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)
424
+                    for (int j = 0; j < sqxlist[i].intersepts.Count; j++)
298 425
                     {
299
-                        if (interck3 & interck4)
426
+                        Polyline pl_Clone = (Polyline)sqxlist[i].pll.Clone();
427
+                        Point3dCollection splitpts = new Point3dCollection(sqxlist[i].intersepts.OrderBy(x=>sqxlist[i].pll.GetParameterAtPoint(x)).ToArray());
428
+                        var splitpl = pl_Clone.GetSplitCurves(splitpts);
429
+                        if (splitpl.Count == 2)
300 430
                         {
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
-                            }
431
+                            Polyline pllsplit1 = (Polyline)splitpl[0];
432
+                            Polyline pllsplit2 = (Polyline)splitpl[1];
433
+                            Polyline plladd;
434
+                            if (pllsplit1.Length < pllsplit2.Length)
435
+                                plladd = pllsplit2;
312 436
                             else
437
+                                plladd = pllsplit1;
438
+                            Polyline pll_new = new Polyline();
439
+                            if (plladd.EndPoint != sqxlist[i].intersepts[0])
440
+                                plladd.ReverseCurve();
441
+                            Line line3 = new Line(plladd.EndPoint, pll.StartPoint);
442
+                            Line line4 = new Line(plladd.EndPoint, pll.EndPoint);
443
+                            if (line3.Length > line4.Length)
444
+                                pll.ReverseCurve();
445
+                            int ptnum = pll.NumberOfVertices + plladd.NumberOfVertices - 1;
446
+                            for (int l = 0; l < ptnum - 1; l++)
313 447
                             {
314
-                                
448
+                                if (l < plladd.NumberOfVertices - 1)
449
+                                    pll_new.AddVertexAt(l, plladd.GetPoint2dAt(l), 0, sqxlist[i].pll.ConstantWidth, sqxlist[i].pll.ConstantWidth);
450
+                                else
451
+                                    pll_new.AddVertexAt(l, pll.GetPoint2dAt(l - plladd.NumberOfVertices + 2), 0, sqxlist[i].pll.ConstantWidth, sqxlist[i].pll.ConstantWidth);
315 452
                             }
453
+                            pll_new.Elevation = pl_Clone.Elevation;
454
+                            Polyline smoothpl = Smooth(pll_new);
455
+                            btr.AppendEntity(smoothpl);
456
+                            tr.AddNewlyCreatedDBObject(smoothpl, true);
457
+
316 458
                         }
317
-                        else
459
+                        else if (splitpl.Count > 2)
318 460
                         {
319
-                            angle2.RemoveAt(0);
320
-                            continue;
461
+                            Polyline pll_split1 = (Polyline)splitpl[0];
462
+                            Polyline pll_split2 = (Polyline)splitpl[1];
463
+                            Polyline pll_split3 = (Polyline)splitpl[2];
464
+                            Polyline pll_new = new Polyline();
465
+                            Line line1 = new Line(pll_split2.StartPoint,pll.StartPoint);
466
+                            Line line2 = new Line(pll_split2.StartPoint,pll.EndPoint);
467
+                            if (line1.Length > line2.Length)
468
+                                pll.ReverseCurve();
469
+                            int ptnum = pll.NumberOfVertices + pll_split1.NumberOfVertices + +pll_split3.NumberOfVertices - 4;
470
+                            for (int l = 0; l < ptnum; l++)
471
+                            {
472
+                                if (l < pll_split1.NumberOfVertices - 1)
473
+                                    pll_new.AddVertexAt(l, pll_split1.GetPoint2dAt(l), 0, sqxlist[i].pll.ConstantWidth, sqxlist[i].pll.ConstantWidth);
474
+                                else if(l<pll.NumberOfVertices + pll_split1.NumberOfVertices - 3&&l>= pll_split1.NumberOfVertices-1)
475
+                                    pll_new.AddVertexAt(l, pll.GetPoint2dAt(l - pll_split1.NumberOfVertices + 2), 0, sqxlist[i].pll.ConstantWidth, sqxlist[i].pll.ConstantWidth);
476
+                                else
477
+                                    pll_new.AddVertexAt(l, pll_split3.GetPoint2dAt(l - pll.NumberOfVertices - pll_split1.NumberOfVertices + 4), 0, sqxlist[i].pll.ConstantWidth, sqxlist[i].pll.ConstantWidth);
478
+                            }
479
+                            pll_new.Elevation = pl_Clone.Elevation;
480
+                            Polyline smoothpl = Smooth(pll_new);
481
+                            btr.AppendEntity(smoothpl);
482
+                            tr.AddNewlyCreatedDBObject(smoothpl, true);
321 483
                         }
322 484
                     }
323
-                    else
324
-                    {
325
-                        angle1.RemoveAt(0);
326
-                        continue;
327
-                    }
328 485
                 }
329 486
             }
487
+        }
488
+        
489
+        private static Polyline Smooth(Polyline pl)
490
+        {
491
+            Point3dCollection ptcoll = new Point3dCollection();
492
+            for (int i = 0; i < pl.NumberOfVertices; i++)
493
+            {
494
+                ptcoll.Add(pl.GetPoint3dAt(i));
495
+            }
496
+            Spline spline = new Spline(ptcoll, 3, 0.01);
497
+            spline.SetDatabaseDefaults();
498
+            Polyline pl_smooth = new Polyline();
499
+            pl_smooth.SetDatabaseDefaults();
500
+            int ptnum = pl.NumberOfVertices - 1;
501
+            for (int i = 0; i <= ptnum; i++)
502
+            {
503
+                double param = spline.StartParam +(spline.EndParam - spline.StartParam) * i / ptnum;
504
+                Point3d pt = spline.GetPointAtParameter(param);
505
+                pl_smooth.AddVertexAt(pl_smooth.NumberOfVertices, new Point2d(pt.X, pt.Y), 0, 0, 0);
506
+            }
507
+            pl_smooth.Elevation = pl.Elevation;
508
+            return pl_smooth;
509
+        }
330 510
 
331
-            Database db = HostApplicationServices.WorkingDatabase;
511
+        //辅助线
512
+        private static Line Fzx()
513
+        {
332 514
             Document doc = Application.DocumentManager.MdiActiveDocument;
333
-            DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
334
-            using (Transaction trans = db.TransactionManager.StartTransaction())
515
+            Line jigl = new Line();
516
+
517
+            ObjectId jigid = new ObjectId();
518
+            PromptPointResult pPtRes;
519
+            PromptPointOptions pPtOpts = new PromptPointOptions("");
520
+            pPtOpts.Message = "选择起点\n ";
521
+            pPtRes = doc.Editor.GetPoint(pPtOpts);
522
+            Point3d ptStart = pPtRes.Value;
523
+
524
+            if (pPtRes.Status == PromptStatus.OK)
525
+            {
526
+                LineJig lJig = new LineJig(ptStart);
527
+                PromptResult PR = doc.Editor.Drag(lJig);
528
+                if (PR.Status == PromptStatus.OK)
529
+                {
530
+                    //jigid = BasicFunction.AddObj(doc, lJig.line_1);
531
+                    jigl = lJig.line_1;
532
+                }
533
+            }
534
+            return jigl;
535
+        }
536
+
537
+        private static Polyline GetPlBetweenpts(Polyline pll, Point3d start, Point3d end)
538
+        {
539
+            Polyline result = new Polyline();
540
+            Polyline copy_pll = (Polyline)pll.Clone();
541
+            Point3d start1 = pll.GetClosestPointTo(start,false);
542
+            double test = pll.GetParameterAtPoint(start);
543
+            Point3d end1 = pll.GetClosestPointTo(end, false);
544
+            double test2 = pll.GetParameterAtPoint(end);
545
+            if (test > test2)
546
+            {
547
+                Point3d temp = end1;
548
+                end1 = start1;
549
+                start1 = temp;
550
+            }
551
+            Point3dCollection pts = new Point3dCollection(new Point3d[] { start1, end1 });
552
+            var split = copy_pll.GetSplitCurves(pts);
553
+            //foreach (var item in split)
554
+            //{
555
+            result = (Polyline)split[1];
556
+            //if (pts.Contains(pll_temp.StartPoint) && pts.Contains(pll_temp.EndPoint))
557
+            //{
558
+            //    result = pll_temp;
559
+            //}
560
+            //}
561
+            return result;
562
+        }
563
+
564
+        /// <summary>
565
+        /// 为保证精度,将待获取相交情况的线移到原点处再进行相交检查
566
+        /// </summary>
567
+        private static List<Point3d> GetIntersections(Polyline pll, Line line)
568
+        {
569
+            List<Point3d> result = new List<Point3d>();
570
+
571
+            // 创建临时副本
572
+            Polyline tempLine1 = (Polyline)pll.Clone();
573
+            Line tempLine2 = (Line)line.Clone();
574
+
575
+            // 计算平移向量(以线1起点为基准,移动至原点)
576
+            Vector3d translation = -tempLine1.StartPoint.GetAsVector();
577
+            Matrix3d translateMatrix = Matrix3d.Displacement(translation);
578
+
579
+            // 应用平移变换
580
+            tempLine1.TransformBy(translateMatrix);
581
+            tempLine2.TransformBy(translateMatrix);
582
+
583
+            Point3dCollection translatedPoints = new Point3dCollection();
584
+            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
585
+            tempLine2.IntersectWith(tempLine1, Intersect.OnBothOperands, plane, translatedPoints, IntPtr.Zero, IntPtr.Zero);
586
+
587
+            // 计算逆平移矩阵
588
+            Matrix3d inverseMatrix = Matrix3d.Displacement(-translation);
589
+            if (translatedPoints.Count > 0)
335 590
             {
336
-                BlockTable blocktable = trans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
337
-                BlockTableRecord blctablerecord = trans.GetObject(blocktable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
591
+                // 获取平移后的交点
592
+                foreach (Point3d item in translatedPoints)
593
+                {
594
+                    // 恢复交点坐标
595
+                    var pt = item.TransformBy(inverseMatrix);
596
+                    result.Add(pt);
597
+                }
598
+            }
599
+            return result;
600
+        }
601
+
602
+        private static List<Point3d> GetIntersections(Polyline pll1, Polyline pll2)
603
+        {
604
+            List<Point3d> result = new List<Point3d>();
605
+
606
+            // 创建临时副本
607
+            Polyline tempLine1 = (Polyline)pll1.Clone();
608
+            Polyline tempLine2 = (Polyline)pll2.Clone();
609
+
610
+            // 计算平移向量(以线1起点为基准,移动至原点)
611
+            Vector3d translation = -tempLine1.StartPoint.GetAsVector();
612
+            Matrix3d translateMatrix = Matrix3d.Displacement(translation);
338 613
 
339
-                Polyline pll = new Polyline();
340
-                for (int i = 0; i < itspt.Count; i++)
614
+            // 应用平移变换
615
+            tempLine1.TransformBy(translateMatrix);
616
+            tempLine2.TransformBy(translateMatrix);
617
+
618
+            Point3dCollection translatedPoints = new Point3dCollection();
619
+            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
620
+            tempLine1.IntersectWith(tempLine2, Intersect.OnBothOperands, plane, translatedPoints, IntPtr.Zero, IntPtr.Zero);
621
+
622
+            // 计算逆平移矩阵
623
+            Matrix3d inverseMatrix = Matrix3d.Displacement(-translation);
624
+            if (translatedPoints.Count > 0)
625
+            {
626
+                // 获取平移后的交点
627
+                foreach (Point3d item in translatedPoints)
341 628
                 {
342
-                    pll.AddVertexAt(i, new Point2d(itspt[i].X, itspt[i].Y), 0, 0, 0);
629
+                    // 恢复交点坐标
630
+                    var pt = item.TransformBy(inverseMatrix);
631
+                    result.Add(pt);
343 632
                 }
344
-                blctablerecord.AppendEntity(pll);
345
-                trans.AddNewlyCreatedDBObject(pll, true);
346
-                trans.Commit();
347 633
             }
348
-            doclock.Dispose();
634
+            return result;
349 635
         }
636
+
637
+        
350 638
     }
351 639
 }

+ 224
- 1
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/HCTools.csproj Bestand weergeven

@@ -1,5 +1,6 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" />
3 4
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4 5
   <PropertyGroup>
5 6
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,6 +13,8 @@
12 13
     <FileAlignment>512</FileAlignment>
13 14
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14 15
     <Deterministic>true</Deterministic>
16
+    <NuGetPackageImportStamp>
17
+    </NuGetPackageImportStamp>
15 18
   </PropertyGroup>
16 19
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17 20
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -36,6 +39,9 @@
36 39
     <StartupObject />
37 40
   </PropertyGroup>
38 41
   <ItemGroup>
42
+    <Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
43
+      <HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
44
+    </Reference>
39 45
     <Reference Include="gmap">
40 46
       <HintPath>..\..\..\..\..\..\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc\gmap.dll</HintPath>
41 47
       <Private>False</Private>
@@ -53,18 +59,163 @@
53 59
       <EmbedInteropTypes>True</EmbedInteropTypes>
54 60
       <HintPath>..\..\..\CADTools\CADtools\bin\Debug\Microsoft.Office.Interop.Excel.dll</HintPath>
55 61
     </Reference>
62
+    <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
63
+      <HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
64
+      <Private>True</Private>
65
+      <Private>True</Private>
66
+    </Reference>
67
+    <Reference Include="NetTopologySuite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=f580a05016ebada1, processorArchitecture=MSIL">
68
+      <HintPath>..\packages\NetTopologySuite.2.6.0\lib\netstandard2.0\NetTopologySuite.dll</HintPath>
69
+    </Reference>
56 70
     <Reference Include="System" />
71
+    <Reference Include="System.AppContext, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
72
+      <HintPath>..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll</HintPath>
73
+      <Private>True</Private>
74
+      <Private>True</Private>
75
+    </Reference>
76
+    <Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
77
+      <HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
78
+    </Reference>
79
+    <Reference Include="System.ComponentModel.Composition" />
80
+    <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
81
+      <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
82
+      <Private>True</Private>
83
+      <Private>True</Private>
84
+    </Reference>
57 85
     <Reference Include="System.Core" />
86
+    <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
87
+      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
88
+    </Reference>
89
+    <Reference Include="System.Diagnostics.Tracing, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
90
+      <HintPath>..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll</HintPath>
91
+      <Private>True</Private>
92
+      <Private>True</Private>
93
+    </Reference>
94
+    <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
95
+      <HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
96
+      <Private>True</Private>
97
+      <Private>True</Private>
98
+    </Reference>
99
+    <Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
100
+      <HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
101
+      <Private>True</Private>
102
+      <Private>True</Private>
103
+    </Reference>
104
+    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
105
+      <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
106
+      <Private>True</Private>
107
+      <Private>True</Private>
108
+    </Reference>
109
+    <Reference Include="System.IO.Compression.FileSystem" />
110
+    <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
111
+      <HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
112
+      <Private>True</Private>
113
+      <Private>True</Private>
114
+    </Reference>
115
+    <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
116
+      <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
117
+      <Private>True</Private>
118
+      <Private>True</Private>
119
+    </Reference>
120
+    <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
121
+      <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
122
+      <Private>True</Private>
123
+      <Private>True</Private>
124
+    </Reference>
125
+    <Reference Include="System.Linq, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
126
+      <HintPath>..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll</HintPath>
127
+      <Private>True</Private>
128
+      <Private>True</Private>
129
+    </Reference>
130
+    <Reference Include="System.Linq.Expressions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
131
+      <HintPath>..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll</HintPath>
132
+      <Private>True</Private>
133
+      <Private>True</Private>
134
+    </Reference>
58 135
     <Reference Include="System.Management" />
136
+    <Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
137
+      <HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
138
+    </Reference>
139
+    <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
140
+      <HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
141
+      <Private>True</Private>
142
+      <Private>True</Private>
143
+    </Reference>
144
+    <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
145
+      <HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
146
+      <Private>True</Private>
147
+      <Private>True</Private>
148
+    </Reference>
149
+    <Reference Include="System.Numerics" />
150
+    <Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
151
+      <HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
152
+    </Reference>
153
+    <Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
154
+      <HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
155
+      <Private>True</Private>
156
+      <Private>True</Private>
157
+    </Reference>
158
+    <Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
159
+      <HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
160
+      <Private>True</Private>
161
+      <Private>True</Private>
162
+    </Reference>
163
+    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
164
+      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
165
+    </Reference>
166
+    <Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
167
+      <HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
168
+      <Private>True</Private>
169
+      <Private>True</Private>
170
+    </Reference>
171
+    <Reference Include="System.Runtime.InteropServices, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
172
+      <HintPath>..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll</HintPath>
173
+      <Private>True</Private>
174
+      <Private>True</Private>
175
+    </Reference>
176
+    <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
177
+      <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
178
+      <Private>True</Private>
179
+      <Private>True</Private>
180
+    </Reference>
181
+    <Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
182
+      <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
183
+      <Private>True</Private>
184
+      <Private>True</Private>
185
+    </Reference>
186
+    <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
187
+      <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
188
+      <Private>True</Private>
189
+      <Private>True</Private>
190
+    </Reference>
191
+    <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
192
+      <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
193
+      <Private>True</Private>
194
+      <Private>True</Private>
195
+    </Reference>
196
+    <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
197
+      <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
198
+      <Private>True</Private>
199
+      <Private>True</Private>
200
+    </Reference>
201
+    <Reference Include="System.Text.RegularExpressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
202
+      <HintPath>..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll</HintPath>
203
+      <Private>True</Private>
204
+      <Private>True</Private>
205
+    </Reference>
59 206
     <Reference Include="System.Xml.Linq" />
60 207
     <Reference Include="System.Data.DataSetExtensions" />
61 208
     <Reference Include="Microsoft.CSharp" />
62 209
     <Reference Include="System.Data" />
63 210
     <Reference Include="System.Deployment" />
64 211
     <Reference Include="System.Drawing" />
65
-    <Reference Include="System.Net.Http" />
66 212
     <Reference Include="System.Windows.Forms" />
67 213
     <Reference Include="System.Xml" />
214
+    <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
215
+      <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
216
+      <Private>True</Private>
217
+      <Private>True</Private>
218
+    </Reference>
68 219
   </ItemGroup>
69 220
   <ItemGroup>
70 221
     <Compile Include="AttributeForm.cs">
@@ -126,6 +277,14 @@
126 277
       <DependentUpon>DGXGeneral.cs</DependentUpon>
127 278
     </Compile>
128 279
     <Compile Include="DGXGeneralization.cs" />
280
+    <Compile Include="Dgxinters.cs" />
281
+    <Compile Include="Dgxthrorvrd.cs" />
282
+    <Compile Include="Dgxthrorvrd_Form.cs">
283
+      <SubType>Form</SubType>
284
+    </Compile>
285
+    <Compile Include="Dgxthrorvrd_Form.Designer.cs">
286
+      <DependentUpon>Dgxthrorvrd_Form.cs</DependentUpon>
287
+    </Compile>
129 288
     <Compile Include="ElePtCheck.cs" />
130 289
     <Compile Include="EleptDenck.cs" />
131 290
     <Compile Include="EleptDensity.cs">
@@ -142,6 +301,12 @@
142 301
     </Compile>
143 302
     <Compile Include="EleRound.cs" />
144 303
     <Compile Include="FeatureOverlap.cs" />
304
+    <Compile Include="GCDdelete_Form.cs">
305
+      <SubType>Form</SubType>
306
+    </Compile>
307
+    <Compile Include="GCDdelete_Form.Designer.cs">
308
+      <DependentUpon>GCDdelete_Form.cs</DependentUpon>
309
+    </Compile>
145 310
     <Compile Include="Hierak.cs">
146 311
       <SubType>Form</SubType>
147 312
     </Compile>
@@ -150,6 +315,12 @@
150 315
     </Compile>
151 316
     <Compile Include="Hierarchy.cs" />
152 317
     <Compile Include="InsertDOM.cs" />
318
+    <Compile Include="InsertDOMs_to_one.cs">
319
+      <SubType>Form</SubType>
320
+    </Compile>
321
+    <Compile Include="InsertDOMs_to_one.Designer.cs">
322
+      <DependentUpon>InsertDOMs_to_one.cs</DependentUpon>
323
+    </Compile>
153 324
     <Compile Include="InstDOM.cs">
154 325
       <SubType>Form</SubType>
155 326
     </Compile>
@@ -157,6 +328,12 @@
157 328
       <DependentUpon>InstDOM.cs</DependentUpon>
158 329
     </Compile>
159 330
     <Compile Include="Inters.cs" />
331
+    <Compile Include="JQXlabel.cs">
332
+      <SubType>Form</SubType>
333
+    </Compile>
334
+    <Compile Include="JQXlabel.Designer.cs">
335
+      <DependentUpon>JQXlabel.cs</DependentUpon>
336
+    </Compile>
160 337
     <Compile Include="LayerChange.cs" />
161 338
     <Compile Include="Layerchange_Form.cs">
162 339
       <SubType>Form</SubType>
@@ -166,6 +343,18 @@
166 343
     </Compile>
167 344
     <Compile Include="MainClass.cs" />
168 345
     <Compile Include="Menus.cs" />
346
+    <Compile Include="ModifyTFH.cs">
347
+      <SubType>Form</SubType>
348
+    </Compile>
349
+    <Compile Include="ModifyTFH.Designer.cs">
350
+      <DependentUpon>ModifyTFH.cs</DependentUpon>
351
+    </Compile>
352
+    <Compile Include="OutputbyTK_Form.cs">
353
+      <SubType>Form</SubType>
354
+    </Compile>
355
+    <Compile Include="OutputbyTK_Form.Designer.cs">
356
+      <DependentUpon>OutputbyTK_Form.cs</DependentUpon>
357
+    </Compile>
169 358
     <Compile Include="PickupPoint.cs" />
170 359
     <Compile Include="PicPts.cs">
171 360
       <SubType>Form</SubType>
@@ -200,6 +389,7 @@
200 389
     </Compile>
201 390
     <EmbeddedResource Include="AttributeForm.resx">
202 391
       <DependentUpon>AttributeForm.cs</DependentUpon>
392
+      <SubType>Designer</SubType>
203 393
     </EmbeddedResource>
204 394
     <EmbeddedResource Include="Chaginfos.resx">
205 395
       <DependentUpon>Chaginfos.cs</DependentUpon>
@@ -222,21 +412,39 @@
222 412
     <EmbeddedResource Include="DGXGeneral.resx">
223 413
       <DependentUpon>DGXGeneral.cs</DependentUpon>
224 414
     </EmbeddedResource>
415
+    <EmbeddedResource Include="Dgxthrorvrd_Form.resx">
416
+      <DependentUpon>Dgxthrorvrd_Form.cs</DependentUpon>
417
+    </EmbeddedResource>
225 418
     <EmbeddedResource Include="EleptDensity.resx">
226 419
       <DependentUpon>EleptDensity.cs</DependentUpon>
227 420
     </EmbeddedResource>
228 421
     <EmbeddedResource Include="EleRd.resx">
229 422
       <DependentUpon>EleRd.cs</DependentUpon>
230 423
     </EmbeddedResource>
424
+    <EmbeddedResource Include="GCDdelete_Form.resx">
425
+      <DependentUpon>GCDdelete_Form.cs</DependentUpon>
426
+    </EmbeddedResource>
231 427
     <EmbeddedResource Include="Hierak.resx">
232 428
       <DependentUpon>Hierak.cs</DependentUpon>
233 429
     </EmbeddedResource>
430
+    <EmbeddedResource Include="InsertDOMs_to_one.resx">
431
+      <DependentUpon>InsertDOMs_to_one.cs</DependentUpon>
432
+    </EmbeddedResource>
234 433
     <EmbeddedResource Include="InstDOM.resx">
235 434
       <DependentUpon>InstDOM.cs</DependentUpon>
236 435
     </EmbeddedResource>
436
+    <EmbeddedResource Include="JQXlabel.resx">
437
+      <DependentUpon>JQXlabel.cs</DependentUpon>
438
+    </EmbeddedResource>
237 439
     <EmbeddedResource Include="Layerchange_Form.resx">
238 440
       <DependentUpon>Layerchange_Form.cs</DependentUpon>
239 441
     </EmbeddedResource>
442
+    <EmbeddedResource Include="ModifyTFH.resx">
443
+      <DependentUpon>ModifyTFH.cs</DependentUpon>
444
+    </EmbeddedResource>
445
+    <EmbeddedResource Include="OutputbyTK_Form.resx">
446
+      <DependentUpon>OutputbyTK_Form.cs</DependentUpon>
447
+    </EmbeddedResource>
240 448
     <EmbeddedResource Include="PicPts.resx">
241 449
       <DependentUpon>PicPts.cs</DependentUpon>
242 450
     </EmbeddedResource>
@@ -261,6 +469,8 @@
261 469
     <EmbeddedResource Include="TKInfo.resx">
262 470
       <DependentUpon>TKInfo.cs</DependentUpon>
263 471
     </EmbeddedResource>
472
+    <None Include="App.config" />
473
+    <None Include="packages.config" />
264 474
     <None Include="Properties\Settings.settings">
265 475
       <Generator>SettingsSingleFileGenerator</Generator>
266 476
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -271,5 +481,18 @@
271 481
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
272 482
     </Compile>
273 483
   </ItemGroup>
484
+  <ItemGroup>
485
+    <Content Include="FodyWeavers.xml" />
486
+  </ItemGroup>
274 487
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
488
+  <Import Project="..\packages\Fody.6.8.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.8.0\build\Fody.targets')" />
489
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
490
+    <PropertyGroup>
491
+      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
492
+    </PropertyGroup>
493
+    <Error Condition="!Exists('..\packages\Fody.6.8.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.8.0\build\Fody.targets'))" />
494
+    <Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props'))" />
495
+    <Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
496
+  </Target>
497
+  <Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
275 498
 </Project>

+ 2
- 2
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/HCTools.csproj.user Bestand weergeven

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

+ 2
- 1
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/InsertDOM.cs Bestand weergeven

@@ -221,7 +221,8 @@ namespace HCTools
221 221
                     }
222 222
                 }
223 223
             }
224
-            doc.CloseAndSave(db.Filename);
224
+            doc.Database.Save();
225
+            doc.CloseAndDiscard();
225 226
         }
226 227
     }
227 228
 }

+ 128
- 26
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/LayerChange.cs Bestand weergeven

@@ -23,8 +23,8 @@ namespace HCTools
23 23
 
24 24
         public void chagly()
25 25
         {
26
-            try
27
-            {
26
+            //try
27
+            //{
28 28
                 List<String> dwgname = GetNameList(dwgpath, ".dwg");//获取dwg文件
29 29
                 if (dwgname.Count == 0)
30 30
                 {
@@ -35,7 +35,7 @@ namespace HCTools
35 35
                 {
36 36
                     string dwg = dwgpath + "\\" + dwgfile;
37 37
                     Document doc = GrxCAD.ApplicationServices.Application.DocumentManager.Add(dwg);
38
-                    if (flag == 0)
38
+                    if (flag == 0|| flag == 3 || flag == 4)
39 39
                     {
40 40
                         Delete(lys, doc, dwgfile);
41 41
                     }
@@ -48,35 +48,127 @@ namespace HCTools
48 48
                         Openly(lys, doc, dwgfile);
49 49
                     }
50 50
                     doc.CloseAndDiscard();
51
-                }
52
-            }
53
-            catch (GrxCAD.Runtime.Exception ex)
54
-            {
55
-                GrxCAD.ApplicationServices.Application.ShowAlertDialog("Error:\n" + ex.Message);
56 51
             }
57
-        }
52
+        //}
53
+            //catch (GrxCAD.Runtime.Exception ex)
54
+            //{
55
+            //    GrxCAD.ApplicationServices.Application.ShowAlertDialog("Error:\n" + ex.Message);
56
+            //}
57
+}
58 58
 
59
-        private void Delete(List<string> lys, Document doc,string dwgfile)
59
+        private void Delete(List<string> lys, Document doc, string dwgfile)
60 60
         {
61 61
             Database database = doc.Database;
62 62
             Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
63
-            using (Transaction transaction = database.TransactionManager.StartTransaction())
63
+            if (flag == 0)
64 64
             {
65
-                LayerTable layerTable = transaction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
66
-                for (int i = 0; i < lys.Count; i++)
65
+                using (Transaction trans = doc.Database.TransactionManager.StartTransaction())
67 66
                 {
68
-                    LayerTableRecord layerTableRecord = transaction.GetObject(layerTable[lys[i]], OpenMode.ForWrite) as LayerTableRecord;
69
-                    if (database.Clayer == layerTableRecord.ObjectId)
67
+                    LayerTable layerTable = trans.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
68
+                    for (int i = 0; i < lys.Count; i++)
70 69
                     {
71
-                        database.Clayer = layerTable["0"];
70
+                        if (layerTable.Has(lys[i]))
71
+                        {
72
+                            TypedValue[] value = new TypedValue[]
73
+                            {
74
+                                new TypedValue((int)DxfCode.LayerName,lys[i])
75
+                            };
76
+                            SelectionFilter filter = new SelectionFilter(value);
77
+                            PromptSelectionResult psr = ed.SelectAll(filter);
78
+                            if (psr.Status == PromptStatus.OK)
79
+                            {
80
+                                SelectionSet ss = psr.Value;
81
+                                ObjectIdCollection idcoll = new ObjectIdCollection(ss.GetObjectIds());
82
+                                for (int ii = 0; ii < idcoll.Count; ii++)
83
+                                {
84
+                                    Entity ent = trans.GetObject(idcoll[ii], OpenMode.ForWrite) as Entity;
85
+                                    ent.Erase();
86
+                                }
87
+                            }
88
+                        }
72 89
                     }
73
-                    layerTableRecord.Erase();
90
+                    database.SaveAs(savepath + "\\" + dwgfile, true, DwgVersion.AC1021, doc.Database.SecurityParameters);
91
+                    ed.WriteMessage("删除成功!\n");
92
+                    trans.Commit();
93
+                }
94
+            }
95
+
96
+            if (flag == 3)
97
+            {
98
+                using (Transaction transaction = database.TransactionManager.StartTransaction())
99
+                {
100
+                    LayerTable layerTable = transaction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
101
+                    foreach (ObjectId objid in layerTable)
102
+                    {
103
+                        LayerTableRecord layerTableRecord = transaction.GetObject(objid, OpenMode.ForWrite) as LayerTableRecord;
104
+                        //if (layerTableRecord == null)
105
+                        //    continue;
106
+                        layerTableRecord.IsLocked = false;
107
+                        if (database.Clayer == layerTableRecord.ObjectId)
108
+                            continue;
109
+                        TypedValue[] value = new TypedValue[]
110
+                        {
111
+                            new TypedValue((int)DxfCode.LayerName,layerTableRecord.Name)
112
+                        };
113
+                        SelectionFilter filter = new SelectionFilter(value);
114
+                        PromptSelectionResult psr = ed.SelectAll(filter);
115
+                        if (psr.Status == PromptStatus.Error&& lys.Contains(layerTableRecord.Name))
116
+                            layerTableRecord.Erase();
117
+                    }
118
+                    transaction.Commit();
119
+                    database.SaveAs(savepath + "\\" + dwgfile, true, DwgVersion.AC1021, doc.Database.SecurityParameters);
120
+                }
121
+                ed.WriteMessage("删除成功!\n");
122
+            }
123
+
124
+            if (flag == 4)
125
+            {
126
+                using (Transaction transaction = database.TransactionManager.StartTransaction())
127
+                {
128
+                    LayerTable layerTable = transaction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
129
+                    for (int i = 0; i < lys.Count; i++)
130
+                    {
131
+                        if (layerTable.Has(lys[i]))
132
+                        {
133
+                            LayerTableRecord layerTableRecord = transaction.GetObject(layerTable[lys[i]], OpenMode.ForWrite) as LayerTableRecord;
134
+                            if (layerTableRecord == null)
135
+                                continue;
136
+                            if (database.Clayer == layerTableRecord.ObjectId)
137
+                            {
138
+                                database.Clayer = layerTable["0"];
139
+                            }
140
+                            layerTableRecord.IsLocked = false;
141
+                            layerTableRecord.Erase();
142
+                            BlockTable bt = transaction.GetObject(database.BlockTableId, OpenMode.ForRead) as BlockTable;
143
+                            foreach (ObjectId btrId in bt)
144
+                            {
145
+                                BlockTableRecord btr = transaction.GetObject(btrId, OpenMode.ForRead) as BlockTableRecord;
146
+                                foreach (ObjectId entId in btr)
147
+                                {
148
+                                    Entity entity = transaction.GetObject(entId, OpenMode.ForRead) as Entity;
149
+                                    if (entity.Layer == lys[i])
150
+                                    {
151
+                                        entity.UpgradeOpen();
152
+                                        try
153
+                                        {
154
+                                            entity.Erase();
155
+                                        }
156
+                                        catch
157
+                                        {
158
+                                            continue;
159
+                                        }
160
+                                    }
161
+                                }
162
+                            }
163
+                        }
164
+                    }
165
+                    database.SaveAs(savepath + "\\" + dwgfile, true, DwgVersion.AC1021, doc.Database.SecurityParameters);
166
+                    transaction.Commit();
167
+                    ed.WriteMessage("删除成功!\n");
74 168
                 }
75
-                database.SaveAs(savepath + "\\" + dwgfile, DwgVersion.AC1024);
76
-                transaction.Commit();
77 169
             }
78
-            ed.WriteMessage("删除成功!\n");
79 170
         }
171
+        
80 172
 
81 173
         private void Openly(List<string> lys, Document doc, string dwgfile)
82 174
         {
@@ -87,10 +179,15 @@ namespace HCTools
87 179
                 LayerTable layerTable = transaction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
88 180
                 for (int i = 0; i < lys.Count; i++)
89 181
                 {
90
-                    LayerTableRecord layerTableRecord = transaction.GetObject(layerTable[lys[i]], OpenMode.ForWrite) as LayerTableRecord;
91
-                    layerTableRecord.IsOff = false;
182
+                    if (layerTable.Has(lys[i]))
183
+                    {
184
+                        LayerTableRecord layerTableRecord = transaction.GetObject(layerTable[lys[i]], OpenMode.ForWrite) as LayerTableRecord;
185
+                        if (layerTableRecord == null)
186
+                            continue;
187
+                        layerTableRecord.IsOff = false;
188
+                    }
92 189
                 }
93
-                database.SaveAs(savepath + "\\" + dwgfile, DwgVersion.AC1024);
190
+                database.SaveAs(savepath + "\\" + dwgfile, true, DwgVersion.AC1021, doc.Database.SecurityParameters);
94 191
                 transaction.Commit();
95 192
             }
96 193
             ed.WriteMessage("打开成功!\n");
@@ -105,10 +202,15 @@ namespace HCTools
105 202
                 LayerTable layerTable = transaction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
106 203
                 for (int i = 0; i < lys.Count; i++)
107 204
                 {
108
-                    LayerTableRecord layerTableRecord = transaction.GetObject(layerTable[lys[i]], OpenMode.ForWrite) as LayerTableRecord;
109
-                    layerTableRecord.IsOff = true;
205
+                    if (layerTable.Has(lys[i]))
206
+                    {
207
+                        LayerTableRecord layerTableRecord = transaction.GetObject(layerTable[lys[i]], OpenMode.ForWrite) as LayerTableRecord;
208
+                        if (layerTableRecord == null)
209
+                            continue;
210
+                        layerTableRecord.IsOff = true;
211
+                    }
110 212
                 }
111
-                database.SaveAs(savepath + "\\" + dwgfile, DwgVersion.AC1024);
213
+                database.SaveAs(savepath + "\\" + dwgfile, true, DwgVersion.AC1021, doc.Database.SecurityParameters);
112 214
                 transaction.Commit();
113 215
             }
114 216
             ed.WriteMessage("关闭成功!\n");

+ 48
- 8
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Layerchange_Form.Designer.cs Bestand weergeven

@@ -42,6 +42,9 @@ namespace HCTools
42 42
             this.label3 = new System.Windows.Forms.Label();
43 43
             this.textBox_savepath = new System.Windows.Forms.TextBox();
44 44
             this.button_cssavepath = new System.Windows.Forms.Button();
45
+            this.checkBox_deletself = new System.Windows.Forms.CheckBox();
46
+            this.checkBox_deletnull = new System.Windows.Forms.CheckBox();
47
+            this.checkBox_selectall = new System.Windows.Forms.CheckBox();
45 48
             this.SuspendLayout();
46 49
             // 
47 50
             // label1
@@ -71,7 +74,7 @@ namespace HCTools
71 74
             // 
72 75
             // button_ok
73 76
             // 
74
-            this.button_ok.Location = new System.Drawing.Point(98, 276);
77
+            this.button_ok.Location = new System.Drawing.Point(101, 310);
75 78
             this.button_ok.Name = "button_ok";
76 79
             this.button_ok.Size = new System.Drawing.Size(71, 31);
77 80
             this.button_ok.TabIndex = 4;
@@ -81,7 +84,7 @@ namespace HCTools
81 84
             // 
82 85
             // button_cancel
83 86
             // 
84
-            this.button_cancel.Location = new System.Drawing.Point(403, 276);
87
+            this.button_cancel.Location = new System.Drawing.Point(406, 310);
85 88
             this.button_cancel.Name = "button_cancel";
86 89
             this.button_cancel.Size = new System.Drawing.Size(75, 31);
87 90
             this.button_cancel.TabIndex = 5;
@@ -92,7 +95,7 @@ namespace HCTools
92 95
             // checkedListBox_tc
93 96
             // 
94 97
             this.checkedListBox_tc.FormattingEnabled = true;
95
-            this.checkedListBox_tc.Location = new System.Drawing.Point(158, 102);
98
+            this.checkedListBox_tc.Location = new System.Drawing.Point(158, 128);
96 99
             this.checkedListBox_tc.Name = "checkedListBox_tc";
97 100
             this.checkedListBox_tc.Size = new System.Drawing.Size(275, 164);
98 101
             this.checkedListBox_tc.TabIndex = 6;
@@ -102,15 +105,15 @@ namespace HCTools
102 105
             this.checkBox_delete.AutoSize = true;
103 106
             this.checkBox_delete.Location = new System.Drawing.Point(476, 128);
104 107
             this.checkBox_delete.Name = "checkBox_delete";
105
-            this.checkBox_delete.Size = new System.Drawing.Size(89, 19);
108
+            this.checkBox_delete.Size = new System.Drawing.Size(164, 34);
106 109
             this.checkBox_delete.TabIndex = 7;
107
-            this.checkBox_delete.Text = "删除图层";
110
+            this.checkBox_delete.Text = "删除图层\n(不包括图层本身)";
108 111
             this.checkBox_delete.UseVisualStyleBackColor = true;
109 112
             // 
110 113
             // checkBox_open
111 114
             // 
112 115
             this.checkBox_open.AutoSize = true;
113
-            this.checkBox_open.Location = new System.Drawing.Point(476, 176);
116
+            this.checkBox_open.Location = new System.Drawing.Point(631, 168);
114 117
             this.checkBox_open.Name = "checkBox_open";
115 118
             this.checkBox_open.Size = new System.Drawing.Size(89, 19);
116 119
             this.checkBox_open.TabIndex = 8;
@@ -120,7 +123,7 @@ namespace HCTools
120 123
             // checkBox_close
121 124
             // 
122 125
             this.checkBox_close.AutoSize = true;
123
-            this.checkBox_close.Location = new System.Drawing.Point(476, 223);
126
+            this.checkBox_close.Location = new System.Drawing.Point(631, 215);
124 127
             this.checkBox_close.Name = "checkBox_close";
125 128
             this.checkBox_close.Size = new System.Drawing.Size(89, 19);
126 129
             this.checkBox_close.TabIndex = 9;
@@ -163,11 +166,45 @@ namespace HCTools
163 166
             this.button_cssavepath.UseVisualStyleBackColor = true;
164 167
             this.button_cssavepath.Click += new System.EventHandler(this.button_cssavepath_Click);
165 168
             // 
169
+            // checkBox_deletself
170
+            // 
171
+            this.checkBox_deletself.AutoSize = true;
172
+            this.checkBox_deletself.Location = new System.Drawing.Point(476, 179);
173
+            this.checkBox_deletself.Name = "checkBox_deletself";
174
+            this.checkBox_deletself.Size = new System.Drawing.Size(149, 34);
175
+            this.checkBox_deletself.TabIndex = 14;
176
+            this.checkBox_deletself.Text = "删除图层\n(包括图层本身)";
177
+            this.checkBox_deletself.UseVisualStyleBackColor = true;
178
+            // 
179
+            // checkBox_deletnull
180
+            // 
181
+            this.checkBox_deletnull.AutoSize = true;
182
+            this.checkBox_deletnull.Location = new System.Drawing.Point(476, 235);
183
+            this.checkBox_deletnull.Name = "checkBox_deletnull";
184
+            this.checkBox_deletnull.Size = new System.Drawing.Size(104, 19);
185
+            this.checkBox_deletnull.TabIndex = 15;
186
+            this.checkBox_deletnull.Text = "删除空图层";
187
+            this.checkBox_deletnull.UseVisualStyleBackColor = true;
188
+            // 
189
+            // checkBox_selectall
190
+            // 
191
+            this.checkBox_selectall.AutoSize = true;
192
+            this.checkBox_selectall.Location = new System.Drawing.Point(374, 103);
193
+            this.checkBox_selectall.Name = "checkBox_selectall";
194
+            this.checkBox_selectall.Size = new System.Drawing.Size(59, 19);
195
+            this.checkBox_selectall.TabIndex = 16;
196
+            this.checkBox_selectall.Text = "全选";
197
+            this.checkBox_selectall.UseVisualStyleBackColor = true;
198
+            this.checkBox_selectall.CheckedChanged += new System.EventHandler(this.checkBox_selectall_CheckedChanged);
199
+            // 
166 200
             // Layerchange_Form
167 201
             // 
168 202
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
169 203
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
170
-            this.ClientSize = new System.Drawing.Size(599, 337);
204
+            this.ClientSize = new System.Drawing.Size(750, 379);
205
+            this.Controls.Add(this.checkBox_selectall);
206
+            this.Controls.Add(this.checkBox_deletnull);
207
+            this.Controls.Add(this.checkBox_deletself);
171 208
             this.Controls.Add(this.button_cssavepath);
172 209
             this.Controls.Add(this.textBox_savepath);
173 210
             this.Controls.Add(this.label3);
@@ -204,5 +241,8 @@ namespace HCTools
204 241
         private System.Windows.Forms.Label label3;
205 242
         private System.Windows.Forms.TextBox textBox_savepath;
206 243
         private System.Windows.Forms.Button button_cssavepath;
244
+        private System.Windows.Forms.CheckBox checkBox_deletself;
245
+        private System.Windows.Forms.CheckBox checkBox_deletnull;
246
+        private System.Windows.Forms.CheckBox checkBox_selectall;
207 247
     }
208 248
 }

+ 32
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Layerchange_Form.cs Bestand weergeven

@@ -117,6 +117,20 @@ namespace HCTools
117 117
                     lyc.chagly();
118 118
                     this.Close();
119 119
                 }
120
+                if (checkBox_deletnull.Checked == true)
121
+                {
122
+                    LayerChange lyc = new LayerChange();
123
+                    LayerChange.flag = 3;
124
+                    lyc.chagly();
125
+                    this.Close();
126
+                }
127
+                if (checkBox_deletself.Checked == true)
128
+                {
129
+                    LayerChange lyc = new LayerChange();
130
+                    LayerChange.flag = 4;
131
+                    lyc.chagly();
132
+                    this.Close();
133
+                }
120 134
             }
121 135
         }
122 136
 
@@ -139,5 +153,23 @@ namespace HCTools
139 153
                 textBox_savepath.Text = open.SelectedPath;
140 154
             LayerChange.savepath = textBox_savepath.Text;
141 155
         }
156
+
157
+        private void checkBox_selectall_CheckedChanged(object sender, EventArgs e)
158
+        {
159
+            if (checkBox_selectall.Checked == true)
160
+            {
161
+                for (int i = 0; i < checkedListBox_tc.Items.Count; i++)
162
+                {
163
+                    checkedListBox_tc.SetItemCheckState(i, CheckState.Checked);
164
+                }
165
+            }
166
+            else
167
+            {
168
+                for (int i = 0; i < checkedListBox_tc.Items.Count; i++)
169
+                {
170
+                    checkedListBox_tc.SetItemCheckState(i, CheckState.Unchecked);
171
+                }
172
+            }
173
+        }
142 174
     }
143 175
 }

+ 85
- 6
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/MainClass.cs Bestand weergeven

@@ -66,7 +66,6 @@ namespace HCTools
66 66
             //functions.deleteCommand();
67 67
         }
68 68
 
69
-        public static int FormNumber = 0; //0和1记录窗体是否已经打开
70 69
         public static string Flag = "";      //标记不同命令
71 70
         public int num = 1; //0超过期限,-1空
72 71
         public int slf_flag = 0;
@@ -477,6 +476,21 @@ namespace HCTools
477 476
             }
478 477
         }
479 478
 
479
+        //批量插入DOM(多对一)
480
+        [CommandMethod("InstDOMs")]
481
+        public void IstDOMs()
482
+        {
483
+            Verify();
484
+            if (num == 1)
485
+            {
486
+                InsertDOMs_to_one istdom = new InsertDOMs_to_one();
487
+                istdom.Show();
488
+                //Flag = "SlopeLine";
489
+                //Parameters SL = new Parameters();
490
+                //SL.Show();
491
+            }
492
+        }
493
+
480 494
         //等高线缩编
481 495
         [CommandMethod("Dgxsb")]
482 496
         public void dgxSB()
@@ -501,7 +515,7 @@ namespace HCTools
501 515
             }
502 516
         }
503 517
 
504
-        //图层删改
518
+        //属性表
505 519
         [CommandMethod("Attribute")]
506 520
         public void Attribute()
507 521
         {
@@ -574,11 +588,76 @@ namespace HCTools
574 588
         }
575 589
 
576 590
         //等高线内插
577
-        //[CommandMethod("Dgxinter")]
578
-        //public void Dgxnc()
591
+        [CommandMethod("Dgxinter")]
592
+        public void Dgxnc()
593
+        {
594
+            Verify();
595
+            if (num == 1)
596
+            {
597
+                Dgxinters dgxinter = new Dgxinters();
598
+                dgxinter.Interdgx();
599
+            }
600
+        }
601
+
602
+        //等高线过河流道路房屋陡坎裁剪
603
+        //[CommandMethod("Cutdgxthrorvrd")]
604
+        //public void Cutdgxthrorvrd()
579 605
         //{
580
-        //    Dgxinterpl form = new Dgxinterpl();
581
-        //    form.Show();
606
+        //    Verify();
607
+        //    if (num == 1)
608
+        //    {
609
+        //        Dgxthrorvrd_Form form = new Dgxthrorvrd_Form();
610
+        //        form.Show();
611
+        //    }
582 612
         //}
613
+
614
+        //删除整数值高程点
615
+        [CommandMethod("Deleteintgcd")]
616
+        public void Deleteintgcd()
617
+        {
618
+            Verify();
619
+            if (num == 1)
620
+            {
621
+                GCDdelete_Form form = new GCDdelete_Form();
622
+                form.Show();
623
+            }
624
+        }
625
+
626
+        //分幅输出地形图
627
+        [CommandMethod("Clipdwg")]
628
+        public void Clipdwg()
629
+        {
630
+            Verify();
631
+            if (num == 1)
632
+            {
633
+                OutputbyTK_Form form = new OutputbyTK_Form();
634
+                form.Show();
635
+            }
636
+        }
637
+
638
+
639
+        //图幅号修改
640
+        [CommandMethod("ChangeTFH")]
641
+        public void ChgTFH()
642
+        {
643
+            Verify();
644
+            if (num == 1)
645
+            {
646
+                ModifyTFH form = new ModifyTFH();
647
+                form.Show();
648
+            }
649
+        }
650
+
651
+        //计曲线高程标注
652
+        [CommandMethod("JQXLabel")]
653
+        public void Jqxlb()
654
+        {
655
+            Verify();
656
+            if (num == 1)
657
+            {
658
+                JQXlabel form = new JQXlabel();
659
+                form.Show();
660
+            }
661
+        }
583 662
     }
584 663
 }

+ 21
- 3
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Menus.cs Bestand weergeven

@@ -50,6 +50,9 @@ namespace HCTools
50 50
             pmi = pm.AddMenuItem(pm.Count + 1, "批量插入DOM", "InstDOM ");
51 51
             pmi.HelpString = "批量插入DOM";
52 52
 
53
+            pmi = pm.AddMenuItem(pm.Count + 1, "批量插入DOM(多对一)", "InstDOMs ");
54
+            pmi.HelpString = "批量插入DOM(多对一)";
55
+
53 56
             //添加一个分隔条以区分不同类型的命令
54 57
             pm.AddSeparator(pm.Count + 1);
55 58
 
@@ -72,6 +75,12 @@ namespace HCTools
72 75
             pmi = pm.AddMenuItem(pm.Count + 1, "自动生成图框", "SheetMap ");
73 76
             pmi.HelpString = "自动生成图框";
74 77
 
78
+            pmi = pm.AddMenuItem(pm.Count + 1, "分幅输出地形图", "Clipdwg ");
79
+            pmi.HelpString = "分幅输出地形图";
80
+
81
+            pmi = pm.AddMenuItem(pm.Count + 1, "图幅号修改", "ChangeTFH ");
82
+            pmi.HelpString = "图幅号修改";
83
+
75 84
             pmi = pm.AddMenuItem(pm.Count + 1, "批量修改图框信息", "BATChange ");
76 85
             pmi.HelpString = "批量修改图框信息";
77 86
 
@@ -92,7 +101,10 @@ namespace HCTools
92 101
             pmi.HelpString = "检查高程点在一定范围内密度";
93 102
 
94 103
             pmi = pm.AddMenuItem(pm.Count + 1, "删除内部高程点", "Deletept ");
95
-            pmi.HelpString = "删除高程点";
104
+            pmi.HelpString = "删除内部高程点";
105
+
106
+            pmi = pm.AddMenuItem(pm.Count + 1, "删除整数高程点", "Deleteintgcd ");
107
+            pmi.HelpString = "删除整数高程点";
96 108
 
97 109
             pmi = pm.AddMenuItem(pm.Count + 1, "等高线分层", "Hierarchy ");
98 110
             pmi.HelpString = "等高线分层";
@@ -109,8 +121,11 @@ namespace HCTools
109 121
             pmi = pm.AddMenuItem(pm.Count + 1, "等高线拉线修改", "CLfix ");
110 122
             pmi.HelpString = "等高线拉线修改";
111 123
 
112
-            //pmi = pm.AddMenuItem(pm.Count + 1, "等高线内插", "Dgxinter ");
113
-            //pmi.HelpString = "等高线内插";
124
+            pmi = pm.AddMenuItem(pm.Count + 1, "等高线内插", "Dgxinter ");
125
+            pmi.HelpString = "等高线内插";
126
+
127
+            pmi = pm.AddMenuItem(pm.Count + 1, "计曲线高程标注", "JQXLabel ");
128
+            pmi.HelpString = "计曲线高程标注";
114 129
 
115 130
             //pmi = pm.AddMenuItem(pm.Count + 1, "示坡线绘制", "SlopeLine ");
116 131
             //pmi.HelpString = "示坡线绘制";
@@ -130,6 +145,9 @@ namespace HCTools
130 145
             pmi = pm.AddMenuItem(pm.Count + 1, "等高线高程取整", "EleRd ");
131 146
             pmi.HelpString = "等高线高程取整";
132 147
 
148
+            //pmi = pm.AddMenuItem(pm.Count + 1, "等高线过河流道路房屋陡坎裁剪", "Cutdgxthrorvrd ");
149
+            //pmi.HelpString = "等高线过河流道路房屋陡坎裁剪";
150
+
133 151
             //添加一个分隔条以区分不同类型的命令
134 152
             pm.AddSeparator(pm.Count + 1);
135 153
 

+ 134
- 16
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Properties/Settings.Designer.cs Bestand weergeven

@@ -1,29 +1,147 @@
1 1
 //------------------------------------------------------------------------------
2 2
 // <auto-generated>
3
-//     This code was generated by a tool.
4
-//     Runtime Version:4.0.30319.42000
3
+//     此代码由工具生成。
4
+//     运行时版本:4.0.30319.42000
5 5
 //
6
-//     Changes to this file may cause incorrect behavior and will be lost if
7
-//     the code is regenerated.
6
+//     对此文件的更改可能会导致不正确的行为,并且如果
7
+//     重新生成代码,这些更改将会丢失。
8 8
 // </auto-generated>
9 9
 //------------------------------------------------------------------------------
10 10
 
11
-
12
-namespace HCTools.Properties
13
-{
11
+namespace HCTools.Properties {
12
+    
13
+    
14 14
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
17
-    {
18
-
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
+        
19 18
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
20
-
21
-        public static Settings Default
22
-        {
23
-            get
24
-            {
19
+        
20
+        public static Settings Default {
21
+            get {
25 22
                 return defaultInstance;
26 23
             }
27 24
         }
25
+        
26
+        [global::System.Configuration.UserScopedSettingAttribute()]
27
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
29
+        public string TFName {
30
+            get {
31
+                return ((string)(this["TFName"]));
32
+            }
33
+            set {
34
+                this["TFName"] = value;
35
+            }
36
+        }
37
+        
38
+        [global::System.Configuration.UserScopedSettingAttribute()]
39
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40
+        [global::System.Configuration.DefaultSettingValueAttribute("2000国家大地坐标系,1985国家高程基准,等高距为1m。\r\nGB/T20257.1-2007 国家基本比例尺地图图式 第一部分\r\n1:500 1:1000 1" +
41
+            ":2000 地形图图式\r\nxxxx年xx月测制")]
42
+        public string Note2 {
43
+            get {
44
+                return ((string)(this["Note2"]));
45
+            }
46
+            set {
47
+                this["Note2"] = value;
48
+            }
49
+        }
50
+        
51
+        [global::System.Configuration.UserScopedSettingAttribute()]
52
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
53
+        [global::System.Configuration.DefaultSettingValueAttribute("测图员 ")]
54
+        public string CTY {
55
+            get {
56
+                return ((string)(this["CTY"]));
57
+            }
58
+            set {
59
+                this["CTY"] = value;
60
+            }
61
+        }
62
+        
63
+        [global::System.Configuration.UserScopedSettingAttribute()]
64
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
65
+        [global::System.Configuration.DefaultSettingValueAttribute("检查员 ")]
66
+        public string JCY {
67
+            get {
68
+                return ((string)(this["JCY"]));
69
+            }
70
+            set {
71
+                this["JCY"] = value;
72
+            }
73
+        }
74
+        
75
+        [global::System.Configuration.UserScopedSettingAttribute()]
76
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
77
+        [global::System.Configuration.DefaultSettingValueAttribute("土调员 ")]
78
+        public string TDY {
79
+            get {
80
+                return ((string)(this["TDY"]));
81
+            }
82
+            set {
83
+                this["TDY"] = value;
84
+            }
85
+        }
86
+        
87
+        [global::System.Configuration.UserScopedSettingAttribute()]
88
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
89
+        [global::System.Configuration.DefaultSettingValueAttribute("数调员 ")]
90
+        public string SDY {
91
+            get {
92
+                return ((string)(this["SDY"]));
93
+            }
94
+            set {
95
+                this["SDY"] = value;
96
+            }
97
+        }
98
+        
99
+        [global::System.Configuration.UserScopedSettingAttribute()]
100
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
101
+        [global::System.Configuration.DefaultSettingValueAttribute("0")]
102
+        public int DH {
103
+            get {
104
+                return ((int)(this["DH"]));
105
+            }
106
+            set {
107
+                this["DH"] = value;
108
+            }
109
+        }
110
+        
111
+        [global::System.Configuration.UserScopedSettingAttribute()]
112
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
113
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
114
+        public string svpath {
115
+            get {
116
+                return ((string)(this["svpath"]));
117
+            }
118
+            set {
119
+                this["svpath"] = value;
120
+            }
121
+        }
122
+        
123
+        [global::System.Configuration.UserScopedSettingAttribute()]
124
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
125
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
126
+        public string secret {
127
+            get {
128
+                return ((string)(this["secret"]));
129
+            }
130
+            set {
131
+                this["secret"] = value;
132
+            }
133
+        }
134
+        
135
+        [global::System.Configuration.UserScopedSettingAttribute()]
136
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
137
+        [global::System.Configuration.DefaultSettingValueAttribute("1")]
138
+        public double dgj {
139
+            get {
140
+                return ((double)(this["dgj"]));
141
+            }
142
+            set {
143
+                this["dgj"] = value;
144
+            }
145
+        }
28 146
     }
29 147
 }

+ 38
- 6
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/Properties/Settings.settings Bestand weergeven

@@ -1,7 +1,39 @@
1 1
 <?xml version='1.0' encoding='utf-8'?>
2
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3
-  <Profiles>
4
-    <Profile Name="(Default)" />
5
-  </Profiles>
6
-  <Settings />
7
-</SettingsFile>
2
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HCTools.Properties" GeneratedClassName="Settings">
3
+  <Profiles />
4
+  <Settings>
5
+    <Setting Name="TFName" Type="System.String" Scope="User">
6
+      <Value Profile="(Default)" />
7
+    </Setting>
8
+    <Setting Name="Note2" Type="System.String" Scope="User">
9
+      <Value Profile="(Default)">2000国家大地坐标系,1985国家高程基准,等高距为1m。
10
+GB/T20257.1-2007 国家基本比例尺地图图式 第一部分
11
+1:500 1:1000 1:2000 地形图图式
12
+xxxx年xx月测制</Value>
13
+    </Setting>
14
+    <Setting Name="CTY" Type="System.String" Scope="User">
15
+      <Value Profile="(Default)">测图员 </Value>
16
+    </Setting>
17
+    <Setting Name="JCY" Type="System.String" Scope="User">
18
+      <Value Profile="(Default)">检查员 </Value>
19
+    </Setting>
20
+    <Setting Name="TDY" Type="System.String" Scope="User">
21
+      <Value Profile="(Default)">土调员 </Value>
22
+    </Setting>
23
+    <Setting Name="SDY" Type="System.String" Scope="User">
24
+      <Value Profile="(Default)">数调员 </Value>
25
+    </Setting>
26
+    <Setting Name="DH" Type="System.Int32" Scope="User">
27
+      <Value Profile="(Default)">0</Value>
28
+    </Setting>
29
+    <Setting Name="svpath" Type="System.String" Scope="User">
30
+      <Value Profile="(Default)" />
31
+    </Setting>
32
+    <Setting Name="secret" Type="System.String" Scope="User">
33
+      <Value Profile="(Default)" />
34
+    </Setting>
35
+    <Setting Name="dgj" Type="System.Double" Scope="User">
36
+      <Value Profile="(Default)">1</Value>
37
+    </Setting>
38
+  </Settings>
39
+</SettingsFile>

+ 55
- 81
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/TKInfo.Designer.cs Bestand weergeven

@@ -36,11 +36,6 @@ namespace HCTools
36 36
             this.textBox_SHY = new System.Windows.Forms.TextBox();
37 37
             this.textBox_TDY = new System.Windows.Forms.TextBox();
38 38
             this.textBox_CTY = new System.Windows.Forms.TextBox();
39
-            this.label_Tdy = new System.Windows.Forms.Label();
40
-            this.label_DH = new System.Windows.Forms.Label();
41
-            this.label_Jcy = new System.Windows.Forms.Label();
42
-            this.label_Shy = new System.Windows.Forms.Label();
43
-            this.label_Cty = new System.Windows.Forms.Label();
44 39
             this.richTextBox1 = new System.Windows.Forms.RichTextBox();
45 40
             this.label_Rich = new System.Windows.Forms.Label();
46 41
             this.textBox_Name = new System.Windows.Forms.TextBox();
@@ -50,12 +45,15 @@ namespace HCTools
50 45
             this.label1 = new System.Windows.Forms.Label();
51 46
             this.textBox_savepath = new System.Windows.Forms.TextBox();
52 47
             this.button_chse = new System.Windows.Forms.Button();
48
+            this.label_DH = new System.Windows.Forms.Label();
49
+            this.label2 = new System.Windows.Forms.Label();
50
+            this.textBox_secret = new System.Windows.Forms.TextBox();
53 51
             this.SuspendLayout();
54 52
             // 
55 53
             // label_blc_TK
56 54
             // 
57 55
             this.label_blc_TK.AutoSize = true;
58
-            this.label_blc_TK.Location = new System.Drawing.Point(290, 317);
56
+            this.label_blc_TK.Location = new System.Drawing.Point(306, 304);
59 57
             this.label_blc_TK.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
60 58
             this.label_blc_TK.Name = "label_blc_TK";
61 59
             this.label_blc_TK.Size = new System.Drawing.Size(52, 15);
@@ -70,7 +68,7 @@ namespace HCTools
70 68
             "1:500",
71 69
             "1:1000",
72 70
             "1:2000"});
73
-            this.comboBox_BLC1.Location = new System.Drawing.Point(350, 314);
71
+            this.comboBox_BLC1.Location = new System.Drawing.Point(366, 301);
74 72
             this.comboBox_BLC1.Margin = new System.Windows.Forms.Padding(4);
75 73
             this.comboBox_BLC1.Name = "comboBox_BLC1";
76 74
             this.comboBox_BLC1.Size = new System.Drawing.Size(166, 23);
@@ -78,7 +76,7 @@ namespace HCTools
78 76
             // 
79 77
             // textBox_DH
80 78
             // 
81
-            this.textBox_DH.Location = new System.Drawing.Point(117, 312);
79
+            this.textBox_DH.Location = new System.Drawing.Point(133, 299);
82 80
             this.textBox_DH.Margin = new System.Windows.Forms.Padding(4);
83 81
             this.textBox_DH.Name = "textBox_DH";
84 82
             this.textBox_DH.Size = new System.Drawing.Size(156, 25);
@@ -86,85 +84,39 @@ namespace HCTools
86 84
             // 
87 85
             // textBox_JCY
88 86
             // 
89
-            this.textBox_JCY.Location = new System.Drawing.Point(350, 233);
87
+            this.textBox_JCY.Location = new System.Drawing.Point(309, 220);
90 88
             this.textBox_JCY.Margin = new System.Windows.Forms.Padding(4);
91 89
             this.textBox_JCY.Name = "textBox_JCY";
92
-            this.textBox_JCY.Size = new System.Drawing.Size(166, 25);
90
+            this.textBox_JCY.Size = new System.Drawing.Size(223, 25);
93 91
             this.textBox_JCY.TabIndex = 104;
92
+            this.textBox_JCY.Text = "检察员 ";
94 93
             // 
95 94
             // textBox_SHY
96 95
             // 
97
-            this.textBox_SHY.Location = new System.Drawing.Point(350, 271);
96
+            this.textBox_SHY.Location = new System.Drawing.Point(309, 258);
98 97
             this.textBox_SHY.Margin = new System.Windows.Forms.Padding(4);
99 98
             this.textBox_SHY.Name = "textBox_SHY";
100
-            this.textBox_SHY.Size = new System.Drawing.Size(166, 25);
99
+            this.textBox_SHY.Size = new System.Drawing.Size(223, 25);
101 100
             this.textBox_SHY.TabIndex = 103;
101
+            this.textBox_SHY.Text = "数调员 ";
102 102
             // 
103 103
             // textBox_TDY
104 104
             // 
105
-            this.textBox_TDY.Location = new System.Drawing.Point(117, 271);
105
+            this.textBox_TDY.Location = new System.Drawing.Point(76, 258);
106 106
             this.textBox_TDY.Margin = new System.Windows.Forms.Padding(4);
107 107
             this.textBox_TDY.Name = "textBox_TDY";
108
-            this.textBox_TDY.Size = new System.Drawing.Size(156, 25);
108
+            this.textBox_TDY.Size = new System.Drawing.Size(213, 25);
109 109
             this.textBox_TDY.TabIndex = 102;
110
+            this.textBox_TDY.Text = "土调员 ";
110 111
             // 
111 112
             // textBox_CTY
112 113
             // 
113
-            this.textBox_CTY.Location = new System.Drawing.Point(117, 233);
114
+            this.textBox_CTY.Location = new System.Drawing.Point(76, 220);
114 115
             this.textBox_CTY.Margin = new System.Windows.Forms.Padding(4);
115 116
             this.textBox_CTY.Name = "textBox_CTY";
116
-            this.textBox_CTY.Size = new System.Drawing.Size(156, 25);
117
+            this.textBox_CTY.Size = new System.Drawing.Size(213, 25);
117 118
             this.textBox_CTY.TabIndex = 101;
118
-            // 
119
-            // label_Tdy
120
-            // 
121
-            this.label_Tdy.AutoSize = true;
122
-            this.label_Tdy.Location = new System.Drawing.Point(57, 279);
123
-            this.label_Tdy.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
124
-            this.label_Tdy.Name = "label_Tdy";
125
-            this.label_Tdy.Size = new System.Drawing.Size(52, 15);
126
-            this.label_Tdy.TabIndex = 100;
127
-            this.label_Tdy.Text = "土调员";
128
-            // 
129
-            // label_DH
130
-            // 
131
-            this.label_DH.AutoSize = true;
132
-            this.label_DH.Location = new System.Drawing.Point(57, 320);
133
-            this.label_DH.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
134
-            this.label_DH.Name = "label_DH";
135
-            this.label_DH.Size = new System.Drawing.Size(37, 15);
136
-            this.label_DH.TabIndex = 99;
137
-            this.label_DH.Text = "带号";
138
-            // 
139
-            // label_Jcy
140
-            // 
141
-            this.label_Jcy.AutoSize = true;
142
-            this.label_Jcy.Location = new System.Drawing.Point(290, 236);
143
-            this.label_Jcy.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
144
-            this.label_Jcy.Name = "label_Jcy";
145
-            this.label_Jcy.Size = new System.Drawing.Size(52, 15);
146
-            this.label_Jcy.TabIndex = 98;
147
-            this.label_Jcy.Text = "检查员";
148
-            // 
149
-            // label_Shy
150
-            // 
151
-            this.label_Shy.AutoSize = true;
152
-            this.label_Shy.Location = new System.Drawing.Point(290, 274);
153
-            this.label_Shy.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
154
-            this.label_Shy.Name = "label_Shy";
155
-            this.label_Shy.Size = new System.Drawing.Size(52, 15);
156
-            this.label_Shy.TabIndex = 97;
157
-            this.label_Shy.Text = "数化员";
158
-            // 
159
-            // label_Cty
160
-            // 
161
-            this.label_Cty.AutoSize = true;
162
-            this.label_Cty.Location = new System.Drawing.Point(57, 236);
163
-            this.label_Cty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
164
-            this.label_Cty.Name = "label_Cty";
165
-            this.label_Cty.Size = new System.Drawing.Size(52, 15);
166
-            this.label_Cty.TabIndex = 96;
167
-            this.label_Cty.Text = "测图员";
119
+            this.textBox_CTY.Text = "测图员 ";
168 120
             // 
169 121
             // richTextBox1
170 122
             // 
@@ -205,7 +157,7 @@ namespace HCTools
205 157
             // 
206 158
             // btn_Cancel
207 159
             // 
208
-            this.btn_Cancel.Location = new System.Drawing.Point(324, 411);
160
+            this.btn_Cancel.Location = new System.Drawing.Point(323, 418);
209 161
             this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4);
210 162
             this.btn_Cancel.Name = "btn_Cancel";
211 163
             this.btn_Cancel.Size = new System.Drawing.Size(100, 29);
@@ -216,7 +168,7 @@ namespace HCTools
216 168
             // 
217 169
             // btn_OK
218 170
             // 
219
-            this.btn_OK.Location = new System.Drawing.Point(173, 410);
171
+            this.btn_OK.Location = new System.Drawing.Point(172, 417);
220 172
             this.btn_OK.Margin = new System.Windows.Forms.Padding(4);
221 173
             this.btn_OK.Name = "btn_OK";
222 174
             this.btn_OK.Size = new System.Drawing.Size(100, 29);
@@ -228,7 +180,7 @@ namespace HCTools
228 180
             // label1
229 181
             // 
230 182
             this.label1.AutoSize = true;
231
-            this.label1.Location = new System.Drawing.Point(50, 369);
183
+            this.label1.Location = new System.Drawing.Point(49, 376);
232 184
             this.label1.Name = "label1";
233 185
             this.label1.Size = new System.Drawing.Size(82, 15);
234 186
             this.label1.TabIndex = 110;
@@ -236,14 +188,14 @@ namespace HCTools
236 188
             // 
237 189
             // textBox_savepath
238 190
             // 
239
-            this.textBox_savepath.Location = new System.Drawing.Point(138, 366);
191
+            this.textBox_savepath.Location = new System.Drawing.Point(137, 373);
240 192
             this.textBox_savepath.Name = "textBox_savepath";
241 193
             this.textBox_savepath.Size = new System.Drawing.Size(304, 25);
242 194
             this.textBox_savepath.TabIndex = 111;
243 195
             // 
244 196
             // button_chse
245 197
             // 
246
-            this.button_chse.Location = new System.Drawing.Point(458, 362);
198
+            this.button_chse.Location = new System.Drawing.Point(457, 369);
247 199
             this.button_chse.Name = "button_chse";
248 200
             this.button_chse.Size = new System.Drawing.Size(75, 29);
249 201
             this.button_chse.TabIndex = 112;
@@ -251,11 +203,39 @@ namespace HCTools
251 203
             this.button_chse.UseVisualStyleBackColor = true;
252 204
             this.button_chse.Click += new System.EventHandler(this.button_chse_Click);
253 205
             // 
206
+            // label_DH
207
+            // 
208
+            this.label_DH.AutoSize = true;
209
+            this.label_DH.Location = new System.Drawing.Point(73, 307);
210
+            this.label_DH.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
211
+            this.label_DH.Name = "label_DH";
212
+            this.label_DH.Size = new System.Drawing.Size(37, 15);
213
+            this.label_DH.TabIndex = 99;
214
+            this.label_DH.Text = "带号";
215
+            // 
216
+            // label2
217
+            // 
218
+            this.label2.AutoSize = true;
219
+            this.label2.Location = new System.Drawing.Point(51, 340);
220
+            this.label2.Name = "label2";
221
+            this.label2.Size = new System.Drawing.Size(187, 15);
222
+            this.label2.TabIndex = 113;
223
+            this.label2.Text = "保密等级(没有则为空):";
224
+            // 
225
+            // textBox_secret
226
+            // 
227
+            this.textBox_secret.Location = new System.Drawing.Point(244, 337);
228
+            this.textBox_secret.Name = "textBox_secret";
229
+            this.textBox_secret.Size = new System.Drawing.Size(151, 25);
230
+            this.textBox_secret.TabIndex = 114;
231
+            // 
254 232
             // TKInfo
255 233
             // 
256 234
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
257 235
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
258
-            this.ClientSize = new System.Drawing.Size(610, 467);
236
+            this.ClientSize = new System.Drawing.Size(610, 457);
237
+            this.Controls.Add(this.textBox_secret);
238
+            this.Controls.Add(this.label2);
259 239
             this.Controls.Add(this.button_chse);
260 240
             this.Controls.Add(this.textBox_savepath);
261 241
             this.Controls.Add(this.label1);
@@ -268,11 +248,7 @@ namespace HCTools
268 248
             this.Controls.Add(this.textBox_SHY);
269 249
             this.Controls.Add(this.textBox_TDY);
270 250
             this.Controls.Add(this.textBox_CTY);
271
-            this.Controls.Add(this.label_Tdy);
272 251
             this.Controls.Add(this.label_DH);
273
-            this.Controls.Add(this.label_Jcy);
274
-            this.Controls.Add(this.label_Shy);
275
-            this.Controls.Add(this.label_Cty);
276 252
             this.Controls.Add(this.richTextBox1);
277 253
             this.Controls.Add(this.label_Rich);
278 254
             this.Controls.Add(this.textBox_Name);
@@ -294,11 +270,6 @@ namespace HCTools
294 270
         private System.Windows.Forms.TextBox textBox_SHY;
295 271
         private System.Windows.Forms.TextBox textBox_TDY;
296 272
         private System.Windows.Forms.TextBox textBox_CTY;
297
-        private System.Windows.Forms.Label label_Tdy;
298
-        private System.Windows.Forms.Label label_DH;
299
-        private System.Windows.Forms.Label label_Jcy;
300
-        private System.Windows.Forms.Label label_Shy;
301
-        private System.Windows.Forms.Label label_Cty;
302 273
         private System.Windows.Forms.RichTextBox richTextBox1;
303 274
         private System.Windows.Forms.Label label_Rich;
304 275
         private System.Windows.Forms.TextBox textBox_Name;
@@ -308,5 +279,8 @@ namespace HCTools
308 279
         private System.Windows.Forms.Label label1;
309 280
         private System.Windows.Forms.TextBox textBox_savepath;
310 281
         private System.Windows.Forms.Button button_chse;
282
+        private System.Windows.Forms.Label label_DH;
283
+        private System.Windows.Forms.Label label2;
284
+        private System.Windows.Forms.TextBox textBox_secret;
311 285
     }
312 286
 }

+ 31
- 10
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/TKInfo.cs Bestand weergeven

@@ -28,21 +28,32 @@ namespace HCTools
28 28
         public static string FCY = "";
29 29
         public static string SV = "";
30 30
         public static int DH = -1;
31
+        public static string Secret = "";
31 32
 
32 33
         public static int BLC = 2000;
33
-        public static string ConstLine1 = "GB/T20257.1-2007国家基本比例尺地图图式 第一部分:";
34
-        public static string ConstLine2 = "1:500 1:1000 1:2000地形图图式";
34
+        //public static string ConstLine1 = "GB/T20257.1-2007国家基本比例尺地图图式 第一部分:";
35
+        //public static string ConstLine2 = "1:500 1:1000 1:2000地形图图式";
35 36
         #endregion
36 37
 
37 38
         private void TKInfo_Load(object sender, EventArgs e)
38 39
         {
39
-            this.richTextBox1.Text = "\r\n";
40
-            this.richTextBox1.Text += ConstLine1;
41
-            this.richTextBox1.Text += "\r\n";
42
-            this.richTextBox1.Text += ConstLine2;
43
-            this.richTextBox1.Text += "\r\n";
44
-            this.richTextBox1.Text += System.DateTime.Now.Year + "年" + System.DateTime.Now.Month + "月数字化成图。";
40
+            //this.richTextBox1.Text = "\r\n";
41
+            //this.richTextBox1.Text += ConstLine1;
42
+            //this.richTextBox1.Text += "\r\n";
43
+            //this.richTextBox1.Text += ConstLine2;
44
+            //this.richTextBox1.Text += "\r\n";
45
+            //this.richTextBox1.Text += System.DateTime.Now.Year + "年" + System.DateTime.Now.Month + "月数字化成图。";
45 46
 
47
+
48
+            this.textBox_Name.Text = Properties.Settings.Default.TFName;
49
+            this.richTextBox1.Text = Properties.Settings.Default.Note2;
50
+            this.textBox_CTY.Text = Properties.Settings.Default.CTY;
51
+            this.textBox_TDY.Text = Properties.Settings.Default.TDY;
52
+            this.textBox_SHY.Text = Properties.Settings.Default.SDY;
53
+            this.textBox_JCY.Text = Properties.Settings.Default.JCY;
54
+            this.textBox_DH.Text = Properties.Settings.Default.DH.ToString();
55
+            this.textBox_secret.Text = Properties.Settings.Default.secret.ToString();
56
+            textBox_savepath.Text = Properties.Settings.Default.svpath;
46 57
         }
47 58
 
48 59
         private void btn_OK_Click(object sender, EventArgs e)
@@ -70,6 +81,7 @@ namespace HCTools
70 81
             SHY = this.textBox_SHY.Text;
71 82
             JCY = this.textBox_JCY.Text;
72 83
             SV = textBox_savepath.Text;
84
+            Secret = textBox_secret.Text;
73 85
 
74 86
             if (string.IsNullOrEmpty(textBox_DH.Text.Trim()) == false)
75 87
             {
@@ -94,8 +106,17 @@ namespace HCTools
94 106
 
95 107
             CreateSheetMap map = new CreateSheetMap();
96 108
             map.create();
97
-            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
98
-            ed.WriteMessage("生成完毕\n");
109
+            Properties.Settings.Default.TFName = name;
110
+            Properties.Settings.Default.Note2 = note;
111
+            Properties.Settings.Default.CTY = CTY;
112
+            Properties.Settings.Default.JCY = JCY;
113
+            Properties.Settings.Default.TDY = TDY;
114
+            Properties.Settings.Default.SDY = SHY;
115
+            Properties.Settings.Default.DH = DH;
116
+            Properties.Settings.Default.svpath = SV;
117
+            Properties.Settings.Default.secret = Secret;
118
+            Properties.Settings.Default.Save();
119
+            MessageBox.Show("生成完毕");
99 120
         }
100 121
 
101 122
         private void btn_Cancel_Click(object sender, EventArgs e)

BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/HCTools.dll Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/HCTools.pdb Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/DesignTimeResolveAssemblyReferences.cache Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache Bestand weergeven


+ 1
- 1
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.CoreCompileInputs.cache Bestand weergeven

@@ -1 +1 @@
1
-4e3c4767d845fa36fb55751b677a88ae0dd51aac
1
+77524447917898d81ef1041c17a73b0be2e35819

+ 17
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.FileListAbsolute.txt Bestand weergeven

@@ -24,8 +24,15 @@ F:\2024\04\浩辰\HCTools\HCTools\HCTools\obj\Debug\HCTools.DeleteElept.resource
24 24
 F:\2024\04\浩辰\HCTools\HCTools\HCTools\obj\Debug\HCTools.CutCountL.resources
25 25
 F:\2024\04\浩辰\HCTools\HCTools\HCTools\obj\Debug\HCTools.EleRd.resources
26 26
 F:\2024\04\浩辰\HCTools\HCTools\HCTools\obj\Debug\HCTools.csproj.AssemblyReference.cache
27
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\HCTools.dll.config
27 28
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\HCTools.dll
28 29
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\HCTools.pdb
30
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\NetTopologySuite.xml
31
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\System.Buffers.xml
32
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\System.Diagnostics.DiagnosticSource.xml
33
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\System.Memory.xml
34
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\System.Numerics.Vectors.xml
35
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
29 36
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.AttributeForm.resources
30 37
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.Chaginfos.resources
31 38
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.CheckL.resources
@@ -34,11 +41,14 @@ F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\D
34 41
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.DeleteElept.resources
35 42
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.DgxAnno.resources
36 43
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.DGXGeneral.resources
44
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.Dgxthrorvrd_Form.resources
37 45
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.EleptDensity.resources
38 46
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.EleRd.resources
47
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.GCDdelete_Form.resources
39 48
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.Hierak.resources
40 49
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.InstDOM.resources
41 50
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.Layerchange_Form.resources
51
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.OutputbyTK_Form.resources
42 52
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.PicPts.resources
43 53
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.PLError_Overlay.resources
44 54
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.Properties.Resources.resources
@@ -47,5 +57,12 @@ F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\D
47 57
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.TKInfo.resources
48 58
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.GenerateResource.cache
49 59
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.CoreCompileInputs.cache
60
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.Fody.CopyLocal.cache
61
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.Fody.RuntimeCopyLocal.cache
62
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.CopyComplete
50 63
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.dll
51 64
 F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.pdb
65
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.AssemblyReference.cache
66
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.ModifyTFH.resources
67
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.JQXlabel.resources
68
+F:\2024\08\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.InsertDOMs_to_one.resources

BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.GenerateResource.cache Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.dll Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.pdb Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/.suo Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/000.testlog Bestand weergeven


BIN
加密后软件工具/CAD插件工具/源代码/HCTools_latest/.vs/HCTools/v16/TestStore/0/testlog.manifest Bestand weergeven


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

@@ -1,25 +0,0 @@
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

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

@@ -1,53 +0,0 @@
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>

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

@@ -1,158 +0,0 @@
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
-}

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

@@ -1,277 +0,0 @@
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
-}

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

@@ -1,123 +0,0 @@
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>

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

@@ -1,263 +0,0 @@
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
-}

+ 0
- 2636
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/CMCgis_Basicfunction.cs
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 0
- 1103
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/ChPLContradiction.cs
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


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

@@ -1,171 +0,0 @@
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
-}

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

@@ -1,352 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,95 +0,0 @@
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
-

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

@@ -1,147 +0,0 @@
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
-}

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

@@ -1,101 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,422 +0,0 @@
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
-}

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

@@ -1,154 +0,0 @@
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
-}

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

@@ -1,113 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,479 +0,0 @@
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
-}

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

@@ -1,173 +0,0 @@
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
-

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

@@ -1,856 +0,0 @@
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
-}

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

@@ -1,244 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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
-}

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

@@ -1,143 +0,0 @@
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>

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

@@ -1,131 +0,0 @@
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
-}

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

@@ -1,76 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,193 +0,0 @@
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
-}

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

@@ -1,150 +0,0 @@
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
-}

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

@@ -1,93 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,149 +0,0 @@
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
-}

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

@@ -1,153 +0,0 @@
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
-}

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

@@ -1,170 +0,0 @@
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
-}

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

@@ -1,101 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,97 +0,0 @@
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
-}

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

@@ -1,38 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,351 +0,0 @@
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
-}

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

@@ -1,398 +0,0 @@
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
-}

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

@@ -1,176 +0,0 @@
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
-}

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

@@ -1,94 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,288 +0,0 @@
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
-

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

@@ -1,124 +0,0 @@
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
-}

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

@@ -1,85 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,71 +0,0 @@
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
-}

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

@@ -1,156 +0,0 @@
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
-}

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

@@ -1,170 +0,0 @@
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
-}

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

@@ -1,100 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,612 +0,0 @@
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
-}

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

@@ -1,114 +0,0 @@
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
-}

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

@@ -1,159 +0,0 @@
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
-}

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

@@ -1,120 +0,0 @@
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>

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

@@ -1,331 +0,0 @@
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>

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

@@ -1,10 +0,0 @@
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
- 126
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.Designer.cs Bestand weergeven

@@ -1,126 +0,0 @@
1
-
2
-namespace HCTools
3
-{
4
-    partial class Hierak
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_CrtLayer = new System.Windows.Forms.ComboBox();
33
-            this.label_CrtLayer = new System.Windows.Forms.Label();
34
-            this.textBox_Gap = new System.Windows.Forms.TextBox();
35
-            this.label_Gap = 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_CrtLayer
41
-            // 
42
-            this.comboBox_CrtLayer.BackColor = System.Drawing.SystemColors.Window;
43
-            this.comboBox_CrtLayer.FormattingEnabled = true;
44
-            this.comboBox_CrtLayer.Location = new System.Drawing.Point(204, 40);
45
-            this.comboBox_CrtLayer.Name = "comboBox_CrtLayer";
46
-            this.comboBox_CrtLayer.Size = new System.Drawing.Size(169, 23);
47
-            this.comboBox_CrtLayer.TabIndex = 7;
48
-            // 
49
-            // label_CrtLayer
50
-            // 
51
-            this.label_CrtLayer.AutoSize = true;
52
-            this.label_CrtLayer.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
53
-            this.label_CrtLayer.Location = new System.Drawing.Point(75, 43);
54
-            this.label_CrtLayer.Name = "label_CrtLayer";
55
-            this.label_CrtLayer.Size = new System.Drawing.Size(112, 15);
56
-            this.label_CrtLayer.TabIndex = 6;
57
-            this.label_CrtLayer.Text = "等高线所在图层";
58
-            // 
59
-            // textBox_Gap
60
-            // 
61
-            this.textBox_Gap.Location = new System.Drawing.Point(204, 97);
62
-            this.textBox_Gap.Name = "textBox_Gap";
63
-            this.textBox_Gap.Size = new System.Drawing.Size(169, 25);
64
-            this.textBox_Gap.TabIndex = 5;
65
-            // 
66
-            // label_Gap
67
-            // 
68
-            this.label_Gap.AutoSize = true;
69
-            this.label_Gap.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
70
-            this.label_Gap.Location = new System.Drawing.Point(135, 100);
71
-            this.label_Gap.Name = "label_Gap";
72
-            this.label_Gap.Size = new System.Drawing.Size(52, 15);
73
-            this.label_Gap.TabIndex = 4;
74
-            this.label_Gap.Text = "等高距";
75
-            // 
76
-            // btn_Cancel
77
-            // 
78
-            this.btn_Cancel.Location = new System.Drawing.Point(283, 149);
79
-            this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4);
80
-            this.btn_Cancel.Name = "btn_Cancel";
81
-            this.btn_Cancel.Size = new System.Drawing.Size(100, 29);
82
-            this.btn_Cancel.TabIndex = 34;
83
-            this.btn_Cancel.Text = "取 消";
84
-            this.btn_Cancel.UseVisualStyleBackColor = true;
85
-            this.btn_Cancel.Click += new System.EventHandler(this.btn_Cancel_Click);
86
-            // 
87
-            // btn_OK
88
-            // 
89
-            this.btn_OK.Location = new System.Drawing.Point(117, 149);
90
-            this.btn_OK.Margin = new System.Windows.Forms.Padding(4);
91
-            this.btn_OK.Name = "btn_OK";
92
-            this.btn_OK.Size = new System.Drawing.Size(100, 29);
93
-            this.btn_OK.TabIndex = 33;
94
-            this.btn_OK.Text = "确 定";
95
-            this.btn_OK.UseVisualStyleBackColor = true;
96
-            this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
97
-            // 
98
-            // Hierak
99
-            // 
100
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
101
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
102
-            this.ClientSize = new System.Drawing.Size(500, 219);
103
-            this.Controls.Add(this.btn_Cancel);
104
-            this.Controls.Add(this.btn_OK);
105
-            this.Controls.Add(this.comboBox_CrtLayer);
106
-            this.Controls.Add(this.label_CrtLayer);
107
-            this.Controls.Add(this.textBox_Gap);
108
-            this.Controls.Add(this.label_Gap);
109
-            this.Name = "Hierak";
110
-            this.Text = "等高线分层";
111
-            this.Load += new System.EventHandler(this.Hierak_Load);
112
-            this.ResumeLayout(false);
113
-            this.PerformLayout();
114
-
115
-        }
116
-
117
-        #endregion
118
-
119
-        private System.Windows.Forms.ComboBox comboBox_CrtLayer;
120
-        private System.Windows.Forms.Label label_CrtLayer;
121
-        private System.Windows.Forms.TextBox textBox_Gap;
122
-        private System.Windows.Forms.Label label_Gap;
123
-        private System.Windows.Forms.Button btn_Cancel;
124
-        private System.Windows.Forms.Button btn_OK;
125
-    }
126
-}

+ 0
- 87
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.cs Bestand weergeven

@@ -1,87 +0,0 @@
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
-
15
-namespace HCTools
16
-{
17
-    public partial class Hierak : Form
18
-    {
19
-        public Hierak()
20
-        {
21
-            InitializeComponent();
22
-        }
23
-
24
-        private void Hierak_Load(object sender, EventArgs e)
25
-        {
26
-            this.comboBox_CrtLayer.DropDownStyle = ComboBoxStyle.DropDownList;
27
-
28
-            this.MaximizeBox = false;
29
-            this.StartPosition = FormStartPosition.CenterScreen;
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.comboBox_CrtLayer.Items.Add(alllayername[i]);
48
-                }
49
-
50
-                if (alllayername.Contains("8110"))
51
-                {
52
-                    int index = alllayername.IndexOf("8110");
53
-                    this.comboBox_CrtLayer.SelectedIndex = index;
54
-                }
55
-                traction.Commit();
56
-            }
57
-        }
58
-
59
-        private void btn_OK_Click(object sender, EventArgs e)
60
-        {
61
-            if (textBox_Gap.Text == "")
62
-            {
63
-                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入等高距");
64
-                return;
65
-            }
66
-
67
-            if (comboBox_CrtLayer.Text == "")
68
-            {
69
-                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择当前等高线所在图层");
70
-                return;
71
-            }
72
-
73
-            Hierarchy.gap = Convert.ToInt32(textBox_Gap.Text.ToString());
74
-            Hierarchy.CrtLayerName = comboBox_CrtLayer.Text;
75
-
76
-
77
-            this.Close();
78
-            Hierarchy hier = new Hierarchy();
79
-            hier.hierarchy();
80
-        }
81
-
82
-        private void btn_Cancel_Click(object sender, EventArgs e)
83
-        {
84
-            this.Close();
85
-        }
86
-    }
87
-}

+ 0
- 0
加密后软件工具/CAD插件工具/源代码/HCTools_latest/HCTools/Hierak.resx Bestand weergeven


Some files were not shown because too many files changed in this diff

Laden…
Annuleren
Opslaan