*BIMFACE二次开发系列目录 【已更新最新开发文章,点击查看详细】*
在前两篇博客《C#开发BIMFACE系列42 服务端API之图纸对比》、《C#开发BIMFACE系列43 服务端API之图纸拆分》中介绍了单文件多图框的拆分与对比
本文将详细讲解如何计算图纸对比差异项来源自哪个图框。
以控制台中的2张图纸【建筑图纸1-已拆分.dwg】 与 【建筑图纸2-已拆分-已变更.dwg】为例
对比结果参考上面第2个动态图。
获取图纸对比结果API
调用BIMFACE服务端接口
1 ///
4 /// 【必填】令牌
5 /// 【必填】对比ID
6 /// 页码(提示:私有云部署不支持分页查询)。如果不传参数,则默认为1
7 /// 每页记录数(提示:私有云部署不支持分页查询)。如果不传参数,则默认为50
8 ///
9 public virtual DrawingCompareDiffResponse GetDrawingCompareDiff(string accessToken, long compareId, int? page = null, int? pageSize = null)
10 {
11 // GET https://api.bimface.com/data/v2/comparisons/{comparisonId}/diff
12 string url = string.Format(BIMFaceConstants.API_HOST + "/data/v2/comparisons/{0}/drawingdiff?v=1", compareId);
13 if (page.HasValue)
14 {
15 if (page.Value <= 1)
16 {
17 page = 1;
18 }
19
20 url += "&page=" + page;
21 }
22
23 if (pageSize.HasValue)
24 {
25 if (pageSize.Value <= 0)
26 {
27 pageSize = 50;
28 }
29
30 url += "&pageSize=" + pageSize;
31 }
32
33 BIMFaceHttpHeaders headers = new BIMFaceHttpHeaders();
34 headers.AddOAuth2Header(accessToken);
35
36 try
37 {
38 DrawingCompareDiffResponse response;
39
40 HttpManager httpManager = new HttpManager(headers);
41 HttpResult httpResult = httpManager.Get(url);
42 if (httpResult.Status == HttpResult.STATUS_SUCCESS)
43 {
44 response = httpResult.Text.DeserializeJsonToObject
45 }
46 else
47 {
48 response = new DrawingCompareDiffResponse
49 {
50 Message = httpResult.RefText
51 };
52 }
53
54 return response;
55 }
56 catch (Exception ex)
57 {
58 throw new BIMFaceException("[分页获取图纸对比结果]发生异常!", ex);
59 }
60 }
完整的对比差异项纪录信息如下:
1 {
2 "code": "success",
3 "message": null,
4 "data": {
5 "data": [
6 {
7 "diffType": "NEW",
8 "id": "1946877",
9 "layer": "D1",
10 "sheetId": "0",
11 "sheetName": "Model",
12 "type": "Model"
13 },
14 {
15 "diffType": "NEW",
16 "id": "1946878",
17 "layer": "D1",
18 "sheetId": "0",
19 "sheetName": "Model",
20 "type": "Model"
21 },
22 {
23 "diffType": "DELETE",
24 "id": "122566",
25 "layer": "D1",
26 "sheetId": "0",
27 "sheetName": "Model",
28 "type": "Model"
29 },
30 {
31 "diffType": "CHANGE",
32 "id": "104778",
33 "layer": "0",
34 "sheetId": "0",
35 "sheetName": "Model",
36 "type": "Model"
37 },
38 {
39 "diffType": "CHANGE",
40 "id": "104779",
41 "layer": "0",
42 "sheetId": "0",
43 "sheetName": "Model",
44 "type": "Model"
45 },
46 {
47 "diffType": "CHANGE",
48 "id": "104780",
49 "layer": "0",
50 "sheetId": "0",
51 "sheetName": "Model",
52 "type": "Model"
53 },
54 {
55 "diffType": "CHANGE",
56 "id": "104781",
57 "layer": "0",
58 "sheetId": "0",
59 "sheetName": "Model",
60 "type": "Model"
61 },
62 {
63 "diffType": "CHANGE",
64 "id": "104782",
65 "layer": "0",
66 "sheetId": "0",
67 "sheetName": "Model",
68 "type": "Model"
69 },
70 {
71 "diffType": "CHANGE",
72 "id": "104783",
73 "layer": "0",
74 "sheetId": "0",
75 "sheetName": "Model",
76 "type": "Model"
77 },
78 {
79 "diffType": "CHANGE",
80 "id": "104784",
81 "layer": "0",
82 "sheetId": "0",
83 "sheetName": "Model",
84 "type": "Model"
85 },
86 {
87 "diffType": "CHANGE",
88 "id": "104785",
89 "layer": "0",
90 "sheetId": "0",
91 "sheetName": "Model",
92 "type": "Model"
93 },
94 {
95 "diffType": "CHANGE",
96 "id": "104786",
97 "layer": "0",
98 "sheetId": "0",
99 "sheetName": "Model",
100 "type": "Model"
101 },
102 {
103 "diffType": "CHANGE",
104 "id": "104787",
105 "layer": "0",
106 "sheetId": "0",
107 "sheetName": "Model",
108 "type": "Model"
109 },
110 {
111 "diffType": "CHANGE",
112 "id": "96095",
113 "layer": "0",
114 "sheetId": "0",
115 "sheetName": "Model",
116 "type": "Model"
117 },
118 {
119 "diffType": "CHANGE",
120 "id": "96096",
121 "layer": "0",
122 "sheetId": "0",
123 "sheetName": "Model",
124 "type": "Model"
125 },
126 {
127 "diffType": "CHANGE",
128 "id": "96097",
129 "layer": "0",
130 "sheetId": "0",
131 "sheetName": "Model",
132 "type": "Model"
133 },
134 {
135 "diffType": "CHANGE",
136 "id": "96098",
137 "layer": "0",
138 "sheetId": "0",
139 "sheetName": "Model",
140 "type": "Model"
141 },
142 {
143 "diffType": "CHANGE",
144 "id": "96099",
145 "layer": "0",
146 "sheetId": "0",
147 "sheetName": "Model",
148 "type": "Model"
149 },
150 {
151 "diffType": "CHANGE",
152 "id": "96100",
153 "layer": "0",
154 "sheetId": "0",
155 "sheetName": "Model",
156 "type": "Model"
157 },
158 {
159 "diffType": "CHANGE",
160 "id": "96101",
161 "layer": "0",
162 "sheetId": "0",
163 "sheetName": "Model",
164 "type": "Model"
165 },
166 {
167 "diffType": "CHANGE",
168 "id": "96102",
169 "layer": "0",
170 "sheetId": "0",
171 "sheetName": "Model",
172 "type": "Model"
173 },
174 {
175 "diffType": "CHANGE",
176 "id": "96103",
177 "layer": "0",
178 "sheetId": "0",
179 "sheetName": "Model",
180 "type": "Model"
181 },
182 {
183 "diffType": "CHANGE",
184 "id": "96104",
185 "layer": "0",
186 "sheetId": "0",
187 "sheetName": "Model",
188 "type": "Model"
189 },
190 {
191 "diffType": "CHANGE",
192 "id": "22307",
193 "layer": "AXIS",
194 "sheetId": "0",
195 "sheetName": "Model",
196 "type": "Model"
197 },
198 {
199 "diffType": "CHANGE",
200 "id": "22314",
201 "layer": "AXIS",
202 "sheetId": "0",
203 "sheetName": "Model",
204 "type": "Model"
205 },
206 {
207 "diffType": "CHANGE",
208 "id": "22315",
209 "layer": "AXIS",
210 "sheetId": "0",
211 "sheetName": "Model",
212 "type": "Model"
213 },
214 {
215 "diffType": "CHANGE",
216 "id": "53351",
217 "layer": "D1",
218 "sheetId": "0",
219 "sheetName": "Model",
220 "type": "Model"
221 },
222 {
223 "diffType": "CHANGE",
224 "id": "53352",
225 "layer": "D1",
226 "sheetId": "0",
227 "sheetName": "Model",
228 "type": "Model"
229 },
230 {
231 "diffType": "CHANGE",
232 "id": "53355",
233 "layer": "D1",
234 "sheetId": "0",
235 "sheetName": "Model",
236 "type": "Model"
237 },
238 {
239 "diffType": "CHANGE",
240 "id": "53356",
241 "layer": "D1",
242 "sheetId": "0",
243 "sheetName": "Model",
244 "type": "Model"
245 },
246 {
247 "diffType": "CHANGE",
248 "id": "53357",
249 "layer": "D1",
250 "sheetId": "0",
251 "sheetName": "Model",
252 "type": "Model"
253 },
254 {
255 "diffType": "CHANGE",
256 "id": "53358",
257 "layer": "D1",
258 "sheetId": "0",
259 "sheetName": "Model",
260 "type": "Model"
261 },
262 {
263 "diffType": "CHANGE",
264 "id": "53359",
265 "layer": "D1",
266 "sheetId": "0",
267 "sheetName": "Model",
268 "type": "Model"
269 },
270 {
271 "diffType": "CHANGE",
272 "id": "53361",
273 "layer": "D1",
274 "sheetId": "0",
275 "sheetName": "Model",
276 "type": "Model"
277 },
278 {
279 "diffType": "CHANGE",
280 "id": "53362",
281 "layer": "D1",
282 "sheetId": "0",
283 "sheetName": "Model",
284 "type": "Model"
285 },
286 {
287 "diffType": "CHANGE",
288 "id": "53363",
289 "layer": "D1",
290 "sheetId": "0",
291 "sheetName": "Model",
292 "type": "Model"
293 },
294 {
295 "diffType": "CHANGE",
296 "id": "53364",
297 "layer": "D1",
298 "sheetId": "0",
299 "sheetName": "Model",
300 "type": "Model"
301 },
302 {
303 "diffType": "CHANGE",
304 "id": "53365",
305 "layer": "D1",
306 "sheetId": "0",
307 "sheetName": "Model",
308 "type": "Model"
309 },
310 {
311 "diffType": "CHANGE",
312 "id": "53366",
313 "layer": "D1",
314 "sheetId": "0",
315 "sheetName": "Model",
316 "type": "Model"
317 },
318 {
319 "diffType": "CHANGE",
320 "id": "53367",
321 "layer": "D1",
322 "sheetId": "0",
323 "sheetName": "Model",
324 "type": "Model"
325 },
326 {
327 "diffType": "CHANGE",
328 "id": "53368",
329 "layer": "D1",
330 "sheetId": "0",
331 "sheetName": "Model",
332 "type": "Model"
333 },
334 {
335 "diffType": "CHANGE",
336 "id": "53369",
337 "layer": "D1",
338 "sheetId": "0",
339 "sheetName": "Model",
340 "type": "Model"
341 },
342 {
343 "diffType": "CHANGE",
344 "id": "53370",
345 "layer": "D1",
346 "sheetId": "0",
347 "sheetName": "Model",
348 "type": "Model"
349 },
350 {
351 "diffType": "CHANGE",
352 "id": "53371",
353 "layer": "D1",
354 "sheetId": "0",
355 "sheetName": "Model",
356 "type": "Model"
357 },
358 {
359 "diffType": "CHANGE",
360 "id": "53372",
361 "layer": "D1",
362 "sheetId": "0",
363 "sheetName": "Model",
364 "type": "Model"
365 },
366 {
367 "diffType": "CHANGE",
368 "id": "53373",
369 "layer": "D1",
370 "sheetId": "0",
371 "sheetName": "Model",
372 "type": "Model"
373 },
374 {
375 "diffType": "CHANGE",
376 "id": "53374",
377 "layer": "D1",
378 "sheetId": "0",
379 "sheetName": "Model",
380 "type": "Model"
381 },
382 {
383 "diffType": "CHANGE",
384 "id": "53375",
385 "layer": "D1",
386 "sheetId": "0",
387 "sheetName": "Model",
388 "type": "Model"
389 },
390 {
391 "diffType": "CHANGE",
392 "id": "53376",
393 "layer": "D1",
394 "sheetId": "0",
395 "sheetName": "Model",
396 "type": "Model"
397 },
398 {
399 "diffType": "CHANGE",
400 "id": "53377",
401 "layer": "D1",
402 "sheetId": "0",
403 "sheetName": "Model",
404 "type": "Model"
405 },
406 {
407 "diffType": "CHANGE",
408 "id": "53378",
409 "layer": "D1",
410 "sheetId": "0",
411 "sheetName": "Model",
412 "type": "Model"
413 },
414 {
415 "diffType": "CHANGE",
416 "id": "53381",
417 "layer": "D1",
418 "sheetId": "0",
419 "sheetName": "Model",
420 "type": "Model"
421 },
422 {
423 "diffType": "CHANGE",
424 "id": "53383",
425 "layer": "D1",
426 "sheetId": "0",
427 "sheetName": "Model",
428 "type": "Model"
429 },
430 {
431 "diffType": "CHANGE",
432 "id": "53384",
433 "layer": "D1",
434 "sheetId": "0",
435 "sheetName": "Model",
436 "type": "Model"
437 },
438 {
439 "diffType": "CHANGE",
440 "id": "53385",
441 "layer": "D1",
442 "sheetId": "0",
443 "sheetName": "Model",
444 "type": "Model"
445 },
446 {
447 "diffType": "CHANGE",
448 "id": "53386",
449 "layer": "D1",
450 "sheetId": "0",
451 "sheetName": "Model",
452 "type": "Model"
453 },
454 {
455 "diffType": "CHANGE",
456 "id": "53387",
457 "layer": "D1",
458 "sheetId": "0",
459 "sheetName": "Model",
460 "type": "Model"
461 },
462 {
463 "diffType": "CHANGE",
464 "id": "53389",
465 "layer": "D1",
466 "sheetId": "0",
467 "sheetName": "Model",
468 "type": "Model"
469 },
470 {
471 "diffType": "CHANGE",
472 "id": "53390",
473 "layer": "D1",
474 "sheetId": "0",
475 "sheetName": "Model",
476 "type": "Model"
477 },
478 {
479 "diffType": "CHANGE",
480 "id": "53391",
481 "layer": "D1",
482 "sheetId": "0",
483 "sheetName": "Model",
484 "type": "Model"
485 },
486 {
487 "diffType": "CHANGE",
488 "id": "53392",
489 "layer": "D1",
490 "sheetId": "0",
491 "sheetName": "Model",
492 "type": "Model"
493 },
494 {
495 "diffType": "CHANGE",
496 "id": "53395",
497 "layer": "D1",
498 "sheetId": "0",
499 "sheetName": "Model",
500 "type": "Model"
501 },
502 {
503 "diffType": "CHANGE",
504 "id": "53396",
505 "layer": "D1",
506 "sheetId": "0",
507 "sheetName": "Model",
508 "type": "Model"
509 },
510 {
511 "diffType": "CHANGE",
512 "id": "53397",
513 "layer": "D1",
514 "sheetId": "0",
515 "sheetName": "Model",
516 "type": "Model"
517 },
518 {
519 "diffType": "CHANGE",
520 "id": "53400",
521 "layer": "D1",
522 "sheetId": "0",
523 "sheetName": "Model",
524 "type": "Model"
525 },
526 {
527 "diffType": "CHANGE",
528 "id": "53401",
529 "layer": "D1",
530 "sheetId": "0",
531 "sheetName": "Model",
532 "type": "Model"
533 },
534 {
535 "diffType": "CHANGE",
536 "id": "53403",
537 "layer": "D1",
538 "sheetId": "0",
539 "sheetName": "Model",
540 "type": "Model"
541 },
542 {
543 "diffType": "CHANGE",
544 "id": "53404",
545 "layer": "D1",
546 "sheetId": "0",
547 "sheetName": "Model",
548 "type": "Model"
549 },
550 {
551 "diffType": "CHANGE",
552 "id": "53405",
553 "layer": "D1",
554 "sheetId": "0",
555 "sheetName": "Model",
556 "type": "Model"
557 },
558 {
559 "diffType": "CHANGE",
560 "id": "53406",
561 "layer": "D1",
562 "sheetId": "0",
563 "sheetName": "Model",
564 "type": "Model"
565 },
566 {
567 "diffType": "CHANGE",
568 "id": "53407",
569 "layer": "D1",
570 "sheetId": "0",
571 "sheetName": "Model",
572 "type": "Model"
573 },
574 {
575 "diffType": "CHANGE",
576 "id": "53408",
577 "layer": "D1",
578 "sheetId": "0",
579 "sheetName": "Model",
580 "type": "Model"
581 },
582 {
583 "diffType": "CHANGE",
584 "id": "53409",
585 "layer": "D1",
586 "sheetId": "0",
587 "sheetName": "Model",
588 "type": "Model"
589 },
590 {
591 "diffType": "CHANGE",
592 "id": "53410",
593 "layer": "D1",
594 "sheetId": "0",
595 "sheetName": "Model",
596 "type": "Model"
597 },
598 {
599 "diffType": "CHANGE",
600 "id": "53411",
601 "layer": "D1",
602 "sheetId": "0",
603 "sheetName": "Model",
604 "type": "Model"
605 }
606 ],
607 "page": 1,
608 "total": 75
609 }
610 }
参数说明
(1)diffType:图元变更类型。NEW 表示新增的图元、DELETE 表示删除的图元、CHANGE 表示修改的图元。
(2)id:变更的图元的唯一编号。
(3)layer:变更的图元所在的图层名称。
(4)sheetId:未知
(5)sheetName:未知
(6)type:变更的图元所在的图纸展示类型(Model 与Layer )
从上述Json结果中只能看出图元的变更类型与编号,并不知道其所属的图框,需要通过解析图纸对比的数据包信息才能计算出来。
获取图纸对比数据包信息API
测试程序如下:
调用BIMFACE服务端接口如下:
1 ///
4 /// 对比记录的ID
5 ///
6 public DrawingCompareDatabagResponse GetDrawingCompareDatabage(string accessToken, long compareId)
7 {
8 IBasicApi api = new BasicApi();
9
10 ViewTokenResponse viewTokenResponse = api.GetViewTokenByCompareId(accessToken, compareId);
11 if (viewTokenResponse != null && viewTokenResponse.Code == "success" && viewTokenResponse.Data != null)
12 {
13 return GetDrawingCompareDatabageByCompareViewToken(viewTokenResponse.Data);
14 }
15
16 return null;
17 }
18
19
20 ///
23 /// 对比记录的ViewToken
24 ///
25 public DrawingCompareDatabagResponse GetDrawingCompareDatabageByCompareViewToken(string compareViewToken)
26 {
27 //GET https://api.bimface.com/inside/databag?viewToken=b80412dcba2a47b0860eeff8f2c578a9
28
29 string url = string.Format(BIMFaceConstants.API_HOST + "/inside/databag?viewToken={0}", compareViewToken);
30 try
31 {
32 DrawingCompareDatabagResponse response;
33
34 HttpManager httpManager = new HttpManager();
35 HttpResult httpResult = httpManager.Get(url);
36 if (httpResult.Status == HttpResult.STATUS_SUCCESS)
37 {
38 response = httpResult.Text.DeserializeJsonToObject
39 }
40 else
41 {
42 response = new DrawingCompareDatabagResponse
43 {
44 Message = httpResult.RefText
45 };
46 }
47
48 return response;
49 }
50 catch (Exception ex)
51 {
52 throw new BIMFaceException("[获取图纸对比的数据包信息]发生异常!", ex);
53 }
54 }
55
接口返回的完整信息如下:
1 {
2 "code": "success",
3 "message": null,
4 "data": {
5 "databagId": "76d256b09416830a8079914ab7d40fdf",
6 "isSupportComponentProperty": false,
7 "isSupportDrawing": false,
8 "isSupportFamilyTypeList": false,
9 "isSupportMaterialProperty": false,
10 "isSupportMiniMap": false,
11 "isSupportModelTree": false,
12 "isSupportRoomArea": false,
13 "isSupportWalk": true,
14 "jsSDKVersion": "3.6.159",
15 "modelId": 2230429779838240,
16 "modelType": "compareModel",
17 "name": "202110121516-对比",
18 "renderType": "drawingView",
19 "renderVersion": "3.0",
20 "subRenders": [
21 {
22 "isSupportComponentProperty": false,
23 "isSupportFamilyTypeList": false,
24 "isSupportMiniMap": false,
25 "isSupportModelTree": false,
26 "jsSDKVersion": "3.6.159",
27 "renderType": "bimView",
28 "renderVersion": "3.0"
29 },
30 {
31 "isSupportComponentProperty": false,
32 "isSupportFamilyTypeList": false,
33 "isSupportMiniMap": false,
34 "isSupportModelTree": false,
35 "jsSDKVersion": "Drawing@1.6.95",
36 "renderType": "drawingView",
37 "renderVersion": "1.0"
38 }
39 ],
40 "type": 3,
41 "workerType": "drawing-compare"
42 }
43 }
该接口主要获取 databagId,供下面的接口使用。
获取图纸对比数据包差异结果API
测试程序如下:
调用BIMFACE服务端接口如下:
1 ///
4 /// 图纸对比的数据包Id,
5 ///
6 public DrawingCompareDatabagDiffResult GetDrawingCompareDatabageDiffResult(string databagId)
7 {
8 //GET https://m.bimface.com/{databagId}/result.json
9
10 string url = string.Format("https://m.bimface.com/{0}/result.json", databagId);
11 try
12 {
13 DrawingCompareDatabagDiffResult response = null;
14
15 HttpManager httpManager = new HttpManager();
16 HttpResult httpResult = httpManager.Get(url);
17 if (httpResult.Status == HttpResult.STATUS_SUCCESS)
18 {
19 response = httpResult.Text.DeserializeJsonToObject
20 }
21
22 return response;
23 }
24 catch (Exception ex)
25 {
26 throw new BIMFaceException("[获取图纸对比的数据包信息]发生异常!", ex);
27 }
28 }
接口返回的完整信息如下:
1 {
2 "ver": "4.0",
3 "model": {
4 "id": "0",
5 "name": "Model",
6 "additions": [
7 {
8 "layer": "D1",
9 "id": "1946878",
10 "frame": {
11 "id": "6",
12 "name": "基础接地平面",
13 "number": "电施05"
14 }
15 },
16 {
17 "layer": "D1",
18 "id": "1946877",
19 "frame": {
20 "id": "5",
21 "name": "屋顶防雷平面",
22 "number": "电施04"
23 }
24 }
25 ],
26 "deletions": [
27 {
28 "layer": "D1",
29 "id": "122566",
30 "frame": {
31 "id": "3",
32 "name": "一层电气平面(一)",
33 "number": "电施02"
34 }
35 }
36 ],
37 "modifications": [
38 {
39 "previousLayer": "0",
40 "currentLayer": "0",
41 "id": "96103",
42 "previousFrame": {
43 "id": "2",
44 "name": "电气抗震设计专篇",
45 "number": "电施01"
46 },
47 "currentFrame": {
48 "id": "2",
49 "name": "电气抗震设计专篇",
50 "number": "电施01"
51 }
52 },
53 {
54 "previousLayer": "D1",
55 "currentLayer": "D1",
56 "id": "53383",
57 "previousFrame": {
58 "id": "3",
59 "name": "一层电气平面(一)",
60 "number": "电施02"
61 },
62 "currentFrame": {
63 "id": "3",
64 "name": "一层电气平面(一)",
65 "number": "电施02"
66 }
67 },
68 {
69 "previousLayer": "D1",
70 "currentLayer": "D1",
71 "id": "53351",
72 "previousFrame": {
73 "id": "3",
74 "name": "一层电气平面(一)",
75 "number": "电施02"
76 },
77 "currentFrame": {
78 "id": "3",
79 "name": "一层电气平面(一)",
80 "number": "电施02"
81 }
82 },
83 {
84 "previousLayer": "0",
85 "currentLayer": "0",
86 "id": "96099",
87 "previousFrame": {
88 "id": "2",
89 "name": "电气抗震设计专篇",
90 "number": "电施01"
91 },
92 "currentFrame": {
93 "id": "2",
94 "name": "电气抗震设计专篇",
95 "number": "电施01"
96 }
97 },
98 {
99 "previousLayer": "0",
100 "currentLayer": "0",
101 "id": "104785",
102 "previousFrame": {
103 "id": "2",
104 "name": "电气抗震设计专篇",
105 "number": "电施01"
106 },
107 "currentFrame": {
108 "id": "2",
109 "name": "电气抗震设计专篇",
110 "number": "电施01"
111 }
112 },
113 {
114 "previousLayer": "D1",
115 "currentLayer": "D1",
116 "id": "53403",
117 "previousFrame": {
118 "id": "3",
119 "name": "一层电气平面(一)",
120 "number": "电施02"
121 },
122 "currentFrame": {
123 "id": "3",
124 "name": "一层电气平面(一)",
125 "number": "电施02"
126 }
127 },
128 {
129 "previousLayer": "D1",
130 "currentLayer": "D1",
131 "id": "53395",
132 "previousFrame": {
133 "id": "3",
134 "name": "一层电气平面(一)",
135 "number": "电施02"
136 },
137 "currentFrame": {
138 "id": "3",
139 "name": "一层电气平面(一)",
140 "number": "电施02"
141 }
142 },
143 {
144 "previousLayer": "AXIS",
145 "currentLayer": "AXIS",
146 "id": "22315",
147 "previousFrame": {
148 "id": "5",
149 "name": "屋顶防雷平面",
150 "number": "电施04"
151 },
152 "currentFrame": {
153 "id": "5",
154 "name": "屋顶防雷平面",
155 "number": "电施04"
156 }
157 },
158 {
159 "previousLayer": "0",
160 "currentLayer": "0",
161 "id": "104786",
162 "previousFrame": {
163 "id": "2",
164 "name": "电气抗震设计专篇",
165 "number": "电施01"
166 },
167 "currentFrame": {
168 "id": "2",
169 "name": "电气抗震设计专篇",
170 "number": "电施01"
171 }
172 },
173 {
174 "previousLayer": "D1",
175 "currentLayer": "D1",
176 "id": "53384",
177 "previousFrame": {
178 "id": "3",
179 "name": "一层电气平面(一)",
180 "number": "电施02"
181 },
182 "currentFrame": {
183 "id": "3",
184 "name": "一层电气平面(一)",
185 "number": "电施02"
186 }
187 },
188 {
189 "previousLayer": "D1",
190 "currentLayer": "D1",
191 "id": "53352",
192 "previousFrame": {
193 "id": "3",
194 "name": "一层电气平面(一)",
195 "number": "电施02"
196 },
197 "currentFrame": {
198 "id": "3",
199 "name": "一层电气平面(一)",
200 "number": "电施02"
201 }
202 },
203 {
204 "previousLayer": "D1",
205 "currentLayer": "D1",
206 "id": "53400",
207 "previousFrame": {
208 "id": "3",
209 "name": "一层电气平面(一)",
210 "number": "电施02"
211 },
212 "currentFrame": {
213 "id": "3",
214 "name": "一层电气平面(一)",
215 "number": "电施02"
216 }
217 },
218 {
219 "previousLayer": "D1",
220 "currentLayer": "D1",
221 "id": "53368",
222 "previousFrame": {
223 "id": "3",
224 "name": "一层电气平面(一)",
225 "number": "电施02"
226 },
227 "currentFrame": {
228 "id": "3",
229 "name": "一层电气平面(一)",
230 "number": "电施02"
231 }
232 },
233 {
234 "previousLayer": "AXIS",
235 "currentLayer": "AXIS",
236 "id": "22307",
237 "previousFrame": {
238 "id": "5",
239 "name": "屋顶防雷平面",
240 "number": "电施04"
241 },
242 "currentFrame": {
243 "id": "5",
244 "name": "屋顶防雷平面",
245 "number": "电施04"
246 }
247 },
248 {
249 "previousLayer": "D1",
250 "currentLayer": "D1",
251 "id": "53371",
252 "previousFrame": {
253 "id": "3",
254 "name": "一层电气平面(一)",
255 "number": "电施02"
256 },
257 "currentFrame": {
258 "id": "3",
259 "name": "一层电气平面(一)",
260 "number": "电施02"
261 }
262 },
263 {
264 "previousLayer": "AXIS",
265 "currentLayer": "AXIS",
266 "id": "22314",
267 "previousFrame": {
268 "id": "5",
269 "name": "屋顶防雷平面",
270 "number": "电施04"
271 },
272 "currentFrame": {
273 "id": "5",
274 "name": "屋顶防雷平面",
275 "number": "电施04"
276 }
277 },
278 {
279 "previousLayer": "0",
280 "currentLayer": "0",
281 "id": "96098",
282 "previousFrame": {
283 "id": "2",
284 "name": "电气抗震设计专篇",
285 "number": "电施01"
286 },
287 "currentFrame": {
288 "id": "2",
289 "name": "电气抗震设计专篇",
290 "number": "电施01"
291 }
292 },
293 {
294 "previousLayer": "D1",
295 "currentLayer": "D1",
296 "id": "53386",
297 "previousFrame": {
298 "id": "3",
299 "name": "一层电气平面(一)",
300 "number": "电施02"
301 },
302 "currentFrame": {
303 "id": "3",
304 "name": "一层电气平面(一)",
305 "number": "电施02"
306 }
307 },
308 {
309 "previousLayer": "0",
310 "currentLayer": "0",
311 "id": "96097",
312 "previousFrame": {
313 "id": "2",
314 "name": "电气抗震设计专篇",
315 "number": "电施01"
316 },
317 "currentFrame": {
318 "id": "2",
319 "name": "电气抗震设计专篇",
320 "number": "电施01"
321 }
322 },
323 {
324 "previousLayer": "D1",
325 "currentLayer": "D1",
326 "id": "53397",
327 "previousFrame": {
328 "id": "3",
329 "name": "一层电气平面(一)",
330 "number": "电施02"
331 },
332 "currentFrame": {
333 "id": "3",
334 "name": "一层电气平面(一)",
335 "number": "电施02"
336 }
337 },
338 {
339 "previousLayer": "0",
340 "currentLayer": "0",
341 "id": "104783",
342 "previousFrame": {
343 "id": "2",
344 "name": "电气抗震设计专篇",
345 "number": "电施01"
346 },
347 "currentFrame": {
348 "id": "2",
349 "name": "电气抗震设计专篇",
350 "number": "电施01"
351 }
352 },
353 {
354 "previousLayer": "D1",
355 "currentLayer": "D1",
356 "id": "53405",
357 "previousFrame": {
358 "id": "3",
359 "name": "一层电气平面(一)",
360 "number": "电施02"
361 },
362 "currentFrame": {
363 "id": "3",
364 "name": "一层电气平面(一)",
365 "number": "电施02"
366 }
367 },
368 {
369 "previousLayer": "0",
370 "currentLayer": "0",
371 "id": "104779",
372 "previousFrame": {
373 "id": "2",
374 "name": "电气抗震设计专篇",
375 "number": "电施01"
376 },
377 "currentFrame": {
378 "id": "2",
379 "name": "电气抗震设计专篇",
380 "number": "电施01"
381 }
382 },
383 {
384 "previousLayer": "0",
385 "currentLayer": "0",
386 "id": "96095",
387 "previousFrame": {
388 "id": "2",
389 "name": "电气抗震设计专篇",
390 "number": "电施01"
391 },
392 "currentFrame": {
393 "id": "2",
394 "name": "电气抗震设计专篇",
395 "number": "电施01"
396 }
397 },
398 {
399 "previousLayer": "D1",
400 "currentLayer": "D1",
401 "id": "53375",
402 "previousFrame": {
403 "id": "3",
404 "name": "一层电气平面(一)",
405 "number": "电施02"
406 },
407 "currentFrame": {
408 "id": "3",
409 "name": "一层电气平面(一)",
410 "number": "电施02"
411 }
412 },
413 {
414 "previousLayer": "D1",
415 "currentLayer": "D1",
416 "id": "53355",
417 "previousFrame": {
418 "id": "3",
419 "name": "一层电气平面(一)",
420 "number": "电施02"
421 },
422 "currentFrame": {
423 "id": "3",
424 "name": "一层电气平面(一)",
425 "number": "电施02"
426 }
427 },
428 {
429 "previousLayer": "0",
430 "currentLayer": "0",
431 "id": "96104",
432 "previousFrame": {
433 "id": "2",
434 "name": "电气抗震设计专篇",
435 "number": "电施01"
436 },
437 "currentFrame": {
438 "id": "2",
439 "name": "电气抗震设计专篇",
440 "number": "电施01"
441 }
442 },
443 {
444 "previousLayer": "D1",
445 "currentLayer": "D1",
446 "id": "53356",
447 "previousFrame": {
448 "id": "3",
449 "name": "一层电气平面(一)",
450 "number": "电施02"
451 },
452 "currentFrame": {
453 "id": "3",
454 "name": "一层电气平面(一)",
455 "number": "电施02"
456 }
457 },
458 {
459 "previousLayer": "D1",
460 "currentLayer": "D1",
461 "id": "53357",
462 "previousFrame": {
463 "id": "3",
464 "name": "一层电气平面(一)",
465 "number": "电施02"
466 },
467 "currentFrame": {
468 "id": "3",
469 "name": "一层电气平面(一)",
470 "number": "电施02"
471 }
472 },
473 {
474 "previousLayer": "D1",
475 "currentLayer": "D1",
476 "id": "53358",
477 "previousFrame": {
478 "id": "3",
479 "name": "一层电气平面(一)",
480 "number": "电施02"
481 },
482 "currentFrame": {
483 "id": "3",
484 "name": "一层电气平面(一)",
485 "number": "电施02"
486 }
487 },
488 {
489 "previousLayer": "D1",
490 "currentLayer": "D1",
491 "id": "53359",
492 "previousFrame": {
493 "id": "3",
494 "name": "一层电气平面(一)",
495 "number": "电施02"
496 },
497 "currentFrame": {
498 "id": "3",
499 "name": "一层电气平面(一)",
500 "number": "电施02"
501 }
502 },
503 {
504 "previousLayer": "D1",
505 "currentLayer": "D1",
506 "id": "53361",
507 "previousFrame": {
508 "id": "3",
509 "name": "一层电气平面(一)",
510 "number": "电施02"
511 },
512 "currentFrame": {
513 "id": "3",
514 "name": "一层电气平面(一)",
515 "number": "电施02"
516 }
517 },
518 {
519 "previousLayer": "D1",
520 "currentLayer": "D1",
521 "id": "53362",
522 "previousFrame": {
523 "id": "3",
524 "name": "一层电气平面(一)",
525 "number": "电施02"
526 },
527 "currentFrame": {
528 "id": "3",
529 "name": "一层电气平面(一)",
530 "number": "电施02"
531 }
532 },
533 {
534 "previousLayer": "D1",
535 "currentLayer": "D1",
536 "id": "53363",
537 "previousFrame": {
538 "id": "3",
539 "name": "一层电气平面(一)",
540 "number": "电施02"
541 },
542 "currentFrame": {
543 "id": "3",
544 "name": "一层电气平面(一)",
545 "number": "电施02"
546 }
547 },
548 {
549 "previousLayer": "D1",
550 "currentLayer": "D1",
551 "id": "53364",
552 "previousFrame": {
553 "id": "3",
554 "name": "一层电气平面(一)",
555 "number": "电施02"
556 },
557 "currentFrame": {
558 "id": "3",
559 "name": "一层电气平面(一)",
560 "number": "电施02"
561 }
562 },
563 {
564 "previousLayer": "D1",
565 "currentLayer": "D1",
566 "id": "53365",
567 "previousFrame": {
568 "id": "3",
569 "name": "一层电气平面(一)",
570 "number": "电施02"
571 },
572 "currentFrame": {
573 "id": "3",
574 "name": "一层电气平面(一)",
575 "number": "电施02"
576 }
577 },
578 {
579 "previousLayer": "D1",
580 "currentLayer": "D1",
581 "id": "53366",
582 "previousFrame": {
583 "id": "3",
584 "name": "一层电气平面(一)",
585 "number": "电施02"
586 },
587 "currentFrame": {
588 "id": "3",
589 "name": "一层电气平面(一)",
590 "number": "电施02"
591 }
592 },
593 {
594 "previousLayer": "D1",
595 "currentLayer": "D1",
596 "id": "53367",
597 "previousFrame": {
598 "id": "3",
599 "name": "一层电气平面(一)",
600 "number": "电施02"
601 },
602 "currentFrame": {
603 "id": "3",
604 "name": "一层电气平面(一)",
605 "number": "电施02"
606 }
607 },
608 {
609 "previousLayer": "D1",
610 "currentLayer": "D1",
611 "id": "53369",
612 "previousFrame": {
613 "id": "3",
614 "name": "一层电气平面(一)",
615 "number": "电施02"
616 },
617 "currentFrame": {
618 "id": "3",
619 "name": "一层电气平面(一)",
620 "number": "电施02"
621 }
622 },
623 {
624 "previousLayer": "D1",
625 "currentLayer": "D1",
626 "id": "53370",
627 "previousFrame": {
628 "id": "3",
629 "name": "一层电气平面(一)",
630 "number": "电施02"
631 },
632 "currentFrame": {
633 "id": "3",
634 "name": "一层电气平面(一)",
635 "number": "电施02"
636 }
637 },
638 {
639 "previousLayer": "D1",
640 "currentLayer": "D1",
641 "id": "53372",
642 "previousFrame": {
643 "id": "3",
644 "name": "一层电气平面(一)",
645 "number": "电施02"
646 },
647 "currentFrame": {
648 "id": "3",
649 "name": "一层电气平面(一)",
650 "number": "电施02"
651 }
652 },
653 {
654 "previousLayer": "D1",
655 "currentLayer": "D1",
656 "id": "53373",
657 "previousFrame": {
658 "id": "3",
659 "name": "一层电气平面(一)",
660 "number": "电施02"
661 },
662 "currentFrame": {
663 "id": "3",
664 "name": "一层电气平面(一)",
665 "number": "电施02"
666 }
667 },
668 {
669 "previousLayer": "D1",
670 "currentLayer": "D1",
671 "id": "53374",
672 "previousFrame": {
673 "id": "3",
674 "name": "一层电气平面(一)",
675 "number": "电施02"
676 },
677 "currentFrame": {
678 "id": "3",
679 "name": "一层电气平面(一)",
680 "number": "电施02"
681 }
682 },
683 {
684 "previousLayer": "D1",
685 "currentLayer": "D1",
686 "id": "53376",
687 "previousFrame": {
688 "id": "3",
689 "name": "一层电气平面(一)",
690 "number": "电施02"
691 },
692 "currentFrame": {
693 "id": "3",
694 "name": "一层电气平面(一)",
695 "number": "电施02"
696 }
697 },
698 {
699 "previousLayer": "0",
700 "currentLayer": "0",
701 "id": "96101",
702 "previousFrame": {
703 "id": "2",
704 "name": "电气抗震设计专篇",
705 "number": "电施01"
706 },
707 "currentFrame": {
708 "id": "2",
709 "name": "电气抗震设计专篇",
710 "number": "电施01"
711 }
712 },
713 {
714 "previousLayer": "D1",
715 "currentLayer": "D1",
716 "id": "53377",
717 "previousFrame": {
718 "id": "3",
719 "name": "一层电气平面(一)",
720 "number": "电施02"
721 },
722 "currentFrame": {
723 "id": "3",
724 "name": "一层电气平面(一)",
725 "number": "电施02"
726 }
727 },
728 {
729 "previousLayer": "D1",
730 "currentLayer": "D1",
731 "id": "53378",
732 "previousFrame": {
733 "id": "3",
734 "name": "一层电气平面(一)",
735 "number": "电施02"
736 },
737 "currentFrame": {
738 "id": "3",
739 "name": "一层电气平面(一)",
740 "number": "电施02"
741 }
742 },
743 {
744 "previousLayer": "D1",
745 "currentLayer": "D1",
746 "id": "53381",
747 "previousFrame": {
748 "id": "3",
749 "name": "一层电气平面(一)",
750 "number": "电施02"
751 },
752 "currentFrame": {
753 "id": "3",
754 "name": "一层电气平面(一)",
755 "number": "电施02"
756 }
757 },
758 {
759 "previousLayer": "D1",
760 "currentLayer": "D1",
761 "id": "53385",
762 "previousFrame": {
763 "id": "3",
764 "name": "一层电气平面(一)",
765 "number": "电施02"
766 },
767 "currentFrame": {
768 "id": "3",
769 "name": "一层电气平面(一)",
770 "number": "电施02"
771 }
772 },
773 {
774 "previousLayer": "D1",
775 "currentLayer": "D1",
776 "id": "53387",
777 "previousFrame": {
778 "id": "3",
779 "name": "一层电气平面(一)",
780 "number": "电施02"
781 },
782 "currentFrame": {
783 "id": "3",
784 "name": "一层电气平面(一)",
785 "number": "电施02"
786 }
787 },
788 {
789 "previousLayer": "D1",
790 "currentLayer": "D1",
791 "id": "53389",
792 "previousFrame": {
793 "id": "3",
794 "name": "一层电气平面(一)",
795 "number": "电施02"
796 },
797 "currentFrame": {
798 "id": "3",
799 "name": "一层电气平面(一)",
800 "number": "电施02"
801 }
802 },
803 {
804 "previousLayer": "D1",
805 "currentLayer": "D1",
806 "id": "53390",
807 "previousFrame": {
808 "id": "3",
809 "name": "一层电气平面(一)",
810 "number": "电施02"
811 },
812 "currentFrame": {
813 "id": "3",
814 "name": "一层电气平面(一)",
815 "number": "电施02"
816 }
817 },
818 {
819 "previousLayer": "D1",
820 "currentLayer": "D1",
821 "id": "53392",
822 "previousFrame": {
823 "id": "3",
824 "name": "一层电气平面(一)",
825 "number": "电施02"
826 },
827 "currentFrame": {
828 "id": "3",
829 "name": "一层电气平面(一)",
830 "number": "电施02"
831 }
832 },
833 {
834 "previousLayer": "D1",
835 "currentLayer": "D1",
836 "id": "53391",
837 "previousFrame": {
838 "id": "3",
839 "name": "一层电气平面(一)",
840 "number": "电施02"
841 },
842 "currentFrame": {
843 "id": "3",
844 "name": "一层电气平面(一)",
845 "number": "电施02"
846 }
847 },
848 {
849 "previousLayer": "D1",
850 "currentLayer": "D1",
851 "id": "53396",
852 "previousFrame": {
853 "id": "3",
854 "name": "一层电气平面(一)",
855 "number": "电施02"
856 },
857 "currentFrame": {
858 "id": "3",
859 "name": "一层电气平面(一)",
860 "number": "电施02"
861 }
862 },
863 {
864 "previousLayer": "D1",
865 "currentLayer": "D1",
866 "id": "53401",
867 "previousFrame": {
868 "id": "3",
869 "name": "一层电气平面(一)",
870 "number": "电施02"
871 },
872 "currentFrame": {
873 "id": "3",
874 "name": "一层电气平面(一)",
875 "number": "电施02"
876 }
877 },
878 {
879 "previousLayer": "D1",
880 "currentLayer": "D1",
881 "id": "53404",
882 "previousFrame": {
883 "id": "3",
884 "name": "一层电气平面(一)",
885 "number": "电施02"
886 },
887 "currentFrame": {
888 "id": "3",
889 "name": "一层电气平面(一)",
890 "number": "电施02"
891 }
892 },
893 {
894 "previousLayer": "D1",
895 "currentLayer": "D1",
896 "id": "53406",
897 "previousFrame": {
898 "id": "3",
899 "name": "一层电气平面(一)",
900 "number": "电施02"
901 },
902 "currentFrame": {
903 "id": "3",
904 "name": "一层电气平面(一)",
905 "number": "电施02"
906 }
907 },
908 {
909 "previousLayer": "D1",
910 "currentLayer": "D1",
911 "id": "53407",
912 "previousFrame": {
913 "id": "3",
914 "name": "一层电气平面(一)",
915 "number": "电施02"
916 },
917 "currentFrame": {
918 "id": "3",
919 "name": "一层电气平面(一)",
920 "number": "电施02"
921 }
922 },
923 {
924 "previousLayer": "D1",
925 "currentLayer": "D1",
926 "id": "53408",
927 "previousFrame": {
928 "id": "3",
929 "name": "一层电气平面(一)",
930 "number": "电施02"
931 },
932 "currentFrame": {
933 "id": "3",
934 "name": "一层电气平面(一)",
935 "number": "电施02"
936 }
937 },
938 {
939 "previousLayer": "D1",
940 "currentLayer": "D1",
941 "id": "53409",
942 "previousFrame": {
943 "id": "3",
944 "name": "一层电气平面(一)",
945 "number": "电施02"
946 },
947 "currentFrame": {
948 "id": "3",
949 "name": "一层电气平面(一)",
950 "number": "电施02"
951 }
952 },
953 {
954 "previousLayer": "D1",
955 "currentLayer": "D1",
956 "id": "53410",
957 "previousFrame": {
958 "id": "3",
959 "name": "一层电气平面(一)",
960 "number": "电施02"
961 },
962 "currentFrame": {
963 "id": "3",
964 "name": "一层电气平面(一)",
965 "number": "电施02"
966 }
967 },
968 {
969 "previousLayer": "D1",
970 "currentLayer": "D1",
971 "id": "53411",
972 "previousFrame": {
973 "id": "3",
974 "name": "一层电气平面(一)",
975 "number": "电施02"
976 },
977 "currentFrame": {
978 "id": "3",
979 "name": "一层电气平面(一)",
980 "number": "电施02"
981 }
982 },
983 {
984 "previousLayer": "0",
985 "currentLayer": "0",
986 "id": "104782",
987 "previousFrame": {
988 "id": "2",
989 "name": "电气抗震设计专篇",
990 "number": "电施01"
991 },
992 "currentFrame": {
993 "id": "2",
994 "name": "电气抗震设计专篇",
995 "number": "电施01"
996 }
997 },
998 {
999 "previousLayer": "0",
1000 "currentLayer": "0",
1001 "id": "96096",
1002 "previousFrame": {
1003 "id": "2",
1004 "name": "电气抗震设计专篇",
1005 "number": "电施01"
1006 },
1007 "currentFrame": {
1008 "id": "2",
1009 "name": "电气抗震设计专篇",
1010 "number": "电施01"
1011 }
1012 },
1013 {
1014 "previousLayer": "0",
1015 "currentLayer": "0",
1016 "id": "104778",
1017 "previousFrame": {
1018 "id": "2",
1019 "name": "电气抗震设计专篇",
1020 "number": "电施01"
1021 },
1022 "currentFrame": {
1023 "id": "2",
1024 "name": "电气抗震设计专篇",
1025 "number": "电施01"
1026 }
1027 },
1028 {
1029 "previousLayer": "0",
1030 "currentLayer": "0",
1031 "id": "96100",
1032 "previousFrame": {
1033 "id": "2",
1034 "name": "电气抗震设计专篇",
1035 "number": "电施01"
1036 },
1037 "currentFrame": {
1038 "id": "2",
1039 "name": "电气抗震设计专篇",
1040 "number": "电施01"
1041 }
1042 },
1043 {
1044 "previousLayer": "0",
1045 "currentLayer": "0",
1046 "id": "96102",
1047 "previousFrame": {
1048 "id": "2",
1049 "name": "电气抗震设计专篇",
1050 "number": "电施01"
1051 },
1052 "currentFrame": {
1053 "id": "2",
1054 "name": "电气抗震设计专篇",
1055 "number": "电施01"
1056 }
1057 },
1058 {
1059 "previousLayer": "0",
1060 "currentLayer": "0",
1061 "id": "104780",
1062 "previousFrame": {
1063 "id": "2",
1064 "name": "电气抗震设计专篇",
1065 "number": "电施01"
1066 },
1067 "currentFrame": {
1068 "id": "2",
1069 "name": "电气抗震设计专篇",
1070 "number": "电施01"
1071 }
1072 },
1073 {
1074 "previousLayer": "0",
1075 "currentLayer": "0",
1076 "id": "104781",
1077 "previousFrame": {
1078 "id": "2",
1079 "name": "电气抗震设计专篇",
1080 "number": "电施01"
1081 },
1082 "currentFrame": {
1083 "id": "2",
1084 "name": "电气抗震设计专篇",
1085 "number": "电施01"
1086 }
1087 },
1088 {
1089 "previousLayer": "0",
1090 "currentLayer": "0",
1091 "id": "104784",
1092 "previousFrame": {
1093 "id": "2",
1094 "name": "电气抗震设计专篇",
1095 "number": "电施01"
1096 },
1097 "currentFrame": {
1098 "id": "2",
1099 "name": "电气抗震设计专篇",
1100 "number": "电施01"
1101 }
1102 },
1103 {
1104 "previousLayer": "0",
1105 "currentLayer": "0",
1106 "id": "104787",
1107 "previousFrame": {
1108 "id": "2",
1109 "name": "电气抗震设计专篇",
1110 "number": "电施01"
1111 },
1112 "currentFrame": {
1113 "id": "2",
1114 "name": "电气抗震设计专篇",
1115 "number": "电施01"
1116 }
1117 }
1118 ]
1119 }
1120 }
参数说明
计算差异来自哪个图框
通过 GetDrawingCompareDiff() 接口获取的结果中包含的差异类型 diffType 、id 与 GetDrawingCompareDatabageDiffResult()接口获取的结果中的 additions、deletions、modifications 对象以及对象属性ID 对比,即可知道变更项来自哪个图框。关联关系如下图:
参考下面的计算逻辑
1 ///
4 /// 图纸节点
5 /// 对比ID
6 /// 对比差异结果
7 private void CalcaDiffTK(Node node_Child, long compareId, string diffResult)
8 {
9 DrawingCompareDiffResponse diffResponse =
10 BIMFace.SDK.CSharp.Common.Extensions.CommonExtension.DeserializeJsonToObject
11 if (diffResponse != null)
12 {
13 if (diffResponse.Code == "success" && diffResponse.Data != null)
14 {
15 List
16 List
17 List
18 DrawingCompareDiff[] diffData = diffResponse.Data.Data;
19 if (diffData != null && diffData.Length > 0)
20 {
21 // diffData 中有重复的数据(包含模型、布局),需要 DistinctBy() 去重
22 diffNews =
23 diffData.Where(x => x.DiffType == ModelCompareDiffType.NEW.ToString())
24 .Select(x => new BIMCompareDiffDetail
25 {
26 categoryName = "",
27 elementId = x.Id,
28 elementName = ""
29 }).DistinctBy(x => x.elementId).ToList();
30
31 diffChanges =
32 diffData.Where(x => x.DiffType == ModelCompareDiffType.CHANGE.ToString())
33 .Select(x => new BIMCompareDiffDetail
34 {
35 categoryName = "",
36 elementId = x.Id,
37 elementName = ""
38 }).DistinctBy(x => x.elementId).ToList();
39
40 diffDeletes =
41 diffData.Where(x => x.DiffType == ModelCompareDiffType.DELETE.ToString())
42 .Select(x => new BIMCompareDiffDetail
43 {
44 categoryName = "",
45 elementId = x.Id,
46 elementName = ""
47 }).DistinctBy(x => x.elementId).ToList();
48
49 SimpleResult
50 if (compareDatabagDiffResult.ResultCode)
51 {
52 if (string.IsNullOrWhiteSpace(compareDatabagDiffResult.ResultObject) == false)
53 {
54 DrawingCompareDatabagDiffResult objCompareDatabagDiffResult =
55 BIMFace.SDK.CSharp.Common.Extensions.CommonExtension.DeserializeJsonToObject
56 if (objCompareDatabagDiffResult.Model != null)
57 {
58 if (objCompareDatabagDiffResult.Model.Additions != null &&
59 objCompareDatabagDiffResult.Model.Additions.Count > 0)
60 {
61 foreach (var item in diffNews)
62 {
63 var addition = objCompareDatabagDiffResult.Model.Additions.Where(x => x.Id == item.elementId).FirstOrDefault();
64 if (addition != null)
65 {
66 string diffItemFromTK = "【新增构建】" + addition.Frame ?? string.Empty;//图框名称
67
68 // 其他业务逻辑
69 }
70 }
71 }
72
73 if (objCompareDatabagDiffResult.Model.Modifications != null &&
74 objCompareDatabagDiffResult.Model.Modifications.Count > 0)
75 {
76 foreach (var item in diffChanges)
77 {
78 var modifications = objCompareDatabagDiffResult.Model.Modifications.Where(x => x.Id == item.elementId).FirstOrDefault();
79 if (modifications != null)
80 {
81 string diffItemFromTK = "【修改构建】" + addition.Frame ?? string.Empty;//图框名称
82
83 // 其他业务逻辑
84 }
85 }
86 }
87
88
89 if (objCompareDatabagDiffResult.Model.Deletions != null &&
90 objCompareDatabagDiffResult.Model.Deletions.Count > 0)
91 {
92 foreach (var item in diffDeletes)
93 {
94 var deletions = objCompareDatabagDiffResult.Model.Deletions.Where(x => x.Id == item.elementId).FirstOrDefault();
95 if (deletions != null)
96 {
97 string diffItemFromTK = "【删除构建】" + addition.Frame ?? string.Empty;//图框名称
98
99 // 其他业务逻辑
100 }
101 }
102 }
103 }
104 }
105 }
106 }
107 }
108 }
109 }
1 public class BIMCompareDiffDetail
2 {
3 ///
6 public string categoryName { get; set; }
7
8 ///
11 public string elementId { get; set; }
12
13 ///
16 public string elementName { get; set; }
17 }
上述测试程序使用了 《BIMFace.SDK.CSharp》开源SDK。欢迎大家下载使用。
*BIMFACE二次开发系列目录 【已更新最新开发文章,点击查看详细】*
手机扫一扫
移动阅读更方便
你可能感兴趣的文章