2 Commits

Author SHA1 Message Date
  qyx a691b6c640 Merge branch 'master' of http://oa.sccehui.com:6101//QYX-RMY/Tools 1 week ago
  qyx 5d3e1cab5a 修改点线矛盾,提升效率 1 week ago
25 changed files with 1126 additions and 26 deletions
  1. BIN
      加密后软件工具/CAD插件工具/Thumbnail_HC/.vs/Thumbnail/v16/.suo
  2. 3
    5
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Thumbnail.csproj
  3. BIN
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  4. BIN
      加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.AssemblyReference.cache
  5. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/.vs/HCTools/v16/.suo
  6. 48
    16
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/CMCgis_Basicfunction.cs
  7. 432
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ChPLConstradiction1.cs
  8. 0
    2
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ChPLContradiction.cs
  9. 10
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/HCTools.csproj
  10. 1
    2
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/MainClass.cs
  11. 177
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PLError_Overlay.cs
  12. 212
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PtLinecontradiction.Designer.cs
  13. 121
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PtLinecontradiction.cs
  14. 120
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PtLinecontradiction.resx
  15. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/Drawing4.dwg
  16. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/Drawing5.dwg
  17. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/HCTools.dll
  18. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/HCTools.pdb
  19. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  20. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.PtLinecontradiction.resources
  21. 1
    1
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.CoreCompileInputs.cache
  22. 1
    0
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.FileListAbsolute.txt
  23. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.GenerateResource.cache
  24. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.dll
  25. BIN
      加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.pdb

BIN
加密后软件工具/CAD插件工具/Thumbnail_HC/.vs/Thumbnail/v16/.suo View File


+ 3
- 5
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/Thumbnail.csproj View File

@@ -32,15 +32,13 @@
32 32
   </PropertyGroup>
33 33
   <ItemGroup>
34 34
     <Reference Include="gmap">
35
-      <HintPath>..\..\..\..\..\2024\04\浩辰\GstarCAD2021_Development_Tool\浩辰CAD2021_grxsdk\inc\gmap.dll</HintPath>
36
-      <Private>False</Private>
35
+      <HintPath>..\..\..\..\..\..\2024\04\浩辰\GstarCAD2021_Development_Tool\浩辰CAD2021_grxsdk\inc\gmap.dll</HintPath>
37 36
     </Reference>
38 37
     <Reference Include="gmdb">
39
-      <HintPath>..\..\..\..\..\2024\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc\gmdb.dll</HintPath>
40
-      <Private>False</Private>
38
+      <HintPath>..\..\..\..\..\..\2024\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc\gmdb.dll</HintPath>
41 39
     </Reference>
42 40
     <Reference Include="GrxCAD.Interop">
43
-      <HintPath>..\..\..\..\..\2024\04\浩辰\GstarCAD2021_Development_Tool\浩辰CAD2021_grxsdk\inc-x64\GrxCAD.Interop.dll</HintPath>
41
+      <HintPath>..\..\..\..\..\..\2024\04\浩辰\GstarCAD2020_Development_Tool\浩辰CAD2020_grxsdk\inc-x64\GrxCAD.Interop.dll</HintPath>
44 42
       <EmbedInteropTypes>True</EmbedInteropTypes>
45 43
     </Reference>
46 44
     <Reference Include="System" />

BIN
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache View File


BIN
加密后软件工具/CAD插件工具/Thumbnail_HC/Thumbnail/obj/Debug/Thumbnail.csproj.AssemblyReference.cache View File


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


+ 48
- 16
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/CMCgis_Basicfunction.cs View File

@@ -1904,8 +1904,12 @@ namespace HCTools
1904 1904
                 yy1 = yy + D22 - D7;
1905 1905
 
1906 1906
                 DBText text7 = new DBText();
1907
-                string value7 = (xx / 1000.0 % 100).ToString("F1");
1908
-                if (value7.Length == 3)
1907
+            string value7 = "";
1908
+            if (BLC != 500)
1909
+                value7 = (xx / 1000.0 % 100).ToString("F1");
1910
+            else
1911
+                value7 = (xx / 1000.0 % 100).ToString("F2");
1912
+            if (value7.Split('.')[0].Length == 1)
1909 1913
                 {
1910 1914
                     value7 = "0" + value7;
1911 1915
                 }
@@ -1961,8 +1965,12 @@ namespace HCTools
1961 1965
                 xx1 = xx - D4_8 * 0.75 * 4 - D1;
1962 1966
                 yy1 = yy + D2;
1963 1967
                 DBText text9 = new DBText();
1964
-                string value9 = (yy / 1000.0 % 100).ToString("F1");
1965
-                if (value9.Length == 3)
1968
+            string value9 = "";
1969
+            if (BLC != 500)
1970
+                value9 = (yy / 1000.0 % 100).ToString("F1");
1971
+            else
1972
+                value9 = (yy / 1000.0 % 100).ToString("F2");
1973
+                if (value9.Split('.')[0].Length == 1)
1966 1974
                 {
1967 1975
                     value9 = "0" + value9;
1968 1976
                 }
@@ -2014,8 +2022,12 @@ namespace HCTools
2014 2022
                 yy1 = yy - D22 + D2;
2015 2023
 
2016 2024
                 DBText text11 = new DBText();
2017
-                string value11 = (xx / 1000.0 % 100).ToString("F1");
2018
-                if (value11.Length == 3)
2025
+            string value11 = "";
2026
+            if (BLC != 500)
2027
+                value11 = (xx / 1000.0 % 100).ToString("F1");
2028
+            else
2029
+                value11 = (xx / 1000.0 % 100).ToString("F2");
2030
+                if (value11.Split('.')[0].Length == 1)
2019 2031
                 {
2020 2032
                     value11 = "0" + value11;
2021 2033
                 }
@@ -2069,8 +2081,12 @@ namespace HCTools
2069 2081
                 xx1 = xx - D4_8 * 0.75 * 4 - D1;
2070 2082
                 yy1 = yy + D2;
2071 2083
                 DBText text13 = new DBText();
2072
-                string value13 = (yy / 1000.0 % 100).ToString("F1");
2073
-                if (value13.Length == 3)
2084
+            string value13 = "";
2085
+            if (BLC != 500)
2086
+                value13 = (yy / 1000.0 % 100).ToString("F1");
2087
+            else
2088
+                value13 = (yy / 1000.0 % 100).ToString("F2");
2089
+                if (value13.Split('.')[0].Length == 1)
2074 2090
                 {
2075 2091
                     value13 = "0" + value13;
2076 2092
                 }
@@ -2123,8 +2139,12 @@ namespace HCTools
2123 2139
                 yy1 = yy + D22 - D7;
2124 2140
 
2125 2141
                 DBText text15 = new DBText();
2126
-                string value15 = (RT.X / 1000.0 % 100).ToString("F1");
2127
-                if (value15.Length == 3)
2142
+            string value15 = "";
2143
+            if (BLC != 500)
2144
+                value15 = (RT.X / 1000.0 % 100).ToString("F1");
2145
+            else
2146
+                value15 = (RT.X / 1000.0 % 100).ToString("F2");
2147
+                if (value15.Split('.')[0].Length == 1)
2128 2148
                 {
2129 2149
                     value15 = "0" + value15;
2130 2150
                 }
@@ -2179,8 +2199,12 @@ namespace HCTools
2179 2199
                 xx1 = xx + D7;
2180 2200
                 yy1 = yy + D2;
2181 2201
                 DBText text17 = new DBText();
2182
-                string value17 = (RT.Y / 1000.0 % 100).ToString("F1");
2183
-                if (value17.Length == 3)
2202
+            string value17 = "";
2203
+            if (BLC != 500)
2204
+                value17 = (RT.Y / 1000.0 % 100).ToString("F1");
2205
+            else
2206
+                value17 = (RT.Y / 1000.0 % 100).ToString("F2");
2207
+                if (value17.Split('.')[0].Length == 1)
2184 2208
                 {
2185 2209
                     value17 = "0" + value17;
2186 2210
                 }
@@ -2230,8 +2254,12 @@ namespace HCTools
2230 2254
                 yy1 = yy - D22 + D2;
2231 2255
 
2232 2256
                 DBText text19 = new DBText();
2233
-                string value19 = (RB.X / 1000.0 % 100).ToString("F1");
2234
-                if (value19.Length == 3)
2257
+            string value19 = "";
2258
+            if (BLC != 500)
2259
+                value19 = (RB.X / 1000.0 % 100).ToString("F1");
2260
+            else
2261
+                value19 = (RB.X / 1000.0 % 100).ToString("F2");
2262
+                if (value19.Split('.')[0].Length == 1)
2235 2263
                 {
2236 2264
                     value19 = "0" + value19;
2237 2265
                 }
@@ -2284,8 +2312,12 @@ namespace HCTools
2284 2312
                 xx1 = xx + D7;
2285 2313
                 yy1 = yy + D2;
2286 2314
                 DBText text21 = new DBText();
2287
-                string value21 = (RB.Y / 1000.0 % 100).ToString("F1");
2288
-                if (value21.Length == 3)
2315
+            string value21 = "";
2316
+            if (BLC != 500)
2317
+                value21 = (RB.Y / 1000.0 % 100).ToString("F1");
2318
+            else
2319
+                value21 = (RB.Y / 1000.0 % 100).ToString("F2");
2320
+                if (value21.Split('.')[0].Length == 1)
2289 2321
                 {
2290 2322
                     value21 = "0" + value21;
2291 2323
                 }

+ 432
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/ChPLConstradiction1.cs View File

@@ -0,0 +1,432 @@
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
+
13
+    // 存储交点和对应等高线的数据结构
14
+    class IntersectionResult
15
+    {
16
+        public Point3dCollection IntersectionPoint { get; set; }
17
+        public Polyline Contour { get; set; }
18
+
19
+    }
20
+    class ChPLContradiction1
21
+    {
22
+        public static int blc;//比例尺
23
+        public static string sqx;//首曲线
24
+        public static string jqx;//计曲线
25
+        public static int dgj;//计曲线
26
+        public static string elevationLayer;//高程点图层名
27
+        int looptimes = 5;//循环查找次数
28
+
29
+        public void Check()
30
+        {
31
+            Editor ed = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
32
+            Database db = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
33
+
34
+            var ptlist = GetPt(ed, db);
35
+            for (int i = 0; i < ptlist.Count; i++)
36
+            {
37
+                BlockReference bf = ptlist[i];
38
+                //为方便搜索操作,将待检查高程点设置为当前视图的中心点,视图高设置为600
39
+                SetWindow(ed, db, bf.Position.X, bf.Position.Y, 600, 600);
40
+                bool contradition = false;
41
+                for (int j = 0; j < looptimes; j++)
42
+                {
43
+                    double searchlength = 50.0 * (looptimes + 1);
44
+                    var searchpl_horizontal = SearchDGX(bf.Position, searchlength, ed, db, 0);
45
+                    var searchpl_vertical = SearchDGX(bf.Position, searchlength, ed, db, 1);
46
+                    List<Polyline> all_pl = new List<Polyline>();
47
+                    all_pl.AddRange(searchpl_horizontal);
48
+                    foreach (var item in searchpl_vertical)
49
+                    {
50
+                        if (all_pl.Contains(item))
51
+                            continue;
52
+                        else
53
+                            all_pl.Add(item);
54
+                    }
55
+                    if (all_pl.Count < 2)
56
+                        continue;
57
+                    contradition = IfContradition(all_pl, bf.Position, searchlength);
58
+                    if (!contradition)
59
+                        break;
60
+                }
61
+                if (contradition)
62
+                {
63
+                    MakeFlag(bf.Position, blc);
64
+
65
+                    Point3d p1 = new Point3d(bf.Position.X - 4 * blc / 2000, bf.Position.Y - 4 * blc / 2000, 0);
66
+                    Point3d p2 = new Point3d(bf.Position.X + 4 * blc / 2000, bf.Position.Y + 4 * blc / 2000, 0);
67
+                    TypedValue[] typedvalue = new TypedValue[2];
68
+
69
+                    typedvalue.SetValue(new TypedValue((int)DxfCode.Start, "Text"), 0);
70
+                    typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, elevationLayer), 1);
71
+
72
+                    SelectionFilter filter = new SelectionFilter(typedvalue);
73
+                    PromptSelectionResult psr = ed.SelectCrossingWindow(p1, p2, filter);
74
+                    List<ObjectId> objs = new List<ObjectId>();
75
+                    if (psr.Status == PromptStatus.OK)
76
+                    {
77
+                        SelectionSet set = psr.Value;
78
+                        objs = set.GetObjectIds().ToList();
79
+                    }
80
+                    using (Transaction tr = db.TransactionManager.StartTransaction())
81
+                    {
82
+                        if (objs.Count > 0)
83
+                        {
84
+                            for (int ii = 0; ii < objs.Count; ii++)
85
+                            {
86
+                                Entity ent = (Entity)tr.GetObject(objs[ii], OpenMode.ForWrite);
87
+                                if (ent is DBText)
88
+                                {
89
+                                    DBText t = (DBText)ent;
90
+                                    double T_Value = Convert.ToDouble(t.TextString);
91
+
92
+                                    if (T_Value == bf.Position.Z)
93
+                                    {
94
+                                        t.Layer = "点线矛盾高程点图层";
95
+
96
+                                    }
97
+                                }
98
+                            }
99
+                        } 
100
+
101
+                        BlockReference blcref = (BlockReference)tr.GetObject(bf.ObjectId, OpenMode.ForWrite);
102
+                        blcref.Layer = "点线矛盾高程点图层";
103
+                        tr.Commit();
104
+                    }
105
+                }
106
+            }
107
+        }
108
+
109
+        //获取所有高程点
110
+        private List<BlockReference> GetPt(Editor ed,Database db)
111
+        {
112
+            List<BlockReference> result = new List<BlockReference>();
113
+
114
+            TypedValue[] typedvalue = new TypedValue[1];
115
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, elevationLayer), 0);
116
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
117
+            PromptSelectionResult psr = ed.SelectAll(selectionfilter);
118
+            if (psr.Status == PromptStatus.OK)
119
+            {
120
+                SelectionSet selectionset = psr.Value;
121
+                ObjectId[] obj = new ObjectId[selectionset.Count];
122
+                obj = selectionset.GetObjectIds();
123
+                for (int i = 0; i < obj.Length; i++)
124
+                {
125
+                    using (Transaction tr = db.TransactionManager.StartTransaction())
126
+                    {
127
+                        ObjectId objid = obj[i];
128
+
129
+                        //找到实体,取高程点的位置
130
+                        Entity entity = (Entity)tr.GetObject(objid, OpenMode.ForWrite);
131
+
132
+                        if (entity is BlockReference)
133
+                        {
134
+                            BlockReference bf = (BlockReference)entity;
135
+                            result.Add(bf);
136
+                        }
137
+                        tr.Commit();
138
+                    }
139
+                }
140
+            }
141
+            return result;
142
+        }
143
+
144
+        //设置当前视图
145
+        private void SetWindow(Editor ed, Database db,double x,double y,double width,double height)
146
+        {
147
+            using (Transaction tr = db.TransactionManager.StartTransaction())
148
+            {
149
+                ViewTableRecord currview = ed.GetCurrentView();
150
+                currview.CenterPoint = new Point2d(x, y);
151
+                currview.ViewDirection = new Vector3d(0, 0, 1);
152
+                currview.Width = width;
153
+                currview.Height = height;
154
+                ed.SetCurrentView(currview);
155
+                tr.Commit();
156
+            }
157
+        }
158
+
159
+        //按垂直或水平方向搜索高程点周围等高线
160
+        private List<Polyline> SearchDGX(Point3d pt,double length,Editor ed, Database db, int direction)
161
+        {
162
+            List<Polyline> result = new List<Polyline>();
163
+            Point3d startpt;
164
+            Point3d endpt;
165
+            if (direction == 0)
166
+            {
167
+                startpt = new Point3d(pt.X - length / 2, pt.Y, pt.Z);
168
+                endpt = new Point3d(pt.X + length / 2, pt.Y, pt.Z);
169
+            }
170
+            else
171
+            {
172
+                startpt = new Point3d(pt.X, pt.Y - length / 2, pt.Z);
173
+                endpt = new Point3d(pt.X, pt.Y + length / 2, pt.Z);
174
+            }
175
+            Point3dCollection ptcoll = new Point3dCollection();
176
+            ptcoll.Add(startpt);
177
+            ptcoll.Add(endpt);
178
+
179
+            TypedValue[] typedvalue = new TypedValue[1];
180
+            typedvalue.SetValue(new TypedValue((int)DxfCode.LayerName, sqx + "," + jqx), 0);
181
+            SelectionFilter selectionfilter = new SelectionFilter(typedvalue);
182
+            PromptSelectionResult psr = ed.SelectFence(ptcoll, selectionfilter);
183
+            if (psr.Status == PromptStatus.OK)
184
+            {
185
+                SelectionSet selectionset = psr.Value;
186
+                ObjectId[] obj = new ObjectId[selectionset.Count];
187
+                obj = selectionset.GetObjectIds();
188
+                for (int i = 0; i < obj.Length; i++)
189
+                {
190
+                    ObjectId objid = obj[i];
191
+                    using (Transaction tr = db.TransactionManager.StartTransaction())
192
+                    {
193
+                        Entity ent = (Entity)tr.GetObject(objid, OpenMode.ForRead);
194
+                        if(ent is Polyline)
195
+                        {
196
+                            //找到实体,取出高程点的x,y,z
197
+                            Polyline pl = (Polyline)ent;
198
+                            result.Add(pl);
199
+                            tr.Commit();
200
+                        }
201
+                    }
202
+                }
203
+            }
204
+            return result;
205
+        }
206
+
207
+        //检查是否有点线矛盾
208
+        private bool IfContradition(List<Polyline> pllist,Point3d pt,double length)
209
+        {
210
+            var result = new List<List<IntersectionResult>>();
211
+
212
+            // 计算平移向量(以pt为基准,移动至原点)
213
+            Vector3d translation = -pt.GetAsVector();
214
+            Matrix3d translateMatrix = Matrix3d.Displacement(translation);
215
+            var pt_moved = pt.TransformBy(translateMatrix);
216
+
217
+            Line searchline1 = new Line(new Point3d(pt_moved.X - length / 2, pt_moved.Y, pt_moved.Z), new Point3d(pt_moved.X + length / 2, pt_moved.Y, pt_moved.Z));
218
+            Line searchline2 = new Line(new Point3d(pt_moved.X, pt_moved.Y - length / 2, pt_moved.Z), new Point3d(pt_moved.X, pt_moved.Y + length / 2, pt_moved.Z));
219
+
220
+
221
+            var horizontal = new List<IntersectionResult>();
222
+            var vertical = new List<IntersectionResult>();
223
+
224
+            foreach (var item in pllist)
225
+            {
226
+                //创建临时副本用于移动等高线,以便进行无误差的相交判断
227
+                Polyline temppl = (Polyline)item.Clone();
228
+
229
+                //应用平移变换
230
+                temppl.TransformBy(translateMatrix);
231
+
232
+                Point3dCollection horizontal_pt = new Point3dCollection();
233
+                Point3dCollection vertical_pt = new Point3dCollection();
234
+                var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
235
+                temppl.IntersectWith(searchline1, Intersect.OnBothOperands, plane, horizontal_pt, IntPtr.Zero, IntPtr.Zero);
236
+                temppl.IntersectWith(searchline2, Intersect.OnBothOperands, plane, vertical_pt, IntPtr.Zero, IntPtr.Zero);
237
+
238
+                Matrix3d inverseMatrix = Matrix3d.Displacement(-translation);
239
+                Point3dCollection horizontal_pt_transformed = new Point3dCollection();
240
+                Point3dCollection vertical_pt_transformed = new Point3dCollection();
241
+                if (horizontal_pt.Count!=0)
242
+                {
243
+                    foreach (Point3d ptitem in horizontal_pt)
244
+                        horizontal_pt_transformed.Add(ptitem.TransformBy(inverseMatrix));
245
+                    horizontal.Add(new IntersectionResult { IntersectionPoint = horizontal_pt_transformed, Contour = item });
246
+                }
247
+                if (vertical_pt.Count != 0)
248
+                {
249
+                    foreach (Point3d ptitem in vertical_pt)
250
+                        vertical_pt_transformed.Add(ptitem.TransformBy(inverseMatrix));
251
+                    vertical.Add(new IntersectionResult { IntersectionPoint = vertical_pt_transformed, Contour = item });
252
+                }
253
+            }
254
+            //根据高程点值判断高程点两边应有的等高线高程值
255
+            var ele1 = Math.Floor(pt.Z / dgj) * dgj;
256
+            var ele2 = ele1 + dgj;
257
+            if (ele1 == pt.Z)
258
+                return true;
259
+            Database db = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
260
+            //搜索是否有相应高程的等高线
261
+            bool hastarget_horizontal = horizontal.Any(item => Math.Round(item.Contour.Elevation - ele1, db.Luprec) == 0) &&
262
+                                        horizontal.Any(item => Math.Round(item.Contour.Elevation - ele2, db.Luprec) == 0);
263
+            bool hastarget_vertical = vertical.Any(item => Math.Round(item.Contour.Elevation - ele1, db.Luprec) == 0)&&
264
+                                      vertical.Any(item => Math.Round(item.Contour.Elevation - ele2, db.Luprec) == 0);
265
+
266
+            //如果有,则判断高程点是否在两线之间,
267
+            //没有的话再判断高程点是否是根据等高线变化趋势变化
268
+            if (hastarget_horizontal)
269
+            {
270
+                var pl1 = horizontal.FindAll(item => Math.Round(item.Contour.Elevation - ele1, db.Luprec) == 0).ToList();
271
+                var pl2 = horizontal.FindAll(item => Math.Round(item.Contour.Elevation - ele2, db.Luprec) == 0).ToList();
272
+                for (int i = 0; i < pl1.Count; i++)
273
+                {
274
+                    Vector3d vec1;
275
+                    foreach (Point3d item1 in pl1[i].IntersectionPoint)
276
+                    {
277
+                        vec1 = (pt - item1).GetNormal();
278
+                        for (int ii = 0; ii < pl2.Count; ii++)
279
+                        {
280
+                            foreach (Point3d item2 in pl2[ii].IntersectionPoint)
281
+                            {
282
+                                var dot = (pt - item2).GetNormal().DotProduct(vec1);
283
+                                if (dot <= 0)
284
+                                    return false;
285
+                            }
286
+                        }
287
+                    }
288
+                }
289
+            }
290
+            if (hastarget_vertical)
291
+            {
292
+                var pl1 = vertical.FindAll(item => Math.Round(item.Contour.Elevation - ele1, db.Luprec) == 0).ToList();
293
+                var pl2 = vertical.FindAll(item => Math.Round(item.Contour.Elevation - ele2, db.Luprec) == 0).ToList();
294
+                for (int i = 0; i < pl1.Count; i++)
295
+                {
296
+                    Vector3d vec1;
297
+                    foreach (Point3d item1 in pl1[i].IntersectionPoint)
298
+                    {
299
+                        vec1 = (pt - item1).GetNormal();
300
+                        for (int ii = 0; ii < pl2.Count; ii++)
301
+                        {
302
+                            foreach (Point3d item2 in pl2[ii].IntersectionPoint)
303
+                            {
304
+                                var dot = (pt - item2).GetNormal().DotProduct(vec1);
305
+                                if (dot <= 0)
306
+                                    return false;
307
+                            }
308
+                        }
309
+                    }
310
+                }
311
+            }
312
+            else
313
+            {
314
+                //只有对应方向上的多段线数量足以判断方向才进行下一步
315
+                if (horizontal.Count >= 2)
316
+                {
317
+                    List<Point3d> pts = new List<Point3d>();
318
+                    foreach (var item in horizontal)
319
+                    {
320
+                        foreach (Point3d p in item.IntersectionPoint)
321
+                        {
322
+                            pts.Add(p);
323
+                        }
324
+                    }
325
+                    var pts_sorted = pts.OrderBy(p => p.DistanceTo(pt));
326
+                    Point3d point = new Point3d();
327
+                    Polyline pl = new Polyline();
328
+                    foreach (var item in pts_sorted)
329
+                    {
330
+                        if (point == new Point3d())
331
+                        {
332
+                            point = item;
333
+                            pl = horizontal.Find(p => p.IntersectionPoint.Contains(item)).Contour;
334
+                        }
335
+                        else
336
+                        {
337
+                            //如果下一个点所在多段线不是这个点所在的多段线且高程不同,判断高程点变化方向是否一致
338
+                            if (horizontal.Find(p => p.IntersectionPoint.Contains(item)).Contour != pl &&
339
+                                horizontal.Find(p => p.IntersectionPoint.Contains(item)).Contour.Elevation != pl.Elevation)
340
+                            {
341
+                                var direction = point.Z - item.Z;
342
+                                if (pt.Z - point.Z < 0 && direction < 0 ||
343
+                                    pt.Z - point.Z > 0 && direction > 0)
344
+                                    return false;
345
+                            }
346
+                            else
347
+                                point = item;
348
+                        }
349
+                    }
350
+                }
351
+                if (vertical.Count >= 2)
352
+                {
353
+                    List<Point3d> pts = new List<Point3d>();
354
+                    foreach (var item in vertical)
355
+                    {
356
+                        foreach (Point3d p in item.IntersectionPoint)
357
+                        {
358
+                            pts.Add(p);
359
+                        }
360
+                    }
361
+                    var pts_sorted = pts.OrderBy(p => p.DistanceTo(pt));
362
+                    Point3d point = new Point3d();
363
+                    Polyline pl = new Polyline();
364
+                    foreach (var item in pts_sorted)
365
+                    {
366
+                        if (point == new Point3d())
367
+                        {
368
+                            point = item;
369
+                            pl = vertical.Find(p => p.IntersectionPoint.Contains(item)).Contour;
370
+                        }
371
+                        else
372
+                        {
373
+                            if (vertical.Find(p => p.IntersectionPoint.Contains(item)).Contour != pl)
374
+                            {
375
+                                var direction = point.Z - item.Z;
376
+                                if (pt.Z - point.Z < 0 && direction < 0 ||
377
+                                    pt.Z - point.Z > 0 && direction > 0)
378
+                                    return false;
379
+                            }
380
+                            else
381
+                                point = item;
382
+                        }
383
+                    }
384
+                }
385
+            }
386
+            return true;
387
+        }
388
+
389
+        //标记错误点
390
+        private void MakeFlag(Point3d pt,int blc)
391
+        {
392
+            double flagradius = 4.0 * blc / 1000;//根据比例尺画圆标记半径
393
+
394
+            LayerControl layerscontrol = new LayerControl();
395
+            string layname = "点线矛盾标记图层";
396
+            if (layerscontrol.haslayername(layname) == false)
397
+            {
398
+                colorgb col = new colorgb(255, 0, 0);
399
+                layerscontrol.creatlayer(layname, col);
400
+            }
401
+            layname = "点线矛盾高程点图层";
402
+            if (layerscontrol.haslayername(layname) == false)
403
+            {
404
+                colorgb col = new colorgb(255, 255, 0);
405
+                layerscontrol.creatlayer(layname, col);
406
+                layerscontrol.movelayertofront(layname);
407
+            }
408
+
409
+            Database db = HostApplicationServices.WorkingDatabase;
410
+            //DocumentLock doclock = GrxCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
411
+            using (Transaction traction = db.TransactionManager.StartTransaction())
412
+            { 
413
+                BlockTable blocktable= traction.GetObject(db.BlockTableId, OpenMode.ForWrite) as BlockTable;
414
+                BlockTableRecord blocktablerecord = traction.GetObject(blocktable[BlockTableRecord.ModelSpace],
415
+                                                OpenMode.ForWrite) as BlockTableRecord;
416
+                Circle circ = new Circle();
417
+                circ.Layer = "点线矛盾标记图层";
418
+
419
+                circ.Center = pt;
420
+                circ.Radius = flagradius;
421
+                circ.Normal = new Vector3d(0, 0, 1);
422
+                circ.SetDatabaseDefaults();
423
+                blocktablerecord.AppendEntity(circ);
424
+                traction.AddNewlyCreatedDBObject(circ, true);
425
+                traction.Commit();
426
+            
427
+                traction.Dispose();
428
+            }
429
+            //doclock.Dispose();
430
+        }
431
+    }
432
+}

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

@@ -563,8 +563,6 @@ namespace HCTools
563 563
 
564 564
         }
565 565
 
566
-
567
-
568 566
         /// <summary>
569 567
         /// 比较高程点值和该高程点左右等高线高程
570 568
         /// </summary>

+ 10
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/HCTools.csproj View File

@@ -239,6 +239,7 @@
239 239
       <DependentUpon>CheckL.cs</DependentUpon>
240 240
     </Compile>
241 241
     <Compile Include="CheckPLOverlay.cs" />
242
+    <Compile Include="ChPLConstradiction1.cs" />
242 243
     <Compile Include="ChPLContradiction.cs" />
243 244
     <Compile Include="CMCgis_Basicfunction.cs" />
244 245
     <Compile Include="Conn.cs">
@@ -381,6 +382,12 @@
381 382
     <Compile Include="PtCheck.Designer.cs">
382 383
       <DependentUpon>PtCheck.cs</DependentUpon>
383 384
     </Compile>
385
+    <Compile Include="PtLinecontradiction.cs">
386
+      <SubType>Form</SubType>
387
+    </Compile>
388
+    <Compile Include="PtLinecontradiction.Designer.cs">
389
+      <DependentUpon>PtLinecontradiction.cs</DependentUpon>
390
+    </Compile>
384 391
     <Compile Include="Scale.cs">
385 392
       <SubType>Form</SubType>
386 393
     </Compile>
@@ -479,6 +486,9 @@
479 486
     <EmbeddedResource Include="PtCheck.resx">
480 487
       <DependentUpon>PtCheck.cs</DependentUpon>
481 488
     </EmbeddedResource>
489
+    <EmbeddedResource Include="PtLinecontradiction.resx">
490
+      <DependentUpon>PtLinecontradiction.cs</DependentUpon>
491
+    </EmbeddedResource>
482 492
     <EmbeddedResource Include="Scale.resx">
483 493
       <DependentUpon>Scale.cs</DependentUpon>
484 494
     </EmbeddedResource>

+ 1
- 2
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/MainClass.cs View File

@@ -196,8 +196,7 @@ namespace HCTools
196 196
             Verify();
197 197
             if (num == 1)
198 198
             {
199
-                Flag = "PLError";
200
-                PLError_Overlay pl = new PLError_Overlay();
199
+                PtLinecontradiction pl = new PtLinecontradiction();
201 200
                 pl.Show();
202 201
                 //Parameters Frm = new Parameters();
203 202
                 //Frm.Show();

+ 177
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PLError_Overlay.cs View File

@@ -0,0 +1,177 @@
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
+using GrxCAD.EditorInput;
11
+using GrxCAD.DatabaseServices;
12
+using GrxCAD.Geometry;
13
+
14
+namespace HCTools
15
+{
16
+    public partial class PLError_Overlay : Form
17
+    {
18
+        public PLError_Overlay()
19
+        {
20
+            InitializeComponent();
21
+        }
22
+
23
+        private void PLError_Load(object sender, EventArgs e)
24
+        {
25
+            //if (MainClass.Flag == "PLError" )
26
+            //{
27
+            //    this.Text = "点线矛盾";
28
+            //}
29
+            if (MainClass.Flag == "PLOverlap")
30
+            {
31
+                this.Text = "点线重叠";
32
+            }
33
+            this.comboBox_ElePoint.DropDownStyle = ComboBoxStyle.DropDownList;
34
+            this.comboBox_blc.DropDownStyle = ComboBoxStyle.DropDownList;
35
+            this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList;
36
+            this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList;
37
+
38
+            //this.MaximizeBox = false;
39
+            //this.StartPosition = FormStartPosition.CenterScreen;
40
+
41
+
42
+            //参数清零
43
+            //CheckPLOverlay.EleLayerName = null;
44
+            //CheckPLOverlay.sqx = null;
45
+            //CheckPLOverlay.jqx = null;
46
+            //CheckPLOverlay.blc = 0;
47
+
48
+
49
+            //自动填充下拉框
50
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
51
+            using (Transaction traction = database.TransactionManager.StartTransaction())
52
+            {
53
+                //存放所有图层名
54
+                List<string> alllayername = new List<string>();
55
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
56
+                foreach (ObjectId objid in layertable)
57
+                {
58
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
59
+                    alllayername.Add(layertablerecord.Name);
60
+                }
61
+                alllayername.Sort();
62
+
63
+                for (int i = 0; i < alllayername.Count; i++)
64
+                {
65
+                    this.comboBox_ElePoint.Items.Add(alllayername[i]);
66
+                    this.comboBox_sqx.Items.Add(alllayername[i]);
67
+                    this.comboBox_jqx.Items.Add(alllayername[i]);
68
+                }
69
+
70
+                if (alllayername.Contains("8300"))
71
+                {
72
+                    int index = alllayername.IndexOf("8300");
73
+                    this.comboBox_ElePoint.SelectedIndex = index;
74
+                }
75
+                if (alllayername.Contains("8110"))
76
+                {
77
+                    int index = alllayername.IndexOf("8110");
78
+                    this.comboBox_sqx.SelectedIndex = index;
79
+                }
80
+                if (alllayername.Contains("8120"))
81
+                {
82
+                    int index = alllayername.IndexOf("8120");
83
+                    this.comboBox_jqx.SelectedIndex = index;
84
+                }
85
+                traction.Commit();
86
+            }
87
+        }
88
+
89
+        private void btn_OK_Click(object sender, EventArgs e)
90
+        {
91
+            if (MainClass.Flag == "PLOverlap")
92
+            {
93
+                if (comboBox_ElePoint.Text == "")
94
+                {
95
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层");
96
+                    return;
97
+                }
98
+                if (comboBox_blc.Text == "")
99
+                {
100
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
101
+                    return;
102
+                }
103
+                if (comboBox_sqx.Text == "")
104
+                {
105
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层");
106
+                    return;
107
+                }
108
+                if (comboBox_jqx.Text == "")
109
+                {
110
+                    GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层");
111
+                    return;
112
+                }
113
+
114
+                CheckPLOverlay.EleLayerName = comboBox_ElePoint.Text;
115
+                CheckPLOverlay.sqx = comboBox_sqx.Text;
116
+                CheckPLOverlay.jqx = comboBox_jqx.Text;
117
+
118
+                //比例尺
119
+                string blctext = comboBox_blc.Text;
120
+                int blcindex = blctext.LastIndexOf(':');
121
+                string strblc = blctext.Substring(blcindex + 1);
122
+                CheckPLOverlay.blc = Convert.ToInt32(strblc);
123
+
124
+                this.Close();
125
+                CheckPLOverlay plcon = new CheckPLOverlay();
126
+                plcon.contourch();
127
+            }
128
+
129
+            //if (MainClass.Flag == "PLError")
130
+            //{
131
+
132
+            //    if (comboBox_ElePoint.Text == "")
133
+            //    {
134
+            //        GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层");
135
+            //        return;
136
+            //    }
137
+            //    if (comboBox_blc.Text == "")
138
+            //    {
139
+            //        GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
140
+            //        return;
141
+            //    }
142
+            //    if (comboBox_sqx.Text == "")
143
+            //    {
144
+            //        GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层");
145
+            //        return;
146
+            //    }
147
+            //    if (comboBox_jqx.Text == "")
148
+            //    {
149
+            //        GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层");
150
+            //        return;
151
+            //    }
152
+
153
+            //    ChPLContradiction1.elevationLayer = comboBox_ElePoint.Text;
154
+            //    ChPLContradiction1.sqx = comboBox_sqx.Text;
155
+            //    ChPLContradiction1.jqx = comboBox_jqx.Text;
156
+
157
+
158
+            //    //比例尺
159
+            //    string blctext = comboBox_blc.Text;
160
+            //    int blcindex = blctext.LastIndexOf(':');
161
+            //    string strblc = blctext.Substring(blcindex + 1);
162
+            //    int rade = Convert.ToInt32(strblc);
163
+            //    ChPLContradiction1.blc = rade;
164
+
165
+            //    this.Close();
166
+            //    //ChPLContradiction chplc = new ChPLContradiction();
167
+            //    ChPLContradiction1 chplc = new ChPLContradiction1();
168
+            //    chplc.Check();
169
+            //}
170
+        }
171
+
172
+        private void btn_Cancel_Click(object sender, EventArgs e)
173
+        {
174
+            this.Close();
175
+        }
176
+    }
177
+}

+ 212
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PtLinecontradiction.Designer.cs View File

@@ -0,0 +1,212 @@
1
+
2
+namespace HCTools
3
+{
4
+    partial class PtLinecontradiction
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_Cancel = new System.Windows.Forms.Button();
33
+            this.btn_OK = new System.Windows.Forms.Button();
34
+            this.label_ElePoint = new System.Windows.Forms.Label();
35
+            this.comboBox_blc = new System.Windows.Forms.ComboBox();
36
+            this.label_Jqx = new System.Windows.Forms.Label();
37
+            this.label_Blc = new System.Windows.Forms.Label();
38
+            this.comboBox_ElePoint = new System.Windows.Forms.ComboBox();
39
+            this.comboBox_jqx = new System.Windows.Forms.ComboBox();
40
+            this.comboBox_sqx = new System.Windows.Forms.ComboBox();
41
+            this.label_Sqx = new System.Windows.Forms.Label();
42
+            this.label1 = new System.Windows.Forms.Label();
43
+            this.textBox_dgj = new System.Windows.Forms.TextBox();
44
+            this.SuspendLayout();
45
+            // 
46
+            // btn_Cancel
47
+            // 
48
+            this.btn_Cancel.Location = new System.Drawing.Point(273, 298);
49
+            this.btn_Cancel.Margin = new System.Windows.Forms.Padding(4);
50
+            this.btn_Cancel.Name = "btn_Cancel";
51
+            this.btn_Cancel.Size = new System.Drawing.Size(100, 29);
52
+            this.btn_Cancel.TabIndex = 71;
53
+            this.btn_Cancel.Text = "取 消";
54
+            this.btn_Cancel.UseVisualStyleBackColor = true;
55
+            this.btn_Cancel.Click += new System.EventHandler(this.btn_Cancel_Click);
56
+            // 
57
+            // btn_OK
58
+            // 
59
+            this.btn_OK.Location = new System.Drawing.Point(130, 298);
60
+            this.btn_OK.Margin = new System.Windows.Forms.Padding(4);
61
+            this.btn_OK.Name = "btn_OK";
62
+            this.btn_OK.Size = new System.Drawing.Size(100, 29);
63
+            this.btn_OK.TabIndex = 70;
64
+            this.btn_OK.Text = "确 定";
65
+            this.btn_OK.UseVisualStyleBackColor = true;
66
+            this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
67
+            // 
68
+            // label_ElePoint
69
+            // 
70
+            this.label_ElePoint.AutoSize = true;
71
+            this.label_ElePoint.Location = new System.Drawing.Point(79, 28);
72
+            this.label_ElePoint.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
73
+            this.label_ElePoint.Name = "label_ElePoint";
74
+            this.label_ElePoint.Size = new System.Drawing.Size(150, 15);
75
+            this.label_ElePoint.TabIndex = 62;
76
+            this.label_ElePoint.Text = "高程点所在图层选择:";
77
+            // 
78
+            // comboBox_blc
79
+            // 
80
+            this.comboBox_blc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
81
+            this.comboBox_blc.FormattingEnabled = true;
82
+            this.comboBox_blc.Items.AddRange(new object[] {
83
+            "1:500",
84
+            "1:1000",
85
+            "1:2000",
86
+            "1:5000"});
87
+            this.comboBox_blc.Location = new System.Drawing.Point(248, 193);
88
+            this.comboBox_blc.Margin = new System.Windows.Forms.Padding(4);
89
+            this.comboBox_blc.Name = "comboBox_blc";
90
+            this.comboBox_blc.Size = new System.Drawing.Size(161, 23);
91
+            this.comboBox_blc.TabIndex = 69;
92
+            // 
93
+            // label_Jqx
94
+            // 
95
+            this.label_Jqx.AutoSize = true;
96
+            this.label_Jqx.Location = new System.Drawing.Point(79, 143);
97
+            this.label_Jqx.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
98
+            this.label_Jqx.Name = "label_Jqx";
99
+            this.label_Jqx.Size = new System.Drawing.Size(150, 15);
100
+            this.label_Jqx.TabIndex = 66;
101
+            this.label_Jqx.Text = "计曲线所在图层选择:";
102
+            // 
103
+            // label_Blc
104
+            // 
105
+            this.label_Blc.AutoSize = true;
106
+            this.label_Blc.Location = new System.Drawing.Point(139, 201);
107
+            this.label_Blc.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
108
+            this.label_Blc.Name = "label_Blc";
109
+            this.label_Blc.Size = new System.Drawing.Size(90, 15);
110
+            this.label_Blc.TabIndex = 68;
111
+            this.label_Blc.Text = "比例尺选择:";
112
+            // 
113
+            // comboBox_ElePoint
114
+            // 
115
+            this.comboBox_ElePoint.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
116
+            this.comboBox_ElePoint.FormattingEnabled = true;
117
+            this.comboBox_ElePoint.Location = new System.Drawing.Point(248, 25);
118
+            this.comboBox_ElePoint.Margin = new System.Windows.Forms.Padding(4);
119
+            this.comboBox_ElePoint.MaxDropDownItems = 30;
120
+            this.comboBox_ElePoint.Name = "comboBox_ElePoint";
121
+            this.comboBox_ElePoint.Size = new System.Drawing.Size(161, 23);
122
+            this.comboBox_ElePoint.TabIndex = 63;
123
+            // 
124
+            // comboBox_jqx
125
+            // 
126
+            this.comboBox_jqx.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
127
+            this.comboBox_jqx.FormattingEnabled = true;
128
+            this.comboBox_jqx.Location = new System.Drawing.Point(248, 135);
129
+            this.comboBox_jqx.Margin = new System.Windows.Forms.Padding(4);
130
+            this.comboBox_jqx.MaxDropDownItems = 30;
131
+            this.comboBox_jqx.Name = "comboBox_jqx";
132
+            this.comboBox_jqx.Size = new System.Drawing.Size(161, 23);
133
+            this.comboBox_jqx.TabIndex = 67;
134
+            // 
135
+            // comboBox_sqx
136
+            // 
137
+            this.comboBox_sqx.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
138
+            this.comboBox_sqx.FormattingEnabled = true;
139
+            this.comboBox_sqx.Location = new System.Drawing.Point(248, 78);
140
+            this.comboBox_sqx.Margin = new System.Windows.Forms.Padding(4);
141
+            this.comboBox_sqx.MaxDropDownItems = 30;
142
+            this.comboBox_sqx.Name = "comboBox_sqx";
143
+            this.comboBox_sqx.Size = new System.Drawing.Size(161, 23);
144
+            this.comboBox_sqx.TabIndex = 65;
145
+            // 
146
+            // label_Sqx
147
+            // 
148
+            this.label_Sqx.AutoSize = true;
149
+            this.label_Sqx.Location = new System.Drawing.Point(79, 86);
150
+            this.label_Sqx.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
151
+            this.label_Sqx.Name = "label_Sqx";
152
+            this.label_Sqx.Size = new System.Drawing.Size(150, 15);
153
+            this.label_Sqx.TabIndex = 64;
154
+            this.label_Sqx.Text = "首曲线所在图层选择:";
155
+            // 
156
+            // label1
157
+            // 
158
+            this.label1.AutoSize = true;
159
+            this.label1.Location = new System.Drawing.Point(162, 255);
160
+            this.label1.Name = "label1";
161
+            this.label1.Size = new System.Drawing.Size(67, 15);
162
+            this.label1.TabIndex = 72;
163
+            this.label1.Text = "等高距:";
164
+            // 
165
+            // textBox_dgj
166
+            // 
167
+            this.textBox_dgj.Location = new System.Drawing.Point(248, 245);
168
+            this.textBox_dgj.Name = "textBox_dgj";
169
+            this.textBox_dgj.Size = new System.Drawing.Size(100, 25);
170
+            this.textBox_dgj.TabIndex = 73;
171
+            // 
172
+            // PtLinecontradiction
173
+            // 
174
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
175
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
176
+            this.ClientSize = new System.Drawing.Size(520, 353);
177
+            this.Controls.Add(this.textBox_dgj);
178
+            this.Controls.Add(this.label1);
179
+            this.Controls.Add(this.btn_Cancel);
180
+            this.Controls.Add(this.btn_OK);
181
+            this.Controls.Add(this.label_ElePoint);
182
+            this.Controls.Add(this.comboBox_blc);
183
+            this.Controls.Add(this.label_Jqx);
184
+            this.Controls.Add(this.label_Blc);
185
+            this.Controls.Add(this.comboBox_ElePoint);
186
+            this.Controls.Add(this.comboBox_jqx);
187
+            this.Controls.Add(this.comboBox_sqx);
188
+            this.Controls.Add(this.label_Sqx);
189
+            this.Name = "PtLinecontradiction";
190
+            this.Text = "点线矛盾";
191
+            this.Load += new System.EventHandler(this.PtLinecontradiction_Load);
192
+            this.ResumeLayout(false);
193
+            this.PerformLayout();
194
+
195
+        }
196
+
197
+        #endregion
198
+
199
+        private System.Windows.Forms.Button btn_Cancel;
200
+        private System.Windows.Forms.Button btn_OK;
201
+        private System.Windows.Forms.Label label_ElePoint;
202
+        private System.Windows.Forms.ComboBox comboBox_blc;
203
+        private System.Windows.Forms.Label label_Jqx;
204
+        private System.Windows.Forms.Label label_Blc;
205
+        private System.Windows.Forms.ComboBox comboBox_ElePoint;
206
+        private System.Windows.Forms.ComboBox comboBox_jqx;
207
+        private System.Windows.Forms.ComboBox comboBox_sqx;
208
+        private System.Windows.Forms.Label label_Sqx;
209
+        private System.Windows.Forms.Label label1;
210
+        private System.Windows.Forms.TextBox textBox_dgj;
211
+    }
212
+}

+ 121
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PtLinecontradiction.cs View File

@@ -0,0 +1,121 @@
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 PtLinecontradiction : Form
15
+    {
16
+        public PtLinecontradiction()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+
21
+        private void PtLinecontradiction_Load(object sender, EventArgs e)
22
+        {
23
+            //自动填充下拉框
24
+            Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
25
+            using (Transaction traction = database.TransactionManager.StartTransaction())
26
+            {
27
+                //存放所有图层名
28
+                List<string> alllayername = new List<string>();
29
+                LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
30
+                foreach (ObjectId objid in layertable)
31
+                {
32
+                    LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
33
+                    alllayername.Add(layertablerecord.Name);
34
+                }
35
+                alllayername.Sort();
36
+
37
+                for (int i = 0; i < alllayername.Count; i++)
38
+                {
39
+                    this.comboBox_ElePoint.Items.Add(alllayername[i]);
40
+                    this.comboBox_sqx.Items.Add(alllayername[i]);
41
+                    this.comboBox_jqx.Items.Add(alllayername[i]);
42
+                }
43
+
44
+                if (alllayername.Contains("8300"))
45
+                {
46
+                    int index = alllayername.IndexOf("8300");
47
+                    this.comboBox_ElePoint.SelectedIndex = index;
48
+                }
49
+                if (alllayername.Contains("8110"))
50
+                {
51
+                    int index = alllayername.IndexOf("8110");
52
+                    this.comboBox_sqx.SelectedIndex = index;
53
+                }
54
+                if (alllayername.Contains("8120"))
55
+                {
56
+                    int index = alllayername.IndexOf("8120");
57
+                    this.comboBox_jqx.SelectedIndex = index;
58
+                }
59
+                traction.Commit();
60
+            }
61
+        }
62
+
63
+        private void btn_OK_Click(object sender, EventArgs e)
64
+        {
65
+            if (comboBox_ElePoint.Text == "")
66
+            {
67
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层");
68
+                return;
69
+            }
70
+            if (comboBox_blc.Text == "")
71
+            {
72
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
73
+                return;
74
+            }
75
+            if (comboBox_sqx.Text == "")
76
+            {
77
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层");
78
+                return;
79
+            }
80
+            if (comboBox_jqx.Text == "")
81
+            {
82
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层");
83
+                return;
84
+            }
85
+            if (string.IsNullOrWhiteSpace(textBox_dgj.Text))
86
+            {
87
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("请输入等高距");
88
+                return;
89
+            }
90
+            double.TryParse(textBox_dgj.Text, out double number);
91
+            if (number <= 0)
92
+            {
93
+                GrxCAD.ApplicationServices.Application.ShowAlertDialog("等高距不能为0或负数");
94
+                return;
95
+            }
96
+
97
+            ChPLContradiction1.elevationLayer = comboBox_ElePoint.Text;
98
+            ChPLContradiction1.sqx = comboBox_sqx.Text;
99
+            ChPLContradiction1.jqx = comboBox_jqx.Text;
100
+            ChPLContradiction1.dgj = Convert.ToInt32(textBox_dgj.Text.Trim());
101
+
102
+
103
+            //比例尺
104
+            string blctext = comboBox_blc.Text;
105
+            int blcindex = blctext.LastIndexOf(':');
106
+            string strblc = blctext.Substring(blcindex + 1);
107
+            int intblc = Convert.ToInt32(strblc);
108
+            ChPLContradiction1.blc = intblc;
109
+
110
+            ChPLContradiction1 chplc = new ChPLContradiction1();
111
+            chplc.Check();
112
+            this.Close();
113
+            MessageBox.Show("点线矛盾检查完成。");
114
+        }
115
+
116
+        private void btn_Cancel_Click(object sender, EventArgs e)
117
+        {
118
+            this.Close();
119
+        }
120
+    }
121
+}

+ 120
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/PtLinecontradiction.resx View File

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

BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/Drawing4.dwg View File


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/bin/Debug/Drawing5.dwg View File


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


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


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


BIN
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.PtLinecontradiction.resources View File


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

@@ -1 +1 @@
1
-defc702ded8a5bfc193098f71b42f0236d0c46d3
1
+f6ce5b89e9e52977c869c2a1f0489f8609d73c8f

+ 1
- 0
加密后软件工具/CAD插件工具/源代码/HCTools/HCTools/obj/Debug/HCTools.csproj.FileListAbsolute.txt View File

@@ -111,3 +111,4 @@ F:\daima\Tools\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\o
111 111
 F:\daima\Tools\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.csproj.CopyComplete
112 112
 F:\daima\Tools\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.dll
113 113
 F:\daima\Tools\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.pdb
114
+F:\daima\Tools\加密后软件工具\CAD插件工具\源代码\HCTools\HCTools\obj\Debug\HCTools.PtLinecontradiction.resources

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


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


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


Loading…
Cancel
Save