mxcad 1.0.354 → 1.0.355

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mxcad.d.ts CHANGED
@@ -2723,7 +2723,7 @@ export declare class MxCADUtilityClass {
2723
2723
  console.log(objIds);
2724
2724
  * ```
2725
2725
  */
2726
- getCurrentSelect(filter?: MxCADResbuf | null, returnMxCADObject?: boolean, returnMxDrawObject?: boolean, whenEmptyReturnPrvSelect?: boolean, isFilterLockLayer?: boolean): McObjectId[];
2726
+ getCurrentSelect(filter?: MxCADResbuf | null | Object, returnMxCADObject?: boolean, returnMxDrawObject?: boolean, whenEmptyReturnPrvSelect?: boolean, isFilterLockLayer?: boolean): McObjectId[];
2727
2727
  /** 用户选择
2728
2728
  * @param strPrompt 字符串提示
2729
2729
  * @param filter 过滤对象
@@ -2737,7 +2737,7 @@ export declare class MxCADUtilityClass {
2737
2737
  console.log(aryId);
2738
2738
  * ```
2739
2739
  * */
2740
- userSelect(strPrompt?: string, filter?: MxCADResbuf | null, init?: (ss: MxCADSelectionSet, getPoint: MrxDbgUiPrPoint) => any, isRetCurrentSelect?: boolean, isFilterLockLayer?: boolean): Promise<McObjectId[]>;
2740
+ userSelect(strPrompt?: string | Object, filter?: MxCADResbuf | null, init?: (ss: MxCADSelectionSet, getPoint: MrxDbgUiPrPoint) => any, isRetCurrentSelect?: boolean, isFilterLockLayer?: boolean): Promise<McObjectId[]>;
2741
2741
  /**
2742
2742
  * 初始化
2743
2743
  * @example
@@ -3107,7 +3107,7 @@ export declare class MxCADSelectionSet extends McRxObject {
3107
3107
  console.log(ids);
3108
3108
  * ```
3109
3109
  * */
3110
- userSelect(strPrompt?: string, filter?: MxCADResbuf | null, init?: (getPoint: MrxDbgUiPrPoint) => any): Promise<boolean>;
3110
+ userSelect(strPrompt?: string | Object, filter?: MxCADResbuf | null, init?: (getPoint: MrxDbgUiPrPoint) => any): Promise<boolean>;
3111
3111
  fenceSelect(strPrompt?: string, filter?: MxCADResbuf | null, init?: (getPoint: MrxDbgUiPrPoint) => any): Promise<boolean>;
3112
3112
  }
3113
3113
  /** MxCADUiPrBase 作为 MxCADUiPr* 系列的基类,提供了一些基础的功能。 */
@@ -11948,6 +11948,12 @@ export declare class McObject {
11948
11948
  * ```
11949
11949
  */
11950
11950
  newFile(): boolean;
11951
+ /**
11952
+ * 当回当前打开的文件的在md5码。
11953
+ * @example
11954
+ * ```
11955
+ */
11956
+ getCurrentOpenFileMd5(): string;
11951
11957
  /**
11952
11958
  * 插件图块文件
11953
11959
  * @param sFileUrl 网络文件路径 该文件为mxweb格式
package/dist/mxcad.es.js CHANGED
@@ -15080,7 +15080,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
15080
15080
  return MxG2312Obj.decodeFromGb2312Imp(hexstr);
15081
15081
  };
15082
15082
 
15083
- const version$1 = "1.0.353";
15083
+ const version$1 = "1.0.354";
15084
15084
 
15085
15085
  var isSharedArrayBuffer = "SharedArrayBuffer" in window;
15086
15086
  var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
@@ -16130,6 +16130,26 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
16130
16130
  var returnMxDrawObject = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
16131
16131
  var whenEmptyReturnPrvSelect = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
16132
16132
  var isFilterLockLayer = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
16133
+ if (filter !== null && !(filter instanceof MxCADResbuf)) {
16134
+ var param = filter;
16135
+ if (param["filter"] !== void 0) {
16136
+ filter = param["filter"];
16137
+ } else {
16138
+ filter = null;
16139
+ }
16140
+ if (param["returnMxCADObject"] !== void 0) {
16141
+ returnMxCADObject = param["returnMxCADObject"];
16142
+ }
16143
+ if (param["returnMxDrawObject"] !== void 0) {
16144
+ returnMxDrawObject = param["returnMxDrawObject"];
16145
+ }
16146
+ if (param["whenEmptyReturnPrvSelect"] !== void 0) {
16147
+ whenEmptyReturnPrvSelect = param["whenEmptyReturnPrvSelect"];
16148
+ }
16149
+ if (param["isFilterLockLayer"] !== void 0) {
16150
+ isFilterLockLayer = param["isFilterLockLayer"];
16151
+ }
16152
+ }
16133
16153
  var aryRetId = [];
16134
16154
  if (returnMxDrawObject) {
16135
16155
  var aryId = MxFun.getCurrentDraw().getMxCurrentSelect(whenEmptyReturnPrvSelect);
@@ -16171,6 +16191,7 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
16171
16191
  init,
16172
16192
  isRetCurrentSelect,
16173
16193
  isFilterLockLayer,
16194
+ param,
16174
16195
  aryRetId,
16175
16196
  ss,
16176
16197
  _args2 = arguments;
@@ -16181,33 +16202,53 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
16181
16202
  init = _args2.length > 2 ? _args2[2] : undefined;
16182
16203
  isRetCurrentSelect = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : true;
16183
16204
  isFilterLockLayer = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;
16205
+ if (strPrompt && strPrompt instanceof Object) {
16206
+ param = strPrompt;
16207
+ if (param["strPrompt"] !== void 0) {
16208
+ strPrompt = param["strPrompt"];
16209
+ } else {
16210
+ strPrompt = void 0;
16211
+ }
16212
+ if (param["filter"] !== void 0) {
16213
+ filter = param["filter"];
16214
+ }
16215
+ if (param["init"] !== void 0) {
16216
+ init = param["init"];
16217
+ }
16218
+ if (param["isRetCurrentSelect"] !== void 0) {
16219
+ isRetCurrentSelect = param["isRetCurrentSelect"];
16220
+ }
16221
+ if (param["isFilterLockLayer"] !== void 0) {
16222
+ isFilterLockLayer = param["isFilterLockLayer"];
16223
+ }
16224
+ }
16184
16225
  aryRetId = [];
16185
16226
  if (isRetCurrentSelect) {
16186
16227
  aryRetId = this.getCurrentSelect(filter, true, true, true, isFilterLockLayer);
16187
16228
  }
16188
16229
  if (!(aryRetId.length == 0)) {
16189
- _context2.next = 13;
16230
+ _context2.next = 14;
16190
16231
  break;
16191
16232
  }
16192
16233
  ss = new MxCADSelectionSet();
16193
16234
  ss.isFilterLockLayer = isFilterLockLayer;
16194
- _context2.next = 11;
16235
+ _context2.next = 12;
16195
16236
  return ss.userSelect(strPrompt, filter, function (getPoint) {
16196
16237
  init && init(ss, getPoint);
16197
16238
  });
16198
- case 11:
16239
+ case 12:
16199
16240
  if (!_context2.sent) {
16200
- _context2.next = 13;
16241
+ _context2.next = 14;
16201
16242
  break;
16202
16243
  }
16203
16244
  ss.forEach(function (val) {
16204
16245
  aryRetId.push(val);
16205
16246
  });
16206
- case 13:
16247
+ case 14:
16207
16248
  return _context2.abrupt("return", new Promise(function (resolve) {
16208
16249
  resolve(aryRetId);
16209
16250
  }));
16210
- case 14:
16251
+ case 15:
16211
16252
  case "end":
16212
16253
  return _context2.stop();
16213
16254
  }
@@ -16586,6 +16627,7 @@ var MxCADSelectionSet = /*#__PURE__*/function (_McRxObject2) {
16586
16627
  var _userSelect2 = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee4(strPrompt) {
16587
16628
  var filter,
16588
16629
  init,
16630
+ param,
16589
16631
  getPoint,
16590
16632
  retcode,
16591
16633
  filterImp,
@@ -16599,6 +16641,20 @@ var MxCADSelectionSet = /*#__PURE__*/function (_McRxObject2) {
16599
16641
  case 0:
16600
16642
  filter = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : null;
16601
16643
  init = _args4.length > 2 ? _args4[2] : undefined;
16644
+ if (strPrompt && strPrompt instanceof Object) {
16645
+ param = strPrompt;
16646
+ if (param["strPrompt"] !== void 0) {
16647
+ strPrompt = param["strPrompt"];
16648
+ } else {
16649
+ strPrompt = void 0;
16650
+ }
16651
+ if (param["filter"] !== void 0) {
16652
+ filter = param["filter"];
16653
+ }
16654
+ if (param["init"] !== void 0) {
16655
+ init = param["init"];
16656
+ }
16657
+ }
16602
16658
  this.selectPoints = [];
16603
16659
  getPoint = new MrxDbgUiPrPoint();
16604
16660
  if (strPrompt) {
@@ -16611,73 +16667,73 @@ var MxCADSelectionSet = /*#__PURE__*/function (_McRxObject2) {
16611
16667
  retcode = 0;
16612
16668
  init && init(getPoint);
16613
16669
  filterImp = getFilterImp(filter);
16614
- case 12:
16670
+ case 13:
16615
16671
  getPoint.setDynamicInputType(DynamicInputType.kDynTip);
16616
16672
  getPoint.setInputToucheType(MxType.InputToucheType.kGetBegan);
16617
- _context4.next = 17;
16673
+ _context4.next = 18;
16618
16674
  return getPoint.go();
16619
- case 17:
16675
+ case 18:
16620
16676
  pt1 = _context4.sent;
16621
16677
  getPoint.clearLastInputPoint();
16622
16678
  retcode = getPoint.getDetailedResult();
16623
16679
  if (pt1) {
16624
- _context4.next = 22;
16680
+ _context4.next = 23;
16625
16681
  break;
16626
16682
  }
16627
- return _context4.abrupt("break", 43);
16628
- case 22:
16683
+ return _context4.abrupt("break", 44);
16684
+ case 23:
16629
16685
  pt1CAD = MxCoordConvert.doc2cad1(pt1);
16630
16686
  if (!(this.imp.userPointSelect(pt1CAD.x, pt1CAD.y, filterImp, this.isSelectHighlight) == 0 /* kSelected */)) {
16631
- _context4.next = 30;
16687
+ _context4.next = 31;
16632
16688
  break;
16633
16689
  }
16634
16690
  this.selectPoints.push(pt1CAD.clone());
16635
16691
  if (!this.isWhileSelect) {
16636
- _context4.next = 29;
16692
+ _context4.next = 30;
16637
16693
  break;
16638
16694
  }
16639
- return _context4.abrupt("continue", 12);
16640
- case 29:
16641
- return _context4.abrupt("break", 43);
16695
+ return _context4.abrupt("continue", 13);
16642
16696
  case 30:
16643
- _context4.next = 32;
16697
+ return _context4.abrupt("break", 44);
16698
+ case 31:
16699
+ _context4.next = 33;
16644
16700
  return MrxDbgUtils.getCorner(pt1, strPrompt, true, function (ret) {
16645
16701
  retcode = ret.detailedResult;
16646
16702
  });
16647
- case 32:
16703
+ case 33:
16648
16704
  pt2 = _context4.sent;
16649
16705
  if (pt2) {
16650
- _context4.next = 35;
16706
+ _context4.next = 36;
16651
16707
  break;
16652
16708
  }
16653
- return _context4.abrupt("break", 43);
16654
- case 35:
16709
+ return _context4.abrupt("break", 44);
16710
+ case 36:
16655
16711
  pt2CAD = MxCoordConvert.doc2cad1(pt2);
16656
16712
  this.imp.userSelect(pt1CAD.x, pt1CAD.y, pt2CAD.x, pt2CAD.y, filterImp, this.isSelectHighlight);
16657
16713
  this.selectPoints.push(pt1CAD.clone());
16658
16714
  this.selectPoints.push(pt2CAD.clone());
16659
16715
  if (this.isWhileSelect) {
16660
- _context4.next = 41;
16716
+ _context4.next = 42;
16661
16717
  break;
16662
16718
  }
16663
- return _context4.abrupt("break", 43);
16664
- case 41:
16665
- _context4.next = 12;
16719
+ return _context4.abrupt("break", 44);
16720
+ case 42:
16721
+ _context4.next = 13;
16666
16722
  break;
16667
- case 43:
16723
+ case 44:
16668
16724
  if (this.isSelectHighlight) this.imp.highlightEntity(false);
16669
16725
  if (!(retcode == DetailedResult.kEcsIn || retcode == DetailedResult.kNewCommadIn || retcode == DetailedResult.kUnknown)) {
16670
- _context4.next = 48;
16726
+ _context4.next = 49;
16671
16727
  break;
16672
16728
  }
16673
16729
  return _context4.abrupt("return", new Promise(function (resolve) {
16674
16730
  resolve(false);
16675
16731
  }));
16676
- case 48:
16732
+ case 49:
16677
16733
  return _context4.abrupt("return", new Promise(function (resolve) {
16678
16734
  resolve(true);
16679
16735
  }));
16680
- case 49:
16736
+ case 50:
16681
16737
  case "end":
16682
16738
  return _context4.stop();
16683
16739
  }
@@ -22578,6 +22634,11 @@ var McObject = /*#__PURE__*/function () {
22578
22634
  mxobj.clearMxCurrentSelect();
22579
22635
  return this.imp.newFile();
22580
22636
  }
22637
+ }, {
22638
+ key: "getCurrentOpenFileMd5",
22639
+ value: function getCurrentOpenFileMd5() {
22640
+ return this.imp.getCurrentOpenFileMd5();
22641
+ }
22581
22642
  }, {
22582
22643
  key: "insertBlock",
22583
22644
  value: function insertBlock(sFileUrl, sBlkName) {
@@ -40394,32 +40455,35 @@ function _Mx_Copy() {
40394
40455
  return regenerator.wrap(function _callee3$(_context3) {
40395
40456
  while (1) switch (_context3.prev = _context3.next) {
40396
40457
  case 0:
40397
- aryId = MxCADUtility.getCurrentSelect();
40458
+ aryId = MxCADUtility.getCurrentSelect({
40459
+ isFilterLockLayer: true
40460
+ });
40398
40461
  if (!(aryId.length > 0)) {
40399
40462
  _context3.next = 4;
40400
40463
  break;
40401
40464
  }
40402
- return _context3.abrupt("break", 15);
40465
+ return _context3.abrupt("break", 16);
40403
40466
  case 4:
40404
40467
  ss = new MxCADSelectionSet();
40405
- _context3.next = 7;
40468
+ ss.isFilterLockLayer = true;
40469
+ _context3.next = 8;
40406
40470
  return ss.userSelect("\n\u9009\u62E9\u590D\u5236\u5BF9\u8C61");
40407
- case 7:
40471
+ case 8:
40408
40472
  if (_context3.sent) {
40409
- _context3.next = 9;
40473
+ _context3.next = 10;
40410
40474
  break;
40411
40475
  }
40412
40476
  return _context3.abrupt("return");
40413
- case 9:
40477
+ case 10:
40414
40478
  aryId = ss.getIds();
40415
40479
  if (!(aryId.length == 0)) {
40416
- _context3.next = 12;
40480
+ _context3.next = 13;
40417
40481
  break;
40418
40482
  }
40419
40483
  return _context3.abrupt("return");
40420
- case 12:
40421
- return _context3.abrupt("break", 15);
40422
- case 15:
40484
+ case 13:
40485
+ return _context3.abrupt("break", 16);
40486
+ case 16:
40423
40487
  if (aryId.length >= 10) {
40424
40488
  retBox = MxGetMcDbEntityBoundingBox(aryId);
40425
40489
  if (retBox) {
@@ -40429,16 +40493,16 @@ function _Mx_Copy() {
40429
40493
  }
40430
40494
  getPoint = new MxCADUiPrPoint();
40431
40495
  getPoint.setMessage("\n\u6307\u5B9A\u57FA\u70B9");
40432
- _context3.next = 20;
40496
+ _context3.next = 21;
40433
40497
  return getPoint.go();
40434
- case 20:
40498
+ case 21:
40435
40499
  ptBase = _context3.sent;
40436
40500
  if (ptBase) {
40437
- _context3.next = 23;
40501
+ _context3.next = 24;
40438
40502
  break;
40439
40503
  }
40440
40504
  return _context3.abrupt("return");
40441
- case 23:
40505
+ case 24:
40442
40506
  getPoint.setMessage("\u6307\u5B9A\u79FB\u52A8\u5230\u70B9");
40443
40507
  getPoint.setBasePt(ptBase);
40444
40508
  getPoint.setUseBasePt(true);
@@ -40468,30 +40532,30 @@ function _Mx_Copy() {
40468
40532
  worldDraw.drawMcDbEntity(tmp);
40469
40533
  }
40470
40534
  });
40471
- case 27:
40472
- _context3.next = 30;
40535
+ case 28:
40536
+ _context3.next = 31;
40473
40537
  return getPoint.go();
40474
- case 30:
40538
+ case 31:
40475
40539
  ptMoveTo = _context3.sent;
40476
40540
  if (ptMoveTo) {
40477
- _context3.next = 33;
40541
+ _context3.next = 34;
40478
40542
  break;
40479
40543
  }
40480
40544
  return _context3.abrupt("return");
40481
- case 33:
40482
- i = 0;
40483
40545
  case 34:
40546
+ i = 0;
40547
+ case 35:
40484
40548
  if (!(i < aryId.length)) {
40485
- _context3.next = 43;
40549
+ _context3.next = 44;
40486
40550
  break;
40487
40551
  }
40488
40552
  entity = aryId[i].getMcDbEntity();
40489
40553
  if (entity) {
40490
- _context3.next = 38;
40554
+ _context3.next = 39;
40491
40555
  break;
40492
40556
  }
40493
- return _context3.abrupt("continue", 40);
40494
- case 38:
40557
+ return _context3.abrupt("continue", 41);
40558
+ case 39:
40495
40559
  newEnt = MxCpp.getCurrentMxCAD().drawEntity(entity).getMcDbEntity();
40496
40560
  if (newEnt) {
40497
40561
  if (newEnt instanceof McDbDimension) {
@@ -40502,14 +40566,14 @@ function _Mx_Copy() {
40502
40566
  }
40503
40567
  newEnt.move(ptBase, ptMoveTo);
40504
40568
  }
40505
- case 40:
40569
+ case 41:
40506
40570
  i++;
40507
- _context3.next = 34;
40571
+ _context3.next = 35;
40508
40572
  break;
40509
- case 43:
40510
- _context3.next = 27;
40573
+ case 44:
40574
+ _context3.next = 28;
40511
40575
  break;
40512
- case 45:
40576
+ case 46:
40513
40577
  case "end":
40514
40578
  return _context3.stop();
40515
40579
  }
@@ -41633,7 +41697,10 @@ function _Mx_Mirror() {
41633
41697
  while (1) switch (_context13.prev = _context13.next) {
41634
41698
  case 0:
41635
41699
  _context13.next = 2;
41636
- return MxCADUtility.userSelect("\u9009\u62E9\u955C\u50CF\u5BF9\u8C61");
41700
+ return MxCADUtility.userSelect({
41701
+ strPrompt: "\u9009\u62E9\u955C\u50CF\u5BF9\u8C61",
41702
+ isFilterLockLayer: true
41703
+ });
41637
41704
  case 2:
41638
41705
  aryId = _context13.sent;
41639
41706
  if (!(aryId.length == 0)) {
@@ -44473,7 +44540,7 @@ function _Mx_Extend() {
44473
44540
  isByWindow = false;
44474
44541
  isExtend = false;
44475
44542
  filter.AddMcDbEntityTypes("LINE,LWPOLYLINE,ARC");
44476
- aryId = MxCADUtility.getCurrentSelect(filter);
44543
+ aryId = MxCADUtility.getCurrentSelect(filter, true, true, true, true);
44477
44544
  if (!(aryId.length === 0)) {
44478
44545
  _context26.next = 15;
44479
44546
  break;