mxcad 1.0.265 → 1.0.267
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/LICENSE +39 -0
- package/LICENSE_CN +38 -0
- package/dist/mxcad.d.ts +42 -3
- package/dist/mxcad.es.js +314 -37
- package/dist/mxcad.umd.js +1 -1
- package/dist/wasm/2d/mxdrawassembly_min.js +2075 -2053
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +2053 -2032
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +4 -2
- package/LICENSE.md +0 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Custom License Agreement - mxcad
|
|
2
|
+
|
|
3
|
+
Copyright © 2022 Chengdu Dream Cloud Technology Co., Ltd.
|
|
4
|
+
|
|
5
|
+
This license agreement ("Agreement") is made by and between Chengdu Dream Cloud Technology Co., Ltd. ("Licensor") and the user of the software named "mxcad" ("User"). By using the Software, User agrees to be bound by the terms and conditions set forth in this Agreement.
|
|
6
|
+
|
|
7
|
+
1. **Non-Commercial Use**: The Software is intended for non-commercial use only. Non-commercial use refers to the utilization of the Software without the intent to generate profit, including but not limited to personal learning, research, and testing. You may freely use, study, test, modify, and redistribute the source code of the Software for non-commercial purposes without any restrictions.
|
|
8
|
+
|
|
9
|
+
2. **Redistribution of Source Code**: If you redistribute the source code of the Software, you must include the original copyright notice and this License Agreement. Redistribution should also retain all existing copyright notices, trademark notices, and other legal disclaimers unchanged.
|
|
10
|
+
|
|
11
|
+
3. **Binary Files**: The compiled binary form of the Software, including but not limited to WASM, EXE, and front-end packaged resources, shall not be reverse engineered, decompiled, or disassembled. This restriction applies to all versions of the Software, including any updated or modified versions.
|
|
12
|
+
|
|
13
|
+
4. **Watermark Retention**: All watermarks, logos, and brand elements within the Software must remain intact and unaltered. Violation of this clause will result in immediate termination of this License.
|
|
14
|
+
|
|
15
|
+
5. **Commercial Use**: Unless you have entered into a separate commercial license agreement with Chengdu Dream Cloud Technology Co., Ltd. and obtained written permission, you are prohibited from using the Software for commercial purposes. If you have not signed such an agreement, you do not have the right to use the Software commercially. For inquiries about commercial licenses, please contact the Licensor for more information.
|
|
16
|
+
|
|
17
|
+
6. **Disclaimer of Warranty**: The Software is provided "AS IS" without warranty of any kind, express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the Licensor be liable for any claims, damages, or other liabilities arising out of or in connection with the Software or its use, whether based on contract, tort, or any other theory. This disclaimer does not affect any consumer rights you may have under applicable Chinese law.
|
|
18
|
+
|
|
19
|
+
7. **Commercial Licensing**: Users who have signed a purchase contract with Chengdu Dream Cloud Technology Co., Ltd. are governed by that contract if it conflicts with this License. Users who have not signed such a contract are exclusively governed by this License. Specific terms of commercial licensing, such as licensing fees and validity period, will be detailed in the commercial license agreement.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
8. ** Contact information ** : For commercial license inquiries, please contact:
|
|
23
|
+
- Chengdu Dream Cade Technology Co., LTD
|
|
24
|
+
- Address: 522, 5th Floor, Building 1, No. 1388, Middle Tianfu Avenue, High-tech Zone, Chengdu, China (Sichuan) Pilot Free Trade Zone
|
|
25
|
+
- Phone: 18784290597
|
|
26
|
+
- Email: 710714273@qq.com
|
|
27
|
+
- Customer service link: https://www.mxdraw.com/
|
|
28
|
+
|
|
29
|
+
9. **Governing Law and Dispute Resolution**: This License is governed by the laws of the People's Republic of China. Any disputes arising out of or in connection with this License shall first be resolved through friendly negotiations between the parties; if negotiations fail, either party may submit the dispute to the courts of competent jurisdiction at the location of the Licensor for litigation resolution.
|
|
30
|
+
|
|
31
|
+
10. **Amendment and Termination**:
|
|
32
|
+
- The Licensor reserves the right to amend the terms and conditions of this License at any time. Amendments will be notified to users through the official website or other appropriate means.
|
|
33
|
+
- The User may terminate this License at any time by ceasing to use the Software. Upon termination, the User must destroy all copies of the Software and any derivative works.
|
|
34
|
+
|
|
35
|
+
11. **Intellectual Property Statement**: The Software and all related intellectual property rights (including but not limited to patents, copyrights, trademarks, and trade secrets) are owned by Chengdu Dream Cloud Technology Co., Ltd. Without the written consent of the Licensor, the User may not infringe or attempt to infringe these rights in any manner.
|
|
36
|
+
|
|
37
|
+
By using the Software, you acknowledge that you have read and understood this License Agreement and agree to be bound by its terms and conditions.
|
|
38
|
+
|
|
39
|
+
Chengdu Dream Cloud Technology Co., Ltd.
|
package/LICENSE_CN
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
自定义许可证协议 - mxcad
|
|
2
|
+
|
|
3
|
+
版权所有 © 2022 成都梦想凯德科技技术有限公司
|
|
4
|
+
|
|
5
|
+
本许可证管理由成都梦想凯德科技技术有限公司(以下简称“许可方”)提供的名为"mxcad"的软件的使用。通过使用该软件,您同意遵守本许可证中规定的条款和条件。
|
|
6
|
+
|
|
7
|
+
1. **非商业用途**:本软件仅限于非商业用途使用。非商业用途是指不以盈利为目的使用软件,包括但不限于个人学习、研究和测试。您可以在非商业目的下自由地使用、研究、测试、修改及重新分发软件源代码,不受任何限制。
|
|
8
|
+
|
|
9
|
+
2. **源代码重新分发**:如果您重新分发软件的源代码,必须包含原始的版权声明和本许可证协议。重新分发时,还需保持所有原有的版权声明、商标声明和其他法律声明不变。
|
|
10
|
+
|
|
11
|
+
3. **二进制文件**:软件编译后的二进制形式,包括但不限于WASM、EXE和前端打包资源等,不得被反向工程、反编译或反汇编。这一限制适用于所有版本的软件,包括任何更新或修改后的版本。
|
|
12
|
+
|
|
13
|
+
4. **水印保留**:软件内的所有水印、徽标和品牌元素必须保持原样,不得移除或更改。违反此条款将导致立即终止本许可证。
|
|
14
|
+
|
|
15
|
+
5. **商业用途**:除非您与成都梦想凯德科技技术有限公司签订了单独的商业许可协议并获得了书面许可,否则严禁将软件用于商业用途。如果您未签署此类协议,则无权将软件用于商业用途。如需商业用途许可,请联系许可方获取详细信息。
|
|
16
|
+
|
|
17
|
+
6. **免责条款**:软件按“现状”提供,不附带任何形式的明示或暗示的保证,包括但不限于对适销性、特定用途适用性和非侵权性的保证。在任何情况下,许可方均不对因软件或其使用产生的任何索赔、损害或其他责任负责,无论是基于合同、侵权行为还是其他原因。此免责条款不影响用户根据中国法律享有的任何法定权利。
|
|
18
|
+
|
|
19
|
+
7. **商业许可**:对于已与成都梦想凯德科技技术有限公司签订购买合同的用户,若该合同与本许可证冲突,则以购买合同为准。未签订购买合同的用户受本许可证的独家管辖。商业许可的具体条款,如许可费用、有效期等,将在商业许可协议中详细说明。
|
|
20
|
+
|
|
21
|
+
8. **联系方式**:关于商业许可的查询,请联系:
|
|
22
|
+
- 成都梦想凯德科技技术有限公司
|
|
23
|
+
- 地址:中国(四川)自由贸易试验区成都高新区天府大道中段1388号1栋5层522号
|
|
24
|
+
- 电话:18784290597
|
|
25
|
+
- 邮箱:710714273@qq.com
|
|
26
|
+
- 客服链接:https://www.mxdraw.com/
|
|
27
|
+
|
|
28
|
+
9. **法律适用和争议解决**:本许可证受中华人民共和国法律管辖。因本许可证引起的或与本许可证有关的任何争议,双方应首先通过友好协商解决;协商不成时,任何一方均可将争议提交至许可方所在地有管辖权的人民法院诉讼解决。
|
|
29
|
+
|
|
30
|
+
10. **变更和终止**:
|
|
31
|
+
- 许可方有权在任何时候单方面变更本许可证的条款和条件。变更后的条款将通过官方网站或其他适当的方式通知用户。
|
|
32
|
+
- 用户可以在任何时候通过停止使用软件来终止本许可证。一旦终止,用户必须销毁所有软件副本及其衍生作品。
|
|
33
|
+
|
|
34
|
+
11. **知识产权声明**:软件及其所有相关知识产权(包括但不限于专利权、版权、商标权和商业秘密)归成都梦想凯德科技技术有限公司所有。未经许可方书面同意,用户不得以任何方式侵犯或试图侵犯这些权利。
|
|
35
|
+
|
|
36
|
+
通过使用软件,您确认已阅读并理解本许可证协议,并同意受其条款和条件的约束。
|
|
37
|
+
|
|
38
|
+
成都梦想凯德科技技术有限公司
|
package/dist/mxcad.d.ts
CHANGED
|
@@ -2652,7 +2652,7 @@ export declare class MxCADUtilityClass {
|
|
|
2652
2652
|
console.log(objIds);
|
|
2653
2653
|
* ```
|
|
2654
2654
|
*/
|
|
2655
|
-
getCurrentSelect(filter?: MxCADResbuf | null): McObjectId[];
|
|
2655
|
+
getCurrentSelect(filter?: MxCADResbuf | null, returnMxCADObject?: boolean, returnMxDrawObject?: boolean): McObjectId[];
|
|
2656
2656
|
/** 用户选择
|
|
2657
2657
|
* @param strPrompt 字符串提示
|
|
2658
2658
|
* @param filter 过滤对象
|
|
@@ -8134,6 +8134,16 @@ export declare class McDbRasterImage extends McDbEntity {
|
|
|
8134
8134
|
uCorner: McGeVector3d;
|
|
8135
8135
|
vOnPlane: McGeVector3d;
|
|
8136
8136
|
};
|
|
8137
|
+
/**
|
|
8138
|
+
* 设置保存dwg文件时,图片的宽高像素。
|
|
8139
|
+
* ```
|
|
8140
|
+
*/
|
|
8141
|
+
setDwgImageSize(width: number, height: number): boolean;
|
|
8142
|
+
/**
|
|
8143
|
+
* 返回dwg文件中的图片的宽高像素。
|
|
8144
|
+
* ```
|
|
8145
|
+
*/
|
|
8146
|
+
getDwgImageSize(): number[];
|
|
8137
8147
|
/**
|
|
8138
8148
|
* 设置图像的定义ID
|
|
8139
8149
|
* @param imageId 图像的定义 ID
|
|
@@ -9766,6 +9776,27 @@ export declare class McDbDatabase extends McRxObject {
|
|
|
9766
9776
|
* ```
|
|
9767
9777
|
*/
|
|
9768
9778
|
wblock(database: McDbDatabase, aryId: McObjectId[], ptBase?: McGePoint3d): boolean;
|
|
9779
|
+
/**
|
|
9780
|
+
* 插入图块
|
|
9781
|
+
* @example
|
|
9782
|
+
* ```ts
|
|
9783
|
+
* ```
|
|
9784
|
+
*/
|
|
9785
|
+
insert(database: McDbDatabase, sBlkName: string): McObjectId;
|
|
9786
|
+
/**
|
|
9787
|
+
* 读取文件。
|
|
9788
|
+
* @example
|
|
9789
|
+
* ```ts
|
|
9790
|
+
* ```
|
|
9791
|
+
*/
|
|
9792
|
+
readFile(sFilePath: string): boolean;
|
|
9793
|
+
/**
|
|
9794
|
+
* 保存文件。
|
|
9795
|
+
* @example
|
|
9796
|
+
* ```ts
|
|
9797
|
+
* ```
|
|
9798
|
+
*/
|
|
9799
|
+
saveAs(sFilePath: string): boolean;
|
|
9769
9800
|
/**
|
|
9770
9801
|
* 获取层表
|
|
9771
9802
|
* @example
|
|
@@ -10100,6 +10131,14 @@ export declare class McDbDatabase extends McRxObject {
|
|
|
10100
10131
|
*/
|
|
10101
10132
|
setCurrentlyTextStyle(sName: string): void;
|
|
10102
10133
|
/**
|
|
10134
|
+
* 返回当前使用的线重.
|
|
10135
|
+
*/
|
|
10136
|
+
getCurrentlyLineWeight(): McDb.LineWeight;
|
|
10137
|
+
/**
|
|
10138
|
+
* 设置当前使用的线重.
|
|
10139
|
+
*/
|
|
10140
|
+
setCurrentlyLineWeight(lineWeight: McDb.LineWeight): void;
|
|
10141
|
+
/**
|
|
10103
10142
|
* 返回当前文字样式id.
|
|
10104
10143
|
*/
|
|
10105
10144
|
getCurrentlyTextStyleId(): McObjectId;
|
|
@@ -11837,7 +11876,7 @@ export declare class McObject {
|
|
|
11837
11876
|
});
|
|
11838
11877
|
* ```
|
|
11839
11878
|
*/
|
|
11840
|
-
loadImage(imageUrl: string, call: (image: any) => void): void;
|
|
11879
|
+
loadImage(imageUrl: string, call: (image: any) => void, imageFileName?: string): void;
|
|
11841
11880
|
/**
|
|
11842
11881
|
* 绘制一个图片
|
|
11843
11882
|
* @param dPosX 图片 X 坐标
|
|
@@ -11847,7 +11886,7 @@ export declare class McObject {
|
|
|
11847
11886
|
* @param dAng 图片角度
|
|
11848
11887
|
* @param imageUrl 图片路径
|
|
11849
11888
|
*/
|
|
11850
|
-
drawImage(dPosX: number, dPosY: number, dWidth: number, dHeight: number, dAng: number, imageUrl: string, isConvertBase64?: boolean): McObjectId;
|
|
11889
|
+
drawImage(dPosX: number, dPosY: number, dWidth: number, dHeight: number, dAng: number, imageUrl: string, isConvertBase64?: boolean, dwgImageSizeWidth?: number, dwgImageSizeHeight?: number): McObjectId;
|
|
11851
11890
|
/**
|
|
11852
11891
|
* 添加一个图片定义到cad数据库中 。
|
|
11853
11892
|
* @param imageUrl 图片路径
|
package/dist/mxcad.es.js
CHANGED
|
@@ -14186,7 +14186,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
|
|
|
14186
14186
|
return MxG2312Obj.decodeFromGb2312(hexstr);
|
|
14187
14187
|
};
|
|
14188
14188
|
|
|
14189
|
-
const version$1 = "1.0.
|
|
14189
|
+
const version$1 = "1.0.267";
|
|
14190
14190
|
|
|
14191
14191
|
var isSharedArrayBuffer = ("SharedArrayBuffer" in window);
|
|
14192
14192
|
var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
|
|
@@ -15099,32 +15099,38 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
|
|
|
15099
15099
|
key: "getCurrentSelect",
|
|
15100
15100
|
value: function getCurrentSelect() {
|
|
15101
15101
|
var filter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
15102
|
+
var returnMxCADObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
15103
|
+
var returnMxDrawObject = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
15102
15104
|
var aryRetId = [];
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
if (aryMxCADId.length <= 0) {
|
|
15109
|
-
return aryRetId;
|
|
15105
|
+
if (returnMxDrawObject) {
|
|
15106
|
+
var aryId = MxFun.getCurrentDraw().getMxCurrentSelect();
|
|
15107
|
+
aryId.forEach(function (val) {
|
|
15108
|
+
aryRetId.push(new McObjectId(val, McObjectIdType.kMxDraw));
|
|
15109
|
+
});
|
|
15110
15110
|
}
|
|
15111
|
-
if (
|
|
15112
|
-
var
|
|
15111
|
+
if (returnMxCADObject) {
|
|
15112
|
+
var aryMxCADId = MxFun.getCurrentDraw().getMxCADCurrentSelect();
|
|
15113
|
+
if (aryMxCADId.length <= 0) {
|
|
15114
|
+
return aryRetId;
|
|
15115
|
+
}
|
|
15116
|
+
if (filter) {
|
|
15117
|
+
var _aryId = new McGeLongArray();
|
|
15118
|
+
aryMxCADId.forEach(function (val) {
|
|
15119
|
+
_aryId.append(val);
|
|
15120
|
+
});
|
|
15121
|
+
var ssimp = new MxCpp.mxcadassemblyimp.McDrawSelSet();
|
|
15122
|
+
var aryOutId = ssimp.getFilterEntity(_aryId.imp, getFilterImp(filter));
|
|
15123
|
+
MxCpp.App.destroyObject(ssimp);
|
|
15124
|
+
aryMxCADId = [];
|
|
15125
|
+
var len = aryOutId.length();
|
|
15126
|
+
for (var k = 0; k < len; k++) {
|
|
15127
|
+
aryMxCADId.push(aryOutId.at(k));
|
|
15128
|
+
}
|
|
15129
|
+
}
|
|
15113
15130
|
aryMxCADId.forEach(function (val) {
|
|
15114
|
-
|
|
15131
|
+
aryRetId.push(new McObjectId(val, McObjectIdType.kMxCAD));
|
|
15115
15132
|
});
|
|
15116
|
-
var ssimp = new MxCpp.mxcadassemblyimp.McDrawSelSet();
|
|
15117
|
-
var aryOutId = ssimp.getFilterEntity(aryId2.imp, getFilterImp(filter));
|
|
15118
|
-
MxCpp.App.destroyObject(ssimp);
|
|
15119
|
-
aryMxCADId = [];
|
|
15120
|
-
var len = aryOutId.length();
|
|
15121
|
-
for (var k = 0; k < len; k++) {
|
|
15122
|
-
aryMxCADId.push(aryOutId.at(k));
|
|
15123
|
-
}
|
|
15124
15133
|
}
|
|
15125
|
-
aryMxCADId.forEach(function (val) {
|
|
15126
|
-
aryRetId.push(new McObjectId(val, McObjectIdType.kMxCAD));
|
|
15127
|
-
});
|
|
15128
15134
|
return aryRetId;
|
|
15129
15135
|
}
|
|
15130
15136
|
}, {
|
|
@@ -17822,6 +17828,17 @@ var McDbRasterImage = /*#__PURE__*/function (_McDbEntity9) {
|
|
|
17822
17828
|
vOnPlane: pt2
|
|
17823
17829
|
};
|
|
17824
17830
|
}
|
|
17831
|
+
}, {
|
|
17832
|
+
key: "setDwgImageSize",
|
|
17833
|
+
value: function setDwgImageSize(width, height) {
|
|
17834
|
+
return this.imp.setImageSize(width, height);
|
|
17835
|
+
}
|
|
17836
|
+
}, {
|
|
17837
|
+
key: "getDwgImageSize",
|
|
17838
|
+
value: function getDwgImageSize() {
|
|
17839
|
+
var size = this.imp.getImageSize();
|
|
17840
|
+
return [size.x, size.y];
|
|
17841
|
+
}
|
|
17825
17842
|
}, {
|
|
17826
17843
|
key: "setImageDefId",
|
|
17827
17844
|
value: function setImageDefId(imageId) {
|
|
@@ -19337,6 +19354,22 @@ var McDbDatabase = /*#__PURE__*/function (_McRxObject) {
|
|
|
19337
19354
|
});
|
|
19338
19355
|
return this.imp.wblock(database.getImp(), ids.imp, ptBase.imp);
|
|
19339
19356
|
}
|
|
19357
|
+
}, {
|
|
19358
|
+
key: "insert",
|
|
19359
|
+
value: function insert(database, sBlkName) {
|
|
19360
|
+
var sHexBlkName = MxG2312Obj.encodeToGb2312(sBlkName);
|
|
19361
|
+
return new McObjectId(this.imp.insert(database.getImp(), sHexBlkName), McObjectIdType.kMxCAD);
|
|
19362
|
+
}
|
|
19363
|
+
}, {
|
|
19364
|
+
key: "readFile",
|
|
19365
|
+
value: function readFile(sFilePath) {
|
|
19366
|
+
return this.imp.readFile(sFilePath);
|
|
19367
|
+
}
|
|
19368
|
+
}, {
|
|
19369
|
+
key: "saveAs",
|
|
19370
|
+
value: function saveAs(sFilePath) {
|
|
19371
|
+
return this.imp.saveAs(sFilePath);
|
|
19372
|
+
}
|
|
19340
19373
|
}, {
|
|
19341
19374
|
key: "layerTable",
|
|
19342
19375
|
get: function get() {
|
|
@@ -19494,6 +19527,16 @@ var McDbDatabase = /*#__PURE__*/function (_McRxObject) {
|
|
|
19494
19527
|
var sHex = MxG2312Obj.encodeToGb2312(sName);
|
|
19495
19528
|
this.imp.SetCurrentlyTextStyle(sHex);
|
|
19496
19529
|
}
|
|
19530
|
+
}, {
|
|
19531
|
+
key: "getCurrentlyLineWeight",
|
|
19532
|
+
value: function getCurrentlyLineWeight() {
|
|
19533
|
+
return this.imp.GetCurrentlyLineWeight();
|
|
19534
|
+
}
|
|
19535
|
+
}, {
|
|
19536
|
+
key: "setCurrentlyLineWeight",
|
|
19537
|
+
value: function setCurrentlyLineWeight(lineWeight) {
|
|
19538
|
+
return this.imp.SetCurrentlyLineWeight(lineWeight);
|
|
19539
|
+
}
|
|
19497
19540
|
}, {
|
|
19498
19541
|
key: "getCurrentlyTextStyleId",
|
|
19499
19542
|
value: function getCurrentlyTextStyleId() {
|
|
@@ -20894,13 +20937,16 @@ var McObject = /*#__PURE__*/function () {
|
|
|
20894
20937
|
}, {
|
|
20895
20938
|
key: "loadImage",
|
|
20896
20939
|
value: function loadImage(imageUrl, call) {
|
|
20897
|
-
|
|
20940
|
+
var imageFileName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
20941
|
+
this.imp["mxdrawObject"].getMxObjectImplement().loadMxCADImage(imageUrl, call, imageFileName);
|
|
20898
20942
|
}
|
|
20899
20943
|
}, {
|
|
20900
20944
|
key: "drawImage",
|
|
20901
20945
|
value: function drawImage(dPosX, dPosY, dWidth, dHeight, dAng, imageUrl) {
|
|
20902
20946
|
var isConvertBase64 = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
20903
|
-
|
|
20947
|
+
var dwgImageSizeWidth = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
|
|
20948
|
+
var dwgImageSizeHeight = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
20949
|
+
return new McObjectId(this.imp.DrawImage(dPosX, dPosY, dWidth, dHeight, dAng, MxG2312Obj.encodeToGb2312(imageUrl), isConvertBase64, dwgImageSizeWidth, dwgImageSizeHeight));
|
|
20904
20950
|
}
|
|
20905
20951
|
}, {
|
|
20906
20952
|
key: "addImageDefine",
|
|
@@ -21169,17 +21215,17 @@ var McObject = /*#__PURE__*/function () {
|
|
|
21169
21215
|
key: "getCurrentDatabaseDrawColor",
|
|
21170
21216
|
value: function getCurrentDatabaseDrawColor() {
|
|
21171
21217
|
var ary = this.getDatabase().getImp().GetCurrentlyDrawColor();
|
|
21172
|
-
var
|
|
21218
|
+
var lWhiteViewColor = this.getMxDrawObject().isWhiteViewColor();
|
|
21173
21219
|
var r = ary.at(0);
|
|
21174
21220
|
var g = ary.at(1);
|
|
21175
21221
|
var b = ary.at(2);
|
|
21176
|
-
if (
|
|
21222
|
+
if (lWhiteViewColor) {
|
|
21177
21223
|
if (r == 255 && g == 255 && b == 255) {
|
|
21178
21224
|
r = 0;
|
|
21179
21225
|
g = 0;
|
|
21180
21226
|
b = 0;
|
|
21181
21227
|
}
|
|
21182
|
-
} else
|
|
21228
|
+
} else {
|
|
21183
21229
|
if (r == 0 && g == 0 && b == 0) {
|
|
21184
21230
|
r = 255;
|
|
21185
21231
|
g = 255;
|
|
@@ -28774,7 +28820,10 @@ function _drawEllipticalArc() {
|
|
|
28774
28820
|
getDist.setKeyWords("");
|
|
28775
28821
|
getDist.setBasePt(center);
|
|
28776
28822
|
getDist.setUserDraw(function (pt, pw) {
|
|
28777
|
-
|
|
28823
|
+
var dx = Math.abs(pt.x - center.x);
|
|
28824
|
+
var dy = Math.abs(pt.y - center.y);
|
|
28825
|
+
var ratio = dx / (dx + dy);
|
|
28826
|
+
radiusRatio = ratio;
|
|
28778
28827
|
var ellipseArc = createEllipse();
|
|
28779
28828
|
pw.drawMcDbEntity(ellipseArc);
|
|
28780
28829
|
});
|
|
@@ -28791,7 +28840,7 @@ function _drawEllipticalArc() {
|
|
|
28791
28840
|
});
|
|
28792
28841
|
case 60:
|
|
28793
28842
|
if (getDist.getDetailedResult() === 8) {
|
|
28794
|
-
|
|
28843
|
+
radiusRatio = val2;
|
|
28795
28844
|
}
|
|
28796
28845
|
_context.next = 67;
|
|
28797
28846
|
break;
|
|
@@ -28815,12 +28864,13 @@ function _drawEllipticalArc() {
|
|
|
28815
28864
|
v: void 0
|
|
28816
28865
|
});
|
|
28817
28866
|
case 69:
|
|
28818
|
-
offsetAngle =
|
|
28867
|
+
offsetAngle = Math.atan2(majorAxis.y, majorAxis.x) - Math.PI / 2;
|
|
28819
28868
|
getDist.setMessage(_ML_String("McDbEllipse_startAngle", "\u6307\u5B9A\u8D77\u70B9\u89D2\u5EA6"));
|
|
28820
28869
|
getDist.setKeyWords("");
|
|
28821
28870
|
getDist.setBasePt(center);
|
|
28822
28871
|
getDist.setUserDraw(function (pt, pw) {
|
|
28823
|
-
|
|
28872
|
+
var angle = Math.atan2(pt.y - center.y, pt.x - center.x);
|
|
28873
|
+
startAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
|
|
28824
28874
|
var ellipseArc = createEllipse();
|
|
28825
28875
|
pw.drawMcDbEntity(ellipseArc);
|
|
28826
28876
|
});
|
|
@@ -28844,7 +28894,11 @@ function _drawEllipticalArc() {
|
|
|
28844
28894
|
getDist.setMessage(_ML_String("McDbEllipse_endAngle", "\u6307\u5B9A\u7AEF\u70B9\u89D2\u5EA6"));
|
|
28845
28895
|
getDist.setKeyWords("[\u5939\u89D2(I)]");
|
|
28846
28896
|
getDist.setUserDraw(function (pt, pw) {
|
|
28847
|
-
|
|
28897
|
+
var angle = Math.atan2(pt.y - center.y, pt.x - center.x);
|
|
28898
|
+
endAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
|
|
28899
|
+
if (endAngle < startAngle) {
|
|
28900
|
+
endAngle += Math.PI * 2;
|
|
28901
|
+
}
|
|
28848
28902
|
var ellipseArc = createEllipse();
|
|
28849
28903
|
pw.drawMcDbEntity(ellipseArc);
|
|
28850
28904
|
});
|
|
@@ -28948,7 +29002,7 @@ function _drawMxDbEllipse() {
|
|
|
28948
29002
|
return ellipse;
|
|
28949
29003
|
};
|
|
28950
29004
|
_loop2 = /*#__PURE__*/regenerator.mark(function _loop2() {
|
|
28951
|
-
var isGetAngle, isGetCenter, isDrawCenterArc, point, endPoint, centerPoint, point1, getDist, xRadius, drawEllipse, length, yRadius,
|
|
29005
|
+
var isGetAngle, isGetCenter, isDrawCenterArc, point, endPoint, centerPoint, point1, getDist, xRadius, drawEllipse, length, yRadius, offsetAngle, val, val1, val2, ellipse2, ellipse;
|
|
28952
29006
|
return regenerator.wrap(function _loop2$(_context3) {
|
|
28953
29007
|
while (1) switch (_context3.prev = _context3.next) {
|
|
28954
29008
|
case 0:
|
|
@@ -28989,7 +29043,7 @@ function _drawMxDbEllipse() {
|
|
|
28989
29043
|
_context3.next = 27;
|
|
28990
29044
|
break;
|
|
28991
29045
|
}
|
|
28992
|
-
getPoint.setMessage("\n\u6307\u5B9A\u692D\u5706\u4E2D\u5FC3
|
|
29046
|
+
getPoint.setMessage("\n\u6307\u5B9A\u692D\u5706\u4E2D\u5FC3");
|
|
28993
29047
|
getPoint.setKeyWords("");
|
|
28994
29048
|
_context3.next = 22;
|
|
28995
29049
|
return getPoint.go();
|
|
@@ -29074,9 +29128,10 @@ function _drawMxDbEllipse() {
|
|
|
29074
29128
|
}
|
|
29075
29129
|
getDist.setMessage(_ML_String("EllipticalArc_startAngle", "\u6307\u5B9A\u8D77\u70B9\u89D2\u5EA6"));
|
|
29076
29130
|
getDist.setKeyWords("");
|
|
29077
|
-
|
|
29131
|
+
offsetAngle = Math.atan2(majorAxis.y, majorAxis.x) - Math.PI / 2;
|
|
29078
29132
|
getDist.setUserDraw(function (currentPoint, pWorldDraw) {
|
|
29079
|
-
|
|
29133
|
+
var angle = Math.atan2(currentPoint.y - center.y, currentPoint.x - center.x);
|
|
29134
|
+
startAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
|
|
29080
29135
|
drawEllipse(currentPoint, pWorldDraw);
|
|
29081
29136
|
});
|
|
29082
29137
|
_context3.next = 60;
|
|
@@ -29098,7 +29153,11 @@ function _drawMxDbEllipse() {
|
|
|
29098
29153
|
getDist.setMessage(_ML_String("EllipticalArc_endAngle", "\u6307\u5B9A\u7AEF\u70B9\u89D2\u5EA6"));
|
|
29099
29154
|
getDist.setKeyWords("[\u5939\u89D2(I)]");
|
|
29100
29155
|
getDist.setUserDraw(function (currentPoint, pWorldDraw) {
|
|
29101
|
-
|
|
29156
|
+
var angle = Math.atan2(currentPoint.y - center.y, currentPoint.x - center.x);
|
|
29157
|
+
endAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
|
|
29158
|
+
if (endAngle < startAngle) {
|
|
29159
|
+
endAngle += Math.PI * 2;
|
|
29160
|
+
}
|
|
29102
29161
|
drawEllipse(currentPoint, pWorldDraw);
|
|
29103
29162
|
});
|
|
29104
29163
|
_context3.next = 70;
|
|
@@ -33974,6 +34033,221 @@ function _Mx_DrawOrderButtom() {
|
|
|
33974
34033
|
}));
|
|
33975
34034
|
return _Mx_DrawOrderButtom.apply(this, arguments);
|
|
33976
34035
|
}
|
|
34036
|
+
function Mx_CopyClipboardImp(_x) {
|
|
34037
|
+
return _Mx_CopyClipboardImp.apply(this, arguments);
|
|
34038
|
+
}
|
|
34039
|
+
function _Mx_CopyClipboardImp() {
|
|
34040
|
+
_Mx_CopyClipboardImp = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee27(earseEntity) {
|
|
34041
|
+
var storeName, aryId, database, writeDatabase, sClipboardDatabaseFile, FS, data, openRequest;
|
|
34042
|
+
return regenerator.wrap(function _callee27$(_context36) {
|
|
34043
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
34044
|
+
case 0:
|
|
34045
|
+
storeName = "mx_clip_file_data";
|
|
34046
|
+
aryId = MxCADUtility.getCurrentSelect(null, true, false);
|
|
34047
|
+
if (!(aryId.length == 0)) {
|
|
34048
|
+
_context36.next = 5;
|
|
34049
|
+
break;
|
|
34050
|
+
}
|
|
34051
|
+
MxFun.acutPrintf("\n \u6CA1\u6709\u590D\u5236\u7684\u5BF9\u8C61");
|
|
34052
|
+
return _context36.abrupt("return");
|
|
34053
|
+
case 5:
|
|
34054
|
+
database = MxCpp.getCurrentDatabase();
|
|
34055
|
+
writeDatabase = new McDbDatabase();
|
|
34056
|
+
if (database.wblock(writeDatabase, aryId)) {
|
|
34057
|
+
_context36.next = 10;
|
|
34058
|
+
break;
|
|
34059
|
+
}
|
|
34060
|
+
MxFun.acutPrintf("\n \u590D\u5236\u5931\u8D25");
|
|
34061
|
+
return _context36.abrupt("return");
|
|
34062
|
+
case 10:
|
|
34063
|
+
sClipboardDatabaseFile = "_mxcad_clipboard_file.mxweb";
|
|
34064
|
+
if (writeDatabase.saveAs(sClipboardDatabaseFile)) {
|
|
34065
|
+
_context36.next = 14;
|
|
34066
|
+
break;
|
|
34067
|
+
}
|
|
34068
|
+
MxFun.acutPrintf("\n \u4FDD\u5B58\u590D\u5236\u6570\u636E\u5931\u8D25");
|
|
34069
|
+
return _context36.abrupt("return");
|
|
34070
|
+
case 14:
|
|
34071
|
+
if (earseEntity) {
|
|
34072
|
+
aryId.forEach(function (id) {
|
|
34073
|
+
id.erase();
|
|
34074
|
+
});
|
|
34075
|
+
}
|
|
34076
|
+
FS = window.MX_WASM_FS;
|
|
34077
|
+
data = FS.readFile(sClipboardDatabaseFile);
|
|
34078
|
+
FS.unlink(sClipboardDatabaseFile);
|
|
34079
|
+
openRequest = indexedDB.open("mx_clipboard", 1);
|
|
34080
|
+
openRequest.onupgradeneeded = function (event) {
|
|
34081
|
+
if (event.target == null) {
|
|
34082
|
+
return;
|
|
34083
|
+
}
|
|
34084
|
+
var db = event.target.result;
|
|
34085
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
34086
|
+
db.createObjectStore(storeName);
|
|
34087
|
+
}
|
|
34088
|
+
};
|
|
34089
|
+
openRequest.onsuccess = function (e) {
|
|
34090
|
+
if (e.target == null) {
|
|
34091
|
+
return;
|
|
34092
|
+
}
|
|
34093
|
+
try {
|
|
34094
|
+
var db = e.target.result;
|
|
34095
|
+
var transaction = db.transaction(storeName, "readwrite");
|
|
34096
|
+
var store = transaction.objectStore(storeName);
|
|
34097
|
+
var addRequest = store.put(data, "data");
|
|
34098
|
+
addRequest.onsuccess = function (e2) {
|
|
34099
|
+
console.log("Data saved to IndexedDB");
|
|
34100
|
+
console.log(e2);
|
|
34101
|
+
};
|
|
34102
|
+
addRequest.onerror = function (e2) {
|
|
34103
|
+
console.error("Error saving data:", e2.target.errorCode);
|
|
34104
|
+
console.log(e2);
|
|
34105
|
+
};
|
|
34106
|
+
} catch (error) {
|
|
34107
|
+
console.log(error);
|
|
34108
|
+
}
|
|
34109
|
+
};
|
|
34110
|
+
openRequest.onerror = function (e) {
|
|
34111
|
+
console.error("Database error:", e.target.errorCode);
|
|
34112
|
+
};
|
|
34113
|
+
_context36.next = 24;
|
|
34114
|
+
return navigator.clipboard.writeText(storeName);
|
|
34115
|
+
case 24:
|
|
34116
|
+
case "end":
|
|
34117
|
+
return _context36.stop();
|
|
34118
|
+
}
|
|
34119
|
+
}, _callee27);
|
|
34120
|
+
}));
|
|
34121
|
+
return _Mx_CopyClipboardImp.apply(this, arguments);
|
|
34122
|
+
}
|
|
34123
|
+
function Mx_CopyClipboard() {
|
|
34124
|
+
Mx_CopyClipboardImp(false);
|
|
34125
|
+
}
|
|
34126
|
+
function Mx_CutClipboard() {
|
|
34127
|
+
Mx_CopyClipboardImp(true);
|
|
34128
|
+
}
|
|
34129
|
+
function getClipboardDataToFile(storeName, sWriteFile) {
|
|
34130
|
+
return new Promise(function (res) {
|
|
34131
|
+
var request = window.indexedDB.open("mx_clipboard", 1);
|
|
34132
|
+
request.onerror = function () {
|
|
34133
|
+
res(void 0);
|
|
34134
|
+
};
|
|
34135
|
+
request.onsuccess = function (event) {
|
|
34136
|
+
try {
|
|
34137
|
+
if (event.target != null) {
|
|
34138
|
+
var db = event.target.result;
|
|
34139
|
+
var transaction = db.transaction(storeName, "readonly");
|
|
34140
|
+
var objectStore = transaction.objectStore(storeName);
|
|
34141
|
+
var request2 = objectStore.get("data");
|
|
34142
|
+
request2.onerror = function () {
|
|
34143
|
+
res(void 0);
|
|
34144
|
+
};
|
|
34145
|
+
request2.onsuccess = function () {
|
|
34146
|
+
var data = request2.result;
|
|
34147
|
+
var FS = window.MX_WASM_FS;
|
|
34148
|
+
FS.writeFile(sWriteFile, data);
|
|
34149
|
+
res(true);
|
|
34150
|
+
};
|
|
34151
|
+
} else {
|
|
34152
|
+
res(void 0);
|
|
34153
|
+
}
|
|
34154
|
+
} catch (error) {
|
|
34155
|
+
res(void 0);
|
|
34156
|
+
}
|
|
34157
|
+
};
|
|
34158
|
+
});
|
|
34159
|
+
}
|
|
34160
|
+
function Mx_PasteClipboard() {
|
|
34161
|
+
return _Mx_PasteClipboard.apply(this, arguments);
|
|
34162
|
+
}
|
|
34163
|
+
function _Mx_PasteClipboard() {
|
|
34164
|
+
_Mx_PasteClipboard = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee28() {
|
|
34165
|
+
var mxcad, storeName, sClipboardDatabaseFile, readDatabase, FS, database, blkrecId, blkRec, bound, blkRef, getPoint, pt, newBlkRefId;
|
|
34166
|
+
return regenerator.wrap(function _callee28$(_context37) {
|
|
34167
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
34168
|
+
case 0:
|
|
34169
|
+
mxcad = MxCpp.getCurrentMxCAD();
|
|
34170
|
+
_context37.next = 3;
|
|
34171
|
+
return navigator.clipboard.readText();
|
|
34172
|
+
case 3:
|
|
34173
|
+
storeName = _context37.sent;
|
|
34174
|
+
if (!(!storeName || storeName.length <= 0)) {
|
|
34175
|
+
_context37.next = 7;
|
|
34176
|
+
break;
|
|
34177
|
+
}
|
|
34178
|
+
MxFun.acutPrintf("\n \u590D\u5236\u6570\u636E\u4E3A\u7A7A");
|
|
34179
|
+
return _context37.abrupt("return");
|
|
34180
|
+
case 7:
|
|
34181
|
+
sClipboardDatabaseFile = "_mxcad_clipboard_file.mxweb";
|
|
34182
|
+
_context37.next = 10;
|
|
34183
|
+
return getClipboardDataToFile(storeName, sClipboardDatabaseFile);
|
|
34184
|
+
case 10:
|
|
34185
|
+
if (_context37.sent) {
|
|
34186
|
+
_context37.next = 13;
|
|
34187
|
+
break;
|
|
34188
|
+
}
|
|
34189
|
+
MxFun.acutPrintf("\n \u5F97\u5230\u590D\u5236\u6570\u636E\u5931\u8D25");
|
|
34190
|
+
return _context37.abrupt("return");
|
|
34191
|
+
case 13:
|
|
34192
|
+
readDatabase = new McDbDatabase();
|
|
34193
|
+
if (readDatabase.readFile(sClipboardDatabaseFile)) {
|
|
34194
|
+
_context37.next = 17;
|
|
34195
|
+
break;
|
|
34196
|
+
}
|
|
34197
|
+
MxFun.acutPrintf("\n \u8BFB\u53D6\u590D\u5236\u6570\u636E\u5931\u8D25");
|
|
34198
|
+
return _context37.abrupt("return");
|
|
34199
|
+
case 17:
|
|
34200
|
+
FS = window.MX_WASM_FS;
|
|
34201
|
+
FS.unlink(sClipboardDatabaseFile);
|
|
34202
|
+
database = MxCpp.getCurrentDatabase();
|
|
34203
|
+
blkrecId = database.insert(readDatabase, "");
|
|
34204
|
+
if (!blkrecId.isNull()) {
|
|
34205
|
+
_context37.next = 23;
|
|
34206
|
+
break;
|
|
34207
|
+
}
|
|
34208
|
+
return _context37.abrupt("return");
|
|
34209
|
+
case 23:
|
|
34210
|
+
blkRec = blkrecId.getMcDbBlockTableRecord();
|
|
34211
|
+
if (blkRec) {
|
|
34212
|
+
bound = blkRec.getBoundingBox();
|
|
34213
|
+
if (bound.ret) {
|
|
34214
|
+
blkRec.origin = bound.minPt.addvec(bound.maxPt.sub(bound.minPt).mult(0.5));
|
|
34215
|
+
}
|
|
34216
|
+
}
|
|
34217
|
+
blkRef = new McDbBlockReference();
|
|
34218
|
+
blkRef.blockTableRecordId = blkrecId;
|
|
34219
|
+
getPoint = new MxCADUiPrPoint();
|
|
34220
|
+
getPoint.setMessage("\u6307\u5B9A\u63D2\u5165\u57FA\u70B9");
|
|
34221
|
+
getPoint.setUserDraw(function (v, worldDraw) {
|
|
34222
|
+
blkRef.position = v;
|
|
34223
|
+
worldDraw.drawMcDbEntity(blkRef);
|
|
34224
|
+
});
|
|
34225
|
+
_context37.next = 32;
|
|
34226
|
+
return getPoint.go();
|
|
34227
|
+
case 32:
|
|
34228
|
+
pt = _context37.sent;
|
|
34229
|
+
if (pt) {
|
|
34230
|
+
_context37.next = 35;
|
|
34231
|
+
break;
|
|
34232
|
+
}
|
|
34233
|
+
return _context37.abrupt("return");
|
|
34234
|
+
case 35:
|
|
34235
|
+
blkRef.position = pt;
|
|
34236
|
+
newBlkRefId = mxcad.drawEntity(blkRef);
|
|
34237
|
+
if (newBlkRefId.isValid) {
|
|
34238
|
+
_context37.next = 40;
|
|
34239
|
+
break;
|
|
34240
|
+
}
|
|
34241
|
+
console.log("insert error");
|
|
34242
|
+
return _context37.abrupt("return");
|
|
34243
|
+
case 40:
|
|
34244
|
+
case "end":
|
|
34245
|
+
return _context37.stop();
|
|
34246
|
+
}
|
|
34247
|
+
}, _callee28);
|
|
34248
|
+
}));
|
|
34249
|
+
return _Mx_PasteClipboard.apply(this, arguments);
|
|
34250
|
+
}
|
|
33977
34251
|
MxFun.on("init", function () {
|
|
33978
34252
|
MxFun.addCommand("Mx_Erase", Mx_Erase);
|
|
33979
34253
|
MxFun.addCommand("Mx_Copy", Mx_Copy);
|
|
@@ -33997,6 +34271,9 @@ MxFun.on("init", function () {
|
|
|
33997
34271
|
MxFun.addCommand("Mx_DrawOrderButtomost", Mx_DrawOrderButtomost);
|
|
33998
34272
|
MxFun.addCommand("Mx_DrawOrderTop", Mx_DrawOrderTop);
|
|
33999
34273
|
MxFun.addCommand("Mx_DrawOrderButtom", Mx_DrawOrderButtom);
|
|
34274
|
+
MxFun.addCommand("Mx_CopyClipboard", Mx_CopyClipboard);
|
|
34275
|
+
MxFun.addCommand("Mx_PasteClipboard", Mx_PasteClipboard);
|
|
34276
|
+
MxFun.addCommand("Mx_CutClipboard", Mx_CutClipboard);
|
|
34000
34277
|
});
|
|
34001
34278
|
|
|
34002
34279
|
var getQuadrant = function getQuadrant(pt1, pt3) {
|