mxcad 1.0.378 → 1.0.379
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 +23 -3
- package/dist/mxcad.es.js +76 -7
- package/dist/mxcad.umd.js +1 -1
- package/dist/wasm/2d/mxdrawassembly_min.js +2571 -2567
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +2536 -2531
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +1 -1
package/dist/mxcad.d.ts
CHANGED
|
@@ -9246,7 +9246,7 @@ export declare class McCmColor {
|
|
|
9246
9246
|
* @example
|
|
9247
9247
|
* ```ts
|
|
9248
9248
|
* import { McCmColor } from "mxcad"
|
|
9249
|
-
*
|
|
9249
|
+
* McCmColor(red,green,blue,alpha)
|
|
9250
9250
|
* const red_color:McCmColor = new McCmColor(255, 0, 0);
|
|
9251
9251
|
*
|
|
9252
9252
|
* const colorObj = { red:0, green:255, blue:0};
|
|
@@ -12415,6 +12415,18 @@ export declare class McObject {
|
|
|
12415
12415
|
*/
|
|
12416
12416
|
getSysVarDouble(varName: string): number;
|
|
12417
12417
|
/**
|
|
12418
|
+
* 进入块编辑状态
|
|
12419
|
+
*/
|
|
12420
|
+
startBlockEdit(idBlockRecord: McObjectId): boolean;
|
|
12421
|
+
/**
|
|
12422
|
+
* 退出块编辑状态
|
|
12423
|
+
*/
|
|
12424
|
+
endBlockEdit(): boolean;
|
|
12425
|
+
/**
|
|
12426
|
+
* 当前是否正在块编辑
|
|
12427
|
+
*/
|
|
12428
|
+
isBlockEditing(): boolean;
|
|
12429
|
+
/**
|
|
12418
12430
|
* 获取系统变量的点数值
|
|
12419
12431
|
* @param varName 变量名称
|
|
12420
12432
|
* @returns 变量的点数值
|
|
@@ -13090,6 +13102,14 @@ export declare class McObject {
|
|
|
13090
13102
|
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
|
|
13091
13103
|
* mxcad.drawMText(0, -100, "控件:\\P多行文字测试", 50, 400, 0, 1);
|
|
13092
13104
|
* ```
|
|
13105
|
+
* ```ts 绘下标,下标方法
|
|
13106
|
+
* let mxcad = MxCpp.getCurrentMxCAD();
|
|
13107
|
+
* mxcad.newFile();
|
|
13108
|
+
* mxcad.drawMText(0,0,"\\A1;平方方法下标: m{\\H0.7x;\\S^2;}",15,500,0.0,7);
|
|
13109
|
+
* mxcad.drawMText(0,30,"\\A2;平方方法上标: m{\\H0.3x;\\S 2^;}",15,500,0.0,7);
|
|
13110
|
+
* mxcad.zoomAll();
|
|
13111
|
+
* mxcad.updateDisplay();
|
|
13112
|
+
* ```
|
|
13093
13113
|
*/
|
|
13094
13114
|
drawMText(dPosX: number, dPosY: number, sContents: string, dHeight: number, dWidth: number, dRotation: number, iAttachment: McDb.AttachmentPoint): McObjectId;
|
|
13095
13115
|
/**
|
|
@@ -14276,11 +14296,11 @@ export declare class MxCooperate {
|
|
|
14276
14296
|
/**
|
|
14277
14297
|
*创建协同工作
|
|
14278
14298
|
*/
|
|
14279
|
-
createWrok(retCall?: (wrokId: number) => void): number;
|
|
14299
|
+
createWrok(retCall?: (wrokId: number) => void, sWorkName?: string): number;
|
|
14280
14300
|
/**
|
|
14281
14301
|
*得到当前正在协同的工作名列表
|
|
14282
14302
|
*/
|
|
14283
|
-
getWorks(retCall: (
|
|
14303
|
+
getWorks(retCall: (works: any[]) => void): number;
|
|
14284
14304
|
/**
|
|
14285
14305
|
*创建协同工作
|
|
14286
14306
|
*/
|
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.
|
|
15083
|
+
const version$1 = "1.0.378";
|
|
15084
15084
|
|
|
15085
15085
|
var isSharedArrayBuffer = "SharedArrayBuffer" in window;
|
|
15086
15086
|
var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
|
|
@@ -23075,6 +23075,21 @@ var McObject = /*#__PURE__*/function () {
|
|
|
23075
23075
|
value: function getSysVarDouble(varName) {
|
|
23076
23076
|
return this.imp.GetSysVarDouble(varName);
|
|
23077
23077
|
}
|
|
23078
|
+
}, {
|
|
23079
|
+
key: "startBlockEdit",
|
|
23080
|
+
value: function startBlockEdit(idBlockRecord) {
|
|
23081
|
+
return this.imp.startBlockEdit(idBlockRecord.id);
|
|
23082
|
+
}
|
|
23083
|
+
}, {
|
|
23084
|
+
key: "endBlockEdit",
|
|
23085
|
+
value: function endBlockEdit() {
|
|
23086
|
+
return this.imp.endBlockEdit();
|
|
23087
|
+
}
|
|
23088
|
+
}, {
|
|
23089
|
+
key: "isBlockEditing",
|
|
23090
|
+
value: function isBlockEditing() {
|
|
23091
|
+
return this.imp.isBlockEditing();
|
|
23092
|
+
}
|
|
23078
23093
|
}, {
|
|
23079
23094
|
key: "getSysVarPoint",
|
|
23080
23095
|
value: function getSysVarPoint(varName) {
|
|
@@ -24467,7 +24482,7 @@ var MxCooperate = /*#__PURE__*/function () {
|
|
|
24467
24482
|
}
|
|
24468
24483
|
_createClass$1(MxCooperate, [{
|
|
24469
24484
|
key: "createWrok",
|
|
24470
|
-
value: function createWrok(retCall) {
|
|
24485
|
+
value: function createWrok(retCall, sWorkName) {
|
|
24471
24486
|
var win = window;
|
|
24472
24487
|
win["coordinate_createWrok"] = function (_id, param) {
|
|
24473
24488
|
win["coordinate_createWrok"] = void 0;
|
|
@@ -24479,7 +24494,8 @@ var MxCooperate = /*#__PURE__*/function () {
|
|
|
24479
24494
|
retCall && retCall(0);
|
|
24480
24495
|
}
|
|
24481
24496
|
};
|
|
24482
|
-
|
|
24497
|
+
if (!sWorkName) sWorkName = "";
|
|
24498
|
+
return this.mxcad.getImp().cooperate_createWrok(sWorkName);
|
|
24483
24499
|
}
|
|
24484
24500
|
}, {
|
|
24485
24501
|
key: "getWorks",
|
|
@@ -38474,9 +38490,10 @@ function Mx_Cooperate_OnEvent() {
|
|
|
38474
38490
|
}
|
|
38475
38491
|
function Mx_Cooperate_Create() {
|
|
38476
38492
|
var cooperate = MxCpp.mxcad.getCooperate();
|
|
38493
|
+
var workName = "TestWork";
|
|
38477
38494
|
cooperate.createWrok(function (workid) {
|
|
38478
38495
|
if (workid > 0) {
|
|
38479
|
-
console.log("create cooperate ok,work name:" + workid);
|
|
38496
|
+
console.log("create cooperate ok,work name:" + workName + ",id:" + workid);
|
|
38480
38497
|
} else {
|
|
38481
38498
|
var lErrorCode = -workid;
|
|
38482
38499
|
console.log("create cooperate failed,error code:" + lErrorCode);
|
|
@@ -38484,16 +38501,17 @@ function Mx_Cooperate_Create() {
|
|
|
38484
38501
|
console.log("create cooperate Has been created");
|
|
38485
38502
|
}
|
|
38486
38503
|
}
|
|
38487
|
-
});
|
|
38504
|
+
}, workName);
|
|
38488
38505
|
Mx_Cooperate_OnEvent();
|
|
38489
38506
|
}
|
|
38490
38507
|
function Mx_Cooperate_Join() {
|
|
38491
38508
|
var cooperate = MxCpp.mxcad.getCooperate();
|
|
38492
38509
|
cooperate.getWorks(function (works) {
|
|
38493
38510
|
if (works.length > 0) {
|
|
38494
|
-
|
|
38511
|
+
console.log(JSON.stringify(works[0]));
|
|
38512
|
+
cooperate.joinWork(works[0].work_id, function (iRet) {
|
|
38495
38513
|
if (iRet == 0) {
|
|
38496
|
-
console.log("join cooperate ok,work name:" + works[0]);
|
|
38514
|
+
console.log("join cooperate ok,work name:" + JSON.stringify(works[0]));
|
|
38497
38515
|
} else {
|
|
38498
38516
|
console.log("join cooperate failed,error code:" + iRet);
|
|
38499
38517
|
if (iRet == 17) {
|
|
@@ -46298,7 +46316,58 @@ function _Mx_PasteClipboard() {
|
|
|
46298
46316
|
}));
|
|
46299
46317
|
return _Mx_PasteClipboard.apply(this, arguments);
|
|
46300
46318
|
}
|
|
46319
|
+
function Mx_StartBlockEdit() {
|
|
46320
|
+
return _Mx_StartBlockEdit.apply(this, arguments);
|
|
46321
|
+
}
|
|
46322
|
+
function _Mx_StartBlockEdit() {
|
|
46323
|
+
_Mx_StartBlockEdit = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee28() {
|
|
46324
|
+
var retIds, id, ent;
|
|
46325
|
+
return regenerator.wrap(function _callee28$(_context38) {
|
|
46326
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
46327
|
+
case 0:
|
|
46328
|
+
_context38.next = 2;
|
|
46329
|
+
return MxCADUtility.selectEnt("\u9009\u62E9\u9700\u8981\u88AB\u7F16\u8F91\u7684\u5757\u5F15\u7528", new MxCADResbuf([DxfCode.kEntityType, "INSERT"]));
|
|
46330
|
+
case 2:
|
|
46331
|
+
retIds = _context38.sent;
|
|
46332
|
+
if (!(retIds.length == 0)) {
|
|
46333
|
+
_context38.next = 5;
|
|
46334
|
+
break;
|
|
46335
|
+
}
|
|
46336
|
+
return _context38.abrupt("return");
|
|
46337
|
+
case 5:
|
|
46338
|
+
id = retIds[0];
|
|
46339
|
+
ent = id.getMcDbEntity();
|
|
46340
|
+
if (ent instanceof McDbBlockReference) {
|
|
46341
|
+
MxCpp.mxcad.startBlockEdit(ent.blockTableRecordId);
|
|
46342
|
+
}
|
|
46343
|
+
case 8:
|
|
46344
|
+
case "end":
|
|
46345
|
+
return _context38.stop();
|
|
46346
|
+
}
|
|
46347
|
+
}, _callee28);
|
|
46348
|
+
}));
|
|
46349
|
+
return _Mx_StartBlockEdit.apply(this, arguments);
|
|
46350
|
+
}
|
|
46351
|
+
function Mx_EndBlockEdit() {
|
|
46352
|
+
return _Mx_EndBlockEdit.apply(this, arguments);
|
|
46353
|
+
}
|
|
46354
|
+
function _Mx_EndBlockEdit() {
|
|
46355
|
+
_Mx_EndBlockEdit = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee29() {
|
|
46356
|
+
return regenerator.wrap(function _callee29$(_context39) {
|
|
46357
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
46358
|
+
case 0:
|
|
46359
|
+
MxCpp.mxcad.endBlockEdit();
|
|
46360
|
+
case 1:
|
|
46361
|
+
case "end":
|
|
46362
|
+
return _context39.stop();
|
|
46363
|
+
}
|
|
46364
|
+
}, _callee29);
|
|
46365
|
+
}));
|
|
46366
|
+
return _Mx_EndBlockEdit.apply(this, arguments);
|
|
46367
|
+
}
|
|
46301
46368
|
MxFun.on("init", function () {
|
|
46369
|
+
MxFun.addCommand("Mx_StartBlockEdit", Mx_StartBlockEdit);
|
|
46370
|
+
MxFun.addCommand("Mx_EndBlockEdit", Mx_EndBlockEdit);
|
|
46302
46371
|
MxFun.addCommand("Mx_Erase", Mx_Erase);
|
|
46303
46372
|
MxFun.addCommand("Mx_Copy", Mx_Copy, MxType.MxCommandFlag.MCRX_CMD_NO_CLEAR_SELECT);
|
|
46304
46373
|
MxFun.addCommand("Mx_Move", Mx_Move, MxType.MxCommandFlag.MCRX_CMD_NO_CLEAR_SELECT);
|