mxcad 1.0.38 → 1.0.39
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 +1015 -1
- package/dist/mxcad.es.js +40 -496
- package/dist/mxcad.umd.js +60 -516
- package/dist/mxdrawassembly_min.wasm +0 -0
- package/dist/mxdrawassemblyinit.js +457 -0
- package/package.json +2 -3
- package/dist/mxdrawassembly_debug.worker.js +0 -201
- package/dist/nnn.mxweb +0 -0
- package/dist/test2.dwg +0 -0
- package/dist/test3.dwg +0 -0
- package/dist/test3.mxweb +0 -0
package/dist/mxcad.d.ts
CHANGED
|
@@ -32,21 +32,47 @@ export declare const MxTools: {
|
|
|
32
32
|
export declare function drawText(): Promise<void>;
|
|
33
33
|
/** 绘制圆*/
|
|
34
34
|
export declare function drawCircle(): void;
|
|
35
|
+
/**
|
|
36
|
+
* McDb 命名空间包含 AutoCAD 中的一些常用枚举。
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
35
39
|
export declare namespace McDb {
|
|
40
|
+
/**
|
|
41
|
+
* 文本水平对齐方式枚举。
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
36
44
|
enum TextHorzMode {
|
|
45
|
+
/** 左对齐 */
|
|
37
46
|
kTextLeft = 0,
|
|
47
|
+
/** 居中对齐 */
|
|
38
48
|
kTextCenter = 1,
|
|
49
|
+
/** 右对齐 */
|
|
39
50
|
kTextRight = 2,
|
|
51
|
+
/** 水平对齐 */
|
|
40
52
|
kTextAlign = 3,
|
|
53
|
+
/** 垂直中间对齐 */
|
|
41
54
|
kTextMid = 4,
|
|
55
|
+
/** 自适应 */
|
|
42
56
|
kTextFit = 5
|
|
43
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* 文本垂直对齐方式枚举。
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
44
62
|
enum TextVertMode {
|
|
63
|
+
/** 基线对齐 */
|
|
45
64
|
kTextBase = 0,
|
|
65
|
+
/** 底部对齐 */
|
|
46
66
|
kTextBottom = 1,
|
|
67
|
+
/** 垂直中间对齐 */
|
|
47
68
|
kTextVertMid = 2,
|
|
69
|
+
/** 顶部对齐 */
|
|
48
70
|
kTextTop = 3
|
|
49
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* 实体附着点枚举。
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
50
76
|
enum AttachmentPoint {
|
|
51
77
|
kTopLeft = 1,
|
|
52
78
|
kTopCenter = 2,
|
|
@@ -73,6 +99,10 @@ export declare namespace McDb {
|
|
|
73
99
|
kMiddleMid = 23,
|
|
74
100
|
kTopMid = 24
|
|
75
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* 线宽枚举。
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
76
106
|
enum LineWeight {
|
|
77
107
|
kLnWt000 = 0,
|
|
78
108
|
kLnWt005 = 5,
|
|
@@ -105,280 +135,1220 @@ export declare namespace McDb {
|
|
|
105
135
|
}
|
|
106
136
|
declare class MdRxObjectImp {
|
|
107
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* 表示一个颜色对象,可以通过颜色索引或 RGB 值来设置颜色。
|
|
140
|
+
*/
|
|
108
141
|
export interface MdCmColor {
|
|
142
|
+
/**
|
|
143
|
+
* 设置颜色索引。
|
|
144
|
+
* @param colorIndex 颜色索引。
|
|
145
|
+
*/
|
|
109
146
|
setColorIndex(colorIndex: number): void;
|
|
147
|
+
/**
|
|
148
|
+
* 设置 RGB 值。
|
|
149
|
+
* @param red 红色值。
|
|
150
|
+
* @param green 绿色值。
|
|
151
|
+
* @param blue 蓝色值。
|
|
152
|
+
*/
|
|
110
153
|
setRGB(red: number, green: number, blue: number): void;
|
|
154
|
+
/**
|
|
155
|
+
* 红色值。
|
|
156
|
+
*/
|
|
111
157
|
red: number;
|
|
158
|
+
/**
|
|
159
|
+
* 绿色值。
|
|
160
|
+
*/
|
|
112
161
|
green: number;
|
|
162
|
+
/**
|
|
163
|
+
* 蓝色值。
|
|
164
|
+
*/
|
|
113
165
|
blue: number;
|
|
166
|
+
/**
|
|
167
|
+
* 方法。
|
|
168
|
+
*/
|
|
114
169
|
method: number;
|
|
115
170
|
n: number;
|
|
171
|
+
/**
|
|
172
|
+
* 颜色索引。
|
|
173
|
+
*/
|
|
116
174
|
colorIndex: number;
|
|
117
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* 表示三维点的对象。
|
|
178
|
+
*/
|
|
118
179
|
export interface MdGePoint3d {
|
|
180
|
+
/**
|
|
181
|
+
* 构造函数。
|
|
182
|
+
* @param dX X 坐标。
|
|
183
|
+
* @param dY Y 坐标。
|
|
184
|
+
* @param dZ Z 坐标。
|
|
185
|
+
*/
|
|
119
186
|
constructor(dX?: number, dY?: number, dZ?: number): any;
|
|
187
|
+
/**
|
|
188
|
+
* X 坐标。
|
|
189
|
+
*/
|
|
120
190
|
x: number;
|
|
191
|
+
/**
|
|
192
|
+
* Y 坐标。
|
|
193
|
+
*/
|
|
121
194
|
y: number;
|
|
195
|
+
/**
|
|
196
|
+
* Z 坐标。
|
|
197
|
+
*/
|
|
122
198
|
z: number;
|
|
123
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* 表示一个 Rx 对象的基类。
|
|
202
|
+
*/
|
|
124
203
|
export declare class MdRxObject {
|
|
204
|
+
/**
|
|
205
|
+
* 内部实现对象。
|
|
206
|
+
*/
|
|
125
207
|
protected imp: any;
|
|
208
|
+
/**
|
|
209
|
+
* 构造函数。
|
|
210
|
+
* @param imp 内部实现对象。
|
|
211
|
+
*/
|
|
126
212
|
constructor(imp?: any);
|
|
213
|
+
/**
|
|
214
|
+
* 获取内部实现对象。
|
|
215
|
+
* @returns 内部实现对象。
|
|
216
|
+
*/
|
|
127
217
|
getImp(): any;
|
|
218
|
+
/**
|
|
219
|
+
* 初始化临时对象。
|
|
220
|
+
* @param imp 内部实现对象。
|
|
221
|
+
*/
|
|
128
222
|
protected initTempObject(imp: any): void;
|
|
223
|
+
/**
|
|
224
|
+
* 获取对象名称。
|
|
225
|
+
*/
|
|
129
226
|
get ObjectName(): string;
|
|
227
|
+
/**
|
|
228
|
+
* 获取 DXF 代码 0 的值。
|
|
229
|
+
*/
|
|
130
230
|
get Dxf0(): string;
|
|
231
|
+
/**
|
|
232
|
+
* 获取 JSON 格式的字符串。
|
|
233
|
+
* @returns JSON 格式的字符串。
|
|
234
|
+
*/
|
|
131
235
|
getJson(): string;
|
|
236
|
+
/**
|
|
237
|
+
* 设置 JSON 格式的字符串。
|
|
238
|
+
* @param str JSON 格式的字符串。
|
|
239
|
+
* @returns 是否设置成功。
|
|
240
|
+
*/
|
|
132
241
|
setJson(str: string): boolean;
|
|
133
242
|
}
|
|
134
243
|
declare class MdDbObject extends MdRxObject {
|
|
244
|
+
/**
|
|
245
|
+
* 构造函数。
|
|
246
|
+
* @param imp 内部实现对象。
|
|
247
|
+
*/
|
|
135
248
|
constructor(imp?: any);
|
|
249
|
+
/**
|
|
250
|
+
* 获取对象 ID。
|
|
251
|
+
* @returns 对象 ID。
|
|
252
|
+
*/
|
|
136
253
|
getObjectID(): number;
|
|
254
|
+
/**
|
|
255
|
+
* 删除对象。
|
|
256
|
+
* @returns 是否删除成功。
|
|
257
|
+
*/
|
|
137
258
|
Erase(): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* 克隆对象。
|
|
261
|
+
* @returns 克隆出的对象。
|
|
262
|
+
*/
|
|
138
263
|
Clone(): MdDbObject;
|
|
139
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* 表示数据库层表。
|
|
267
|
+
*/
|
|
140
268
|
export declare class MdDbLayerTable extends MdDbObject {
|
|
269
|
+
/**
|
|
270
|
+
* 构造函数。
|
|
271
|
+
* @param imp 内部实现对象。
|
|
272
|
+
*/
|
|
141
273
|
constructor(imp?: any);
|
|
142
274
|
}
|
|
143
275
|
declare class MdDbLinetypeTable extends MdDbObject {
|
|
276
|
+
/**
|
|
277
|
+
* 构造函数。
|
|
278
|
+
* @param imp 内部实现对象。
|
|
279
|
+
*/
|
|
144
280
|
constructor(imp?: any);
|
|
145
281
|
}
|
|
146
282
|
declare class MdDbTextStyleTable extends MdDbObject {
|
|
283
|
+
/**
|
|
284
|
+
* 构造函数。
|
|
285
|
+
* @param imp 内部实现对象。
|
|
286
|
+
*/
|
|
147
287
|
constructor(imp?: any);
|
|
148
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* 表示数据库实体。
|
|
291
|
+
*/
|
|
149
292
|
export declare class MdDbEntity extends MdDbObject {
|
|
293
|
+
/**
|
|
294
|
+
* 构造函数。
|
|
295
|
+
* @param imp 内部实现对象。
|
|
296
|
+
*/
|
|
150
297
|
constructor(imp?: any);
|
|
298
|
+
/**
|
|
299
|
+
* 移动夹点。
|
|
300
|
+
* @param iIndex 夹点索引。
|
|
301
|
+
* @param dXOffset X 轴偏移量。
|
|
302
|
+
* @param dYOffset Y 轴偏移量。
|
|
303
|
+
* @param dZOffset Z 轴偏移量。
|
|
304
|
+
* @returns 是否移动成功。
|
|
305
|
+
*/
|
|
151
306
|
moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number): boolean;
|
|
152
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* 表示数据库曲线。
|
|
310
|
+
*/
|
|
153
311
|
export declare class MdDbCurve extends MdDbEntity {
|
|
312
|
+
/**
|
|
313
|
+
* 构造函数。
|
|
314
|
+
* @param imp 内部实现对象。
|
|
315
|
+
*/
|
|
154
316
|
constructor(imp?: any);
|
|
317
|
+
/**
|
|
318
|
+
* 获取起始参数。
|
|
319
|
+
* @returns 起始参数及执行结果。
|
|
320
|
+
*/
|
|
155
321
|
getStartParam(): {
|
|
156
322
|
val: number;
|
|
157
323
|
ret: number;
|
|
158
324
|
};
|
|
325
|
+
/**
|
|
326
|
+
* 获取结束参数。
|
|
327
|
+
* @returns 结束参数及执行结果。
|
|
328
|
+
*/
|
|
159
329
|
getEndParam(): {
|
|
160
330
|
val: number;
|
|
161
331
|
ret: number;
|
|
162
332
|
};
|
|
333
|
+
/**
|
|
334
|
+
* 获取参数位置上的距离。
|
|
335
|
+
* @param param 参数位置。
|
|
336
|
+
* @returns 距离及执行结果。
|
|
337
|
+
*/
|
|
163
338
|
getDistAtParam(param: number): {
|
|
164
339
|
val: number;
|
|
165
340
|
ret: number;
|
|
166
341
|
};
|
|
342
|
+
/**
|
|
343
|
+
* 获取距离位置上的参数。
|
|
344
|
+
* @param dist 距离位置。
|
|
345
|
+
* @returns 参数及执行结果。
|
|
346
|
+
*/
|
|
167
347
|
getParamAtDist(dist: number): {
|
|
168
348
|
val: number;
|
|
169
349
|
ret: number;
|
|
170
350
|
};
|
|
351
|
+
/**
|
|
352
|
+
* 获取距离位置上的点。
|
|
353
|
+
* @param pt 距离位置。
|
|
354
|
+
* @returns 点及执行结果。
|
|
355
|
+
*/
|
|
171
356
|
getDistAtPoint(pt: MdGePoint3d): {
|
|
172
357
|
val: number;
|
|
173
358
|
ret: number;
|
|
174
359
|
};
|
|
360
|
+
/**
|
|
361
|
+
* 获取距离位置上的点。
|
|
362
|
+
* @param dist 距离位置。
|
|
363
|
+
* @returns 点及执行结果。
|
|
364
|
+
*/
|
|
175
365
|
getPointAtDist(dist: number): {
|
|
176
366
|
val: MdGePoint3d;
|
|
177
367
|
ret: number;
|
|
178
368
|
};
|
|
179
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* 表示数据库。
|
|
372
|
+
*/
|
|
180
373
|
export declare class MdDbDatabase extends MdRxObject {
|
|
374
|
+
/**
|
|
375
|
+
* 构造函数。
|
|
376
|
+
* @param imp 内部实现对象。
|
|
377
|
+
*/
|
|
181
378
|
constructor(imp?: any);
|
|
379
|
+
/**
|
|
380
|
+
* 获取层表。
|
|
381
|
+
* @returns 层表。
|
|
382
|
+
*/
|
|
182
383
|
GetLayerTable(): MdDbLayerTable;
|
|
384
|
+
/**
|
|
385
|
+
* 获取线型表。
|
|
386
|
+
* @returns 线型表。
|
|
387
|
+
*/
|
|
183
388
|
GetLinetypeTable(): MdDbLinetypeTable;
|
|
389
|
+
/**
|
|
390
|
+
* 获取文字样式表。
|
|
391
|
+
* @returns 文字样式表。
|
|
392
|
+
*/
|
|
184
393
|
GetTextStyleTable(): MdDbTextStyleTable;
|
|
394
|
+
/**
|
|
395
|
+
* 获取当前线型比例。
|
|
396
|
+
* @returns 当前线型比例。
|
|
397
|
+
*/
|
|
185
398
|
GetCurrentlyLineTypeScale(): number;
|
|
399
|
+
/**
|
|
400
|
+
* 设置当前线型比例。
|
|
401
|
+
* @param val 线型比例。
|
|
402
|
+
* @returns 当前线型比例。
|
|
403
|
+
*/
|
|
186
404
|
SetCurrentlyLineTypeScale(val: number): number;
|
|
405
|
+
/**
|
|
406
|
+
* 获取当前线型名称。
|
|
407
|
+
* @returns 当前线型名称。
|
|
408
|
+
*/
|
|
187
409
|
GetCurrentlyLineTypeName(): string;
|
|
410
|
+
/**
|
|
411
|
+
* 设置当前线型名称。
|
|
412
|
+
* @param sName 线型名称。
|
|
413
|
+
*/
|
|
188
414
|
SetCurrentlyLineTypeName(sName: string): void;
|
|
415
|
+
/**
|
|
416
|
+
* 获取当前层名称。
|
|
417
|
+
* @returns 当前层名称。
|
|
418
|
+
*/
|
|
189
419
|
GetCurrentlyLayerName(): string;
|
|
420
|
+
/**
|
|
421
|
+
* 设置当前层名称。
|
|
422
|
+
* @param sName 层名称。
|
|
423
|
+
*/
|
|
190
424
|
SetCurrentlyLayerName(sName: string): void;
|
|
425
|
+
/**
|
|
426
|
+
* 获取当前真彩色。
|
|
427
|
+
* @returns 当前真彩色。
|
|
428
|
+
*/
|
|
191
429
|
GetCurrentlyTrueColor(): MdCmColor;
|
|
430
|
+
/**
|
|
431
|
+
* 设置当前真彩色。
|
|
432
|
+
* @param color 真彩色。
|
|
433
|
+
*/
|
|
192
434
|
SetCurrentlyTrueColor(color: MdCmColor): any;
|
|
435
|
+
/**
|
|
436
|
+
* 获取当前颜色索引。
|
|
437
|
+
* @returns 当前颜色索引。
|
|
438
|
+
*/
|
|
193
439
|
GetCurrentlyColorIndex(): number;
|
|
440
|
+
/**
|
|
441
|
+
* 设置当前颜色索引。
|
|
442
|
+
* @param colorIndex 颜色索引。
|
|
443
|
+
*/
|
|
194
444
|
SetCurrentlyColorIndex(colorIndex: number): any;
|
|
445
|
+
/**
|
|
446
|
+
* 获取当前文字样式名称。
|
|
447
|
+
* @returns 当前文字样式名称。
|
|
448
|
+
*/
|
|
195
449
|
GetCurrentlyTextStyleName(): string;
|
|
450
|
+
/**
|
|
451
|
+
* 设置当前文字样式名称。
|
|
452
|
+
* @param sName 文字样式名称。
|
|
453
|
+
*/
|
|
196
454
|
SetCurrentlyTextStyle(sName: string): void;
|
|
197
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* McObject 类
|
|
458
|
+
*/
|
|
198
459
|
export declare class McObject {
|
|
460
|
+
/** 内部对象实现 */
|
|
199
461
|
private imp;
|
|
200
462
|
private mxObject;
|
|
463
|
+
/** 当前文件名 */
|
|
201
464
|
static currentFileName: string;
|
|
465
|
+
/**
|
|
466
|
+
* 构造函数
|
|
467
|
+
* @param imp 对象实现
|
|
468
|
+
*/
|
|
202
469
|
constructor(imp: any);
|
|
470
|
+
/**
|
|
471
|
+
* 初始化对象模型
|
|
472
|
+
* @param mxObject 对象模型
|
|
473
|
+
*/
|
|
203
474
|
initMxObject(mxObject: any): void;
|
|
475
|
+
/**
|
|
476
|
+
* 获取对象实现
|
|
477
|
+
* @returns 对象实现
|
|
478
|
+
*/
|
|
204
479
|
getImp(): any;
|
|
480
|
+
/**
|
|
481
|
+
* 获取 MxCpp 对象实现
|
|
482
|
+
* @returns MxCpp 对象实现
|
|
483
|
+
*/
|
|
205
484
|
getMxCppImp(): any;
|
|
485
|
+
/**
|
|
486
|
+
* 更新对象显示
|
|
487
|
+
* @param modelViewMatrix 模型视图矩阵
|
|
488
|
+
* @param projectionMatrix 投影矩阵
|
|
489
|
+
*/
|
|
206
490
|
updateDisplay(modelViewMatrix: number[], projectionMatrix: number[]): void;
|
|
491
|
+
/**
|
|
492
|
+
* 测试方法
|
|
493
|
+
*/
|
|
207
494
|
test(): void;
|
|
495
|
+
/**
|
|
496
|
+
* 打开网络文件
|
|
497
|
+
* @param sFileUrl 网络文件路径
|
|
498
|
+
* @param retCall 回调函数,可选参数,打开文件完成后的回调函数,参数为打开文件的结果,0表示成功,其他值表示失败
|
|
499
|
+
* @param isWorkThread 是否使用工作线程打开文件,默认为 true
|
|
500
|
+
* @returns 是否成功打开文件
|
|
501
|
+
*/
|
|
208
502
|
openWebFile(sFileUrl: string, retCall?: (iRet: number) => void, isWorkThread?: boolean): boolean;
|
|
503
|
+
/**
|
|
504
|
+
* 获取当前文件名
|
|
505
|
+
* @returns 当前文件名
|
|
506
|
+
*/
|
|
209
507
|
getCurrentFileName(): string;
|
|
508
|
+
/**
|
|
509
|
+
* 将文件保存并转换为网络路径下载
|
|
510
|
+
* @param sSaveProgramUrl 要保存文件的路径
|
|
511
|
+
* @returns 是否成功保存文件
|
|
512
|
+
*/
|
|
210
513
|
saveFileToUrl(sSaveProgramUrl: string): boolean;
|
|
514
|
+
/**
|
|
515
|
+
* 保存文件
|
|
516
|
+
* @param pszFilePath 文件路径
|
|
517
|
+
* @param call 回调函数,可选参数,文件保存完成后的回调函数,参数为文件数据
|
|
518
|
+
* @param isDownland 是否下载文件,默认为 true
|
|
519
|
+
* @param isShowSaveFileDialog 是否显示保存文件对话框,默认为 true
|
|
520
|
+
* @returns 是否成功保存文件
|
|
521
|
+
*/
|
|
211
522
|
saveFile(pszFilePath?: string, call?: (data: any) => void, isDownland?: boolean, isShowSaveFileDialog?: boolean): boolean;
|
|
523
|
+
/**
|
|
524
|
+
* 获取数据库对象
|
|
525
|
+
* @returns 数据库对象
|
|
526
|
+
*/
|
|
212
527
|
GetDatabase(): MdDbDatabase;
|
|
528
|
+
/**
|
|
529
|
+
* 获取系统变量的字符串值
|
|
530
|
+
* @param varName 变量名称
|
|
531
|
+
* @returns 变量的字符串值
|
|
532
|
+
*/
|
|
213
533
|
GetSysVarString(varName: string): string;
|
|
534
|
+
/**
|
|
535
|
+
* 设置系统变量的字符串值
|
|
536
|
+
* @param varName 变量名称
|
|
537
|
+
* @param val 变量的字符串值
|
|
538
|
+
* @returns 是否成功设置变量值
|
|
539
|
+
*/
|
|
214
540
|
SetSysVarString(varName: string, val: string): any;
|
|
541
|
+
/**
|
|
542
|
+
* 获取系统变量的浮点数值
|
|
543
|
+
* @param varName 变量名称
|
|
544
|
+
* @returns 变量的浮点数值
|
|
545
|
+
*/
|
|
215
546
|
GetSysVarDouble(varName: string): number;
|
|
547
|
+
/**
|
|
548
|
+
* 设置系统变量的浮点数值
|
|
549
|
+
* @param varName 变量名称
|
|
550
|
+
* @param val 变量的浮点数值
|
|
551
|
+
* @returns 是否成功设置变量值
|
|
552
|
+
*/
|
|
216
553
|
SetSysVarDouble(varName: string, val: number): boolean;
|
|
554
|
+
/**
|
|
555
|
+
* 获取系统变量的整数值
|
|
556
|
+
* @param varName 变量名称
|
|
557
|
+
* @returns 变量的整数值
|
|
558
|
+
*/
|
|
217
559
|
GetSysVarLong(varName: string): number;
|
|
560
|
+
/**
|
|
561
|
+
* 设置系统变量的整数值
|
|
562
|
+
* @param varName 变量名称
|
|
563
|
+
* @param val 变量的整数值
|
|
564
|
+
* @returns 是否成功设置变量值
|
|
565
|
+
*/
|
|
218
566
|
SetSysVarLong(varName: string, val: number): boolean;
|
|
567
|
+
/**
|
|
568
|
+
* 获取绘制颜色
|
|
569
|
+
* @returns 返回绘制颜色
|
|
570
|
+
*/
|
|
219
571
|
get DrawColor(): MdCmColor;
|
|
572
|
+
/**
|
|
573
|
+
* 设置绘制颜色
|
|
574
|
+
* @param val 绘制颜色
|
|
575
|
+
*/
|
|
220
576
|
set DrawColor(val: MdCmColor);
|
|
577
|
+
/**
|
|
578
|
+
* 获取绘制线宽
|
|
579
|
+
* @returns 返回绘制线宽
|
|
580
|
+
*/
|
|
221
581
|
get DrawLineWeight(): McDb.LineWeight;
|
|
582
|
+
/**
|
|
583
|
+
* 设置绘制线宽
|
|
584
|
+
* @param val 绘制线宽
|
|
585
|
+
*/
|
|
222
586
|
set DrawLineWeight(val: McDb.LineWeight);
|
|
587
|
+
/**
|
|
588
|
+
* 获取绘制线型比例
|
|
589
|
+
* @returns 返回绘制线型比例
|
|
590
|
+
*/
|
|
223
591
|
get DrawLineTypeScale(): number;
|
|
592
|
+
/**
|
|
593
|
+
* 设置绘制线型比例
|
|
594
|
+
* @param val 绘制线型比例
|
|
595
|
+
*/
|
|
224
596
|
set DrawLineTypeScale(val: number);
|
|
597
|
+
/**
|
|
598
|
+
* 获取绘制线型
|
|
599
|
+
* @returns 返回绘制线型
|
|
600
|
+
*/
|
|
225
601
|
get DrawLinetype(): string;
|
|
602
|
+
/**
|
|
603
|
+
* 设置绘制线型
|
|
604
|
+
* @param val 绘制线型
|
|
605
|
+
*/
|
|
226
606
|
set DrawLinetype(val: string);
|
|
607
|
+
/**
|
|
608
|
+
* 获取绘制文字样式
|
|
609
|
+
* @returns 返回绘制文字样式
|
|
610
|
+
*/
|
|
227
611
|
get DrawTextStyle(): string;
|
|
612
|
+
/**
|
|
613
|
+
* 设置绘制文字样式
|
|
614
|
+
* @param val 绘制文字样式
|
|
615
|
+
*/
|
|
228
616
|
set DrawTextStyle(val: string);
|
|
617
|
+
/**
|
|
618
|
+
* 获取绘制图层
|
|
619
|
+
* @returns 返回绘制图层
|
|
620
|
+
*/
|
|
229
621
|
get DrawLayer(): string;
|
|
622
|
+
/**
|
|
623
|
+
* 设置绘制图层
|
|
624
|
+
* @param val 绘制图层
|
|
625
|
+
*/
|
|
230
626
|
set DrawLayer(val: string);
|
|
627
|
+
/**
|
|
628
|
+
* 添加图层
|
|
629
|
+
* @param pszName 图层名称
|
|
630
|
+
*/
|
|
231
631
|
AddLayer(pszName: string): void;
|
|
632
|
+
/**
|
|
633
|
+
* 添加文字样式
|
|
634
|
+
* @param pszName 样式名称
|
|
635
|
+
* @param pszFileName 字体文件名
|
|
636
|
+
* @param pszBigFontFileName 大字体文件名
|
|
637
|
+
* @param dXScale X 方向缩放比例
|
|
638
|
+
*/
|
|
232
639
|
AddTextStyle(pszName: string, pszFileName: string, pszBigFontFileName: string, dXScale: number): void;
|
|
640
|
+
/**
|
|
641
|
+
* 添加线型
|
|
642
|
+
* @param pszName 线型名称
|
|
643
|
+
* @param pszLineDefine 线型定义
|
|
644
|
+
*/
|
|
233
645
|
AddLinetype(pszName: string, pszLineDefine: string): void;
|
|
646
|
+
/**
|
|
647
|
+
* 添加线型
|
|
648
|
+
* @param pszName 线型名称
|
|
649
|
+
* @param pszLineDefine 线型定义
|
|
650
|
+
* @param pszTextStyle 文字样式
|
|
651
|
+
*/
|
|
234
652
|
AddLinetypeEx(pszName: string, pszLineDefine: string, pszTextStyle: string): void;
|
|
653
|
+
/**
|
|
654
|
+
* 绘制直线
|
|
655
|
+
* @param dX1 起点 X 坐标
|
|
656
|
+
* @param dY1 起点 Y 坐标
|
|
657
|
+
* @param dZ1 起点 Z 坐标
|
|
658
|
+
* @param dX2 终点 X 坐标
|
|
659
|
+
* @param dY2 终点 Y 坐标
|
|
660
|
+
* @param dZ2 终点 Z 坐标
|
|
661
|
+
* @returns 绘制的直线 ID
|
|
662
|
+
*/
|
|
235
663
|
DrawLine(dX1: number, dY1: number, dZ1: number, dX2: number, dY2: number, dZ2: number): number;
|
|
664
|
+
/**
|
|
665
|
+
* 添加标注样式
|
|
666
|
+
* @param pszName 样式名称
|
|
667
|
+
* @param pszDoubleData 双精度型数据
|
|
668
|
+
* @param pszIntData 整型数据
|
|
669
|
+
* @param pszStringData 字符串型数据
|
|
670
|
+
* @param pszIdData ID 型数据
|
|
671
|
+
*/
|
|
236
672
|
AddDimStyle(pszName: string, pszDoubleData: string, pszIntData: string, pszStringData: string, pszIdData: string): void;
|
|
673
|
+
/**
|
|
674
|
+
* 获取当前绘制的标注样式
|
|
675
|
+
*/
|
|
237
676
|
get DrawDimStyle(): string;
|
|
677
|
+
/**
|
|
678
|
+
* 设置当前绘制的标注样式
|
|
679
|
+
* @param val 样式名称
|
|
680
|
+
*/
|
|
238
681
|
set DrawDimStyle(val: string);
|
|
682
|
+
/**
|
|
683
|
+
* 获取当前绘制的线型定义
|
|
684
|
+
*/
|
|
239
685
|
get DrawPatternDefinition(): string;
|
|
686
|
+
/**
|
|
687
|
+
* 设置当前绘制的线型定义
|
|
688
|
+
* @param val 线型定义
|
|
689
|
+
*/
|
|
240
690
|
set DrawPatternDefinition(val: string);
|
|
691
|
+
/**
|
|
692
|
+
* 获取当前绘制的线宽
|
|
693
|
+
*/
|
|
241
694
|
get DrawLineWidth(): string;
|
|
695
|
+
/**
|
|
696
|
+
* 设置当前绘制的线宽
|
|
697
|
+
* @param val 线宽
|
|
698
|
+
*/
|
|
242
699
|
set DrawLineWidth(val: string);
|
|
700
|
+
/**
|
|
701
|
+
* 绘制圆弧
|
|
702
|
+
* @param dCenterX 圆心 X 坐标
|
|
703
|
+
* @param dCenterY 圆心 Y 坐标
|
|
704
|
+
* @param dRadius 半径
|
|
705
|
+
* @param dStartAng 起始角度,单位为弧度
|
|
706
|
+
* @param dEndAng 结束角度,单位为弧度
|
|
707
|
+
* @returns 成功返回 1,失败返回 0
|
|
708
|
+
*/
|
|
243
709
|
DrawArc(dCenterX: number, dCenterY: number, dRadius: number, dStartAng: number, dEndAng: number): number;
|
|
710
|
+
/**
|
|
711
|
+
* 绘制圆弧
|
|
712
|
+
* @param dStartPointX 起始点 X 坐标
|
|
713
|
+
* @param dStartPointY 起始点 Y 坐标
|
|
714
|
+
* @param dMidPointX 中间点 X 坐标
|
|
715
|
+
* @param dMidPointY 中间点 Y 坐标
|
|
716
|
+
* @param dEndPointX 结束点 X 坐标
|
|
717
|
+
* @param dEndPointY 结束点 Y 坐标
|
|
718
|
+
*/
|
|
244
719
|
DrawArc2(dStartPointX: number, dStartPointY: number, dMidPointX: number, dMidPointY: number, dEndPointX: number, dEndPointY: number): any;
|
|
720
|
+
/**
|
|
721
|
+
* 绘制圆
|
|
722
|
+
* @param dCenterX 圆心 X 坐标
|
|
723
|
+
* @param dCenterY 圆心 Y 坐标
|
|
724
|
+
* @param dRadius 半径
|
|
725
|
+
*/
|
|
245
726
|
DrawCircle(dCenterX: number, dCenterY: number, dRadius: number): any;
|
|
727
|
+
/**
|
|
728
|
+
* 绘制椭圆
|
|
729
|
+
* @param dCenterX 椭圆中心 X 坐标
|
|
730
|
+
* @param dCenterY 椭圆中心 Y 坐标
|
|
731
|
+
* @param dMajorAxisX 长轴 X 坐标
|
|
732
|
+
* @param dMajorAxisY 长轴 Y 坐标
|
|
733
|
+
* @param dRadiusRatio 短轴与长轴的比例
|
|
734
|
+
* @returns 成功返回 1,失败返回 0
|
|
735
|
+
*/
|
|
246
736
|
DrawEllipse(dCenterX: number, dCenterY: number, dMajorAxisX: number, dMajorAxisY: number, dRadiusRatio: number): number;
|
|
737
|
+
/**
|
|
738
|
+
* 绘制椭圆弧
|
|
739
|
+
* @param dCenterX 椭圆中心 X 坐标
|
|
740
|
+
* @param dCenterY 椭圆中心 Y 坐标
|
|
741
|
+
* @param dMajorAxisX 长轴 X 坐标
|
|
742
|
+
* @param dMajorAxisY 长轴 Y 坐标
|
|
743
|
+
* @param dRadiusRatio 短轴与长轴的比例
|
|
744
|
+
* @param dStartAng 起始角度,单位为弧度
|
|
745
|
+
* @param dEndAng 结束角度,单位为弧度
|
|
746
|
+
*/
|
|
247
747
|
DrawEllipseArc(dCenterX: number, dCenterY: number, dMajorAxisX: number, dMajorAxisY: number, dRadiusRatio: number, dStartAng: number, dEndAng: number): any;
|
|
748
|
+
/**
|
|
749
|
+
* 绘制点
|
|
750
|
+
* @param dX X 坐标
|
|
751
|
+
* @param dY Y 坐标
|
|
752
|
+
*/
|
|
248
753
|
DrawPoint(dX: number, dY: number): any;
|
|
754
|
+
/**
|
|
755
|
+
* 绘制实体
|
|
756
|
+
* @param dX1 第一个点 X 坐标
|
|
757
|
+
* @param dY1 第一个点 Y 坐标
|
|
758
|
+
* @param dX2 第二个点 X 坐标
|
|
759
|
+
* @param dY2 第二个点 Y 坐标
|
|
760
|
+
* @param dX3 第三个点 X 坐标
|
|
761
|
+
* @param dY3 第三个点 Y 坐标
|
|
762
|
+
* @param dX4 第四个点 X 坐标
|
|
763
|
+
* @param dY4 第四个点 Y 坐标
|
|
764
|
+
* @returns 成功返回实体号,失败返回 0
|
|
765
|
+
*/
|
|
249
766
|
DrawSolid(dX1: number, dY1: number, dX2: number, dY2: number, dX3: number, dY3: number, dX4: number, dY4: number): number;
|
|
767
|
+
/**
|
|
768
|
+
* 绘制多行文本
|
|
769
|
+
* @param dPosX 文本位置 X 坐标
|
|
770
|
+
* @param dPosY 文本位置 Y 坐标
|
|
771
|
+
* @param pszContents 文本内容
|
|
772
|
+
* @param dHeight 文本高度
|
|
773
|
+
* @param dWidth 文本宽度
|
|
774
|
+
* @param dRotation 旋转角度,单位为弧度
|
|
775
|
+
* @param iAttachment 对齐方式
|
|
776
|
+
* @returns 成功返回 1,失败返回 0
|
|
777
|
+
*/
|
|
250
778
|
DrawMText(dPosX: number, dPosY: number, pszContents: string, dHeight: number, dWidth: number, dRotation: number, iAttachment: number): number;
|
|
779
|
+
/**
|
|
780
|
+
* 绘制单行文本
|
|
781
|
+
* @param dPosX 文本位置 X 坐标
|
|
782
|
+
* @param dPosY 文本位置 Y 坐标
|
|
783
|
+
* @param pszText 文本内容
|
|
784
|
+
* @param dHeight 文本高度
|
|
785
|
+
* @param dRotation 旋转角度,单位为弧度
|
|
786
|
+
* @param horizontalMode 横向对齐方式
|
|
787
|
+
* @param verticalMode 纵向对齐方式
|
|
788
|
+
* @returns 成功返回 1,失败返回 0
|
|
789
|
+
*/
|
|
251
790
|
DrawText(dPosX: number, dPosY: number, pszText: string, dHeight: number, dRotation: number, horizontalMode: number, verticalMode: number): number;
|
|
791
|
+
/**
|
|
792
|
+
* 绘制块参照
|
|
793
|
+
* @param dPosX 参照位置 X 坐标
|
|
794
|
+
* @param dPosY 参照位置 Y 坐标
|
|
795
|
+
* @param pszBlkName 块名
|
|
796
|
+
* @param dScale 缩放比例
|
|
797
|
+
* @param dAng 旋转角度,单位为弧度
|
|
798
|
+
* @returns 成功返回 1,失败返回 0
|
|
799
|
+
*/
|
|
252
800
|
DrawBlockReference(dPosX: number, dPosY: number, pszBlkName: number, dScale: number, dAng: number): number;
|
|
801
|
+
/**
|
|
802
|
+
* 绘制对齐标注
|
|
803
|
+
* @param dExtLine1PointX 第一条尺线起点 X 坐标
|
|
804
|
+
* @param dExtLine1PointY 第一条尺线起点 Y 坐标
|
|
805
|
+
* @param dExtLine2PointX 第二条尺线起点 X 坐标
|
|
806
|
+
* @param dExtLine2PointY 第二条尺线起点 Y 坐标
|
|
807
|
+
* @param dTextPositionX 文本位置 X 坐标
|
|
808
|
+
* @param dTextPositionY 文本位置 Y 坐标
|
|
809
|
+
* @returns 成功返回 1,失败返回 0
|
|
810
|
+
*/
|
|
253
811
|
DrawDimAligned(dExtLine1PointX: number, dExtLine1PointY: number, dExtLine2PointX: number, dExtLine2PointY: number, dTextPositionX: number, dTextPositionY: number): number;
|
|
812
|
+
/**
|
|
813
|
+
* 绘制角度标注
|
|
814
|
+
* @param dAngleVertexX 角度顶点 X 坐标
|
|
815
|
+
* @param dAngleVertexY 角度顶点 Y 坐标
|
|
816
|
+
* @param dFirstEndPointX 第一条尺线起点 X 坐标
|
|
817
|
+
* @param dFirstEndPointY 第一条尺线起点 Y 坐标
|
|
818
|
+
* @param dSecondEndPointX 第二条尺线起点 X 坐标
|
|
819
|
+
* @param dSecondEndPointY 第二条尺线起点 Y 坐标
|
|
820
|
+
* @param dTextPointX 文本位置 X 坐标
|
|
821
|
+
* @param dTextPointY 文本位置 Y 坐标
|
|
822
|
+
* @returns 成功返回 1,失败返回 0
|
|
823
|
+
*/
|
|
254
824
|
DrawDimAngular(dAngleVertexX: number, dAngleVertexY: number, dFirstEndPointX: number, dFirstEndPointY: number, dSecondEndPointX: number, dSecondEndPointY: number, dTextPointX: number, dTextPointY: number): number;
|
|
825
|
+
/**
|
|
826
|
+
* 绘制直径标注
|
|
827
|
+
* @param dChordPointX 弦线端点 X 坐标
|
|
828
|
+
* @param dChordPointY 弦线端点 Y 坐标
|
|
829
|
+
* @param dFarChordPointX 弦线远端点 X 坐标
|
|
830
|
+
* @param dFarChordPointY 弦线远端点 Y 坐标
|
|
831
|
+
* @param dLeaderLength 引线长度
|
|
832
|
+
* @returns 成功返回 1,失败返回 0
|
|
833
|
+
*/
|
|
255
834
|
DrawDimDiametric(dChordPointX: number, dChordPointY: number, dFarChordPointX: number, dFarChordPointY: number, dLeaderLength: number): number;
|
|
835
|
+
/**
|
|
836
|
+
* 绘制旋转标注
|
|
837
|
+
* @param dExtLine1PointX 第一条尺线起点 X 坐标
|
|
838
|
+
* @param dExtLine1PointY 第一条尺线起点 Y 坐标
|
|
839
|
+
* @param dExtLine2PointX 第二条尺线起点 X 坐标
|
|
840
|
+
* @param dExtLine2PointY 第二条尺线起点 Y 坐标
|
|
841
|
+
* @param dDimLineLocationX 标注线位置 X 坐标
|
|
842
|
+
* @param dDimLineLocationY 标注线位置 Y 坐标
|
|
843
|
+
* @param dRotationAngle 旋转角度,单位为弧度
|
|
844
|
+
* @returns 成功返回 1,失败返回 0
|
|
845
|
+
*/
|
|
256
846
|
DrawDimRotated(dExtLine1PointX: number, dExtLine1PointY: number, dExtLine2PointX: number, dExtLine2PointY: number, dDimLineLocationX: number, dDimLineLocationY: number, dRotationAngle: number): number;
|
|
847
|
+
/**
|
|
848
|
+
* 绘制标注线性尺寸
|
|
849
|
+
* @param dDefinitionPointX - 定义点 X 坐标
|
|
850
|
+
* @param dDefinitionPointY - 定义点 Y 坐标
|
|
851
|
+
* @param dDeaderEndPointX - 标注终点 X 坐标
|
|
852
|
+
* @param dDeaderEndPointY - 标注终点 Y 坐标
|
|
853
|
+
* @param isUseXAxis - 是否沿 X 轴方向标注
|
|
854
|
+
* @returns 绘制结果
|
|
855
|
+
*/
|
|
257
856
|
DrawDimOrdinate(dDefinitionPointX: number, dDefinitionPointY: number, dDeaderEndPointX: number, dDeaderEndPointY: number, isUseXAxis: boolean): number;
|
|
857
|
+
/**
|
|
858
|
+
* 绘制标注径向尺寸
|
|
859
|
+
* @param dCenterX - 中心点 X 坐标
|
|
860
|
+
* @param dCenterY - 中心点 Y 坐标
|
|
861
|
+
* @param dChordPointX - 弦线端点 X 坐标
|
|
862
|
+
* @param dChordPointY - 弦线端点 Y 坐标
|
|
863
|
+
* @param dLeaderLength - 标注线长度
|
|
864
|
+
* @returns 绘制结果
|
|
865
|
+
*/
|
|
258
866
|
DrawDimRadial(dCenterX: number, dCenterY: number, dChordPointX: number, dChordPointY: number, dLeaderLength: number): number;
|
|
867
|
+
/**
|
|
868
|
+
* 将路径移动到指定位置
|
|
869
|
+
* @param dX - X 坐标
|
|
870
|
+
* @param dY - Y 坐标
|
|
871
|
+
*/
|
|
259
872
|
PathMoveTo(dX: number, dY: number): void;
|
|
873
|
+
/**
|
|
874
|
+
* 移动路径到指定位置,同时指定起始宽度、终止宽度和凸度
|
|
875
|
+
* @param dX - X 坐标
|
|
876
|
+
* @param dY - Y 坐标
|
|
877
|
+
* @param dStartWidth - 起始宽度
|
|
878
|
+
* @param dEndWidth - 终止宽度
|
|
879
|
+
* @param dBulge - 凸度
|
|
880
|
+
*/
|
|
260
881
|
PathMoveToEx(dX: number, dY: number, dStartWidth: number, dEndWidth: number, dBulge: number): void;
|
|
882
|
+
/**
|
|
883
|
+
* 从当前位置画一条直线到指定位置
|
|
884
|
+
* @param dX - X 坐标
|
|
885
|
+
* @param dY - Y 坐标
|
|
886
|
+
*/
|
|
261
887
|
PathLineTo(dX: number, dY: number): void;
|
|
888
|
+
/**
|
|
889
|
+
* 从当前位置画一条直线到指定位置,同时指定起始宽度、终止宽度和凸度
|
|
890
|
+
* @param dX - X 坐标
|
|
891
|
+
* @param dY - Y 坐标
|
|
892
|
+
* @param dStartWidth - 起始宽度
|
|
893
|
+
* @param dEndWidth - 终止宽度
|
|
894
|
+
* @param dBulge - 凸度
|
|
895
|
+
*/
|
|
262
896
|
PathLineToEx(dX: number, dY: number, dStartWidth: number, dEndWidth: number, dBulge: number): void;
|
|
897
|
+
/**
|
|
898
|
+
* 将路径转换为折线
|
|
899
|
+
* @returns 转换结果
|
|
900
|
+
*/
|
|
263
901
|
DrawPathToPolyline(): number;
|
|
902
|
+
/**
|
|
903
|
+
* 将路径转换为样条曲线
|
|
904
|
+
* @returns 转换结果
|
|
905
|
+
*/
|
|
264
906
|
DrawPathToSpline(): number;
|
|
907
|
+
/**
|
|
908
|
+
* 闭合路径
|
|
909
|
+
*/
|
|
265
910
|
PathMakeClosed(): void;
|
|
911
|
+
/**
|
|
912
|
+
* 将路径转换为填充图案
|
|
913
|
+
* @param dPatternScale - 图案缩放比例
|
|
914
|
+
* @returns 转换结果
|
|
915
|
+
*/
|
|
266
916
|
DrawPathToHatch(dPatternScale: number): number;
|
|
917
|
+
/**
|
|
918
|
+
* 绘制实体
|
|
919
|
+
* @param entity - 实体对象
|
|
920
|
+
* @returns 绘制结果
|
|
921
|
+
*/
|
|
267
922
|
DrawEntity(entity: MdDbEntity): number;
|
|
923
|
+
/**
|
|
924
|
+
* 将 lIdIndex 转换成 MdDbObject 对象
|
|
925
|
+
* @param lIdIndex - 对象 ID
|
|
926
|
+
* @returns 与 ID 对应的 MdDbObject 对象,如果对象不存在则返回 null
|
|
927
|
+
*/
|
|
268
928
|
ObjectIdToObject(lIdIndex: number): MdDbObject | null;
|
|
929
|
+
/**
|
|
930
|
+
* 克隆指定 ID 的 MdDbObject 对象
|
|
931
|
+
* @param id - 对象 ID
|
|
932
|
+
* @returns 克隆后的 MdDbObject 对象
|
|
933
|
+
*/
|
|
269
934
|
CloneMdDbObject(id: number): MdDbObject;
|
|
935
|
+
/**
|
|
936
|
+
* 将 lIdIndex 转换成 MdObjectImp 对象
|
|
937
|
+
* @param lIdIndex - 对象 ID
|
|
938
|
+
* @returns 与 ID 对应的 MdObjectImp 对象
|
|
939
|
+
*/
|
|
270
940
|
ObjectIdToMdObjectImp(lIdIndex: number): any;
|
|
941
|
+
/**
|
|
942
|
+
* 销毁指定的 MdRxObjectImp 对象
|
|
943
|
+
* @param pObjectImp - 待销毁的 MdRxObjectImp 对象
|
|
944
|
+
*/
|
|
271
945
|
DestroyObject(pObjectImp: MdRxObjectImp): void;
|
|
272
946
|
}
|
|
273
947
|
declare class McAppType {
|
|
274
948
|
private imp;
|
|
949
|
+
/**
|
|
950
|
+
* 初始化 McAppType 对象。
|
|
951
|
+
* @param imp 传入的 imp 对象。
|
|
952
|
+
*/
|
|
275
953
|
init(imp: any): void;
|
|
954
|
+
/**
|
|
955
|
+
* 获取 imp 对象。
|
|
956
|
+
* @returns 返回 imp 对象。
|
|
957
|
+
*/
|
|
276
958
|
getImp(): any;
|
|
959
|
+
/**
|
|
960
|
+
* 获取最后一次调用的结果。
|
|
961
|
+
* @returns 返回最后一次调用的结果。
|
|
962
|
+
*/
|
|
277
963
|
getLastCallResult(): number;
|
|
964
|
+
/**
|
|
965
|
+
* 创建 MxDraw 对象。
|
|
966
|
+
* @param width MxDraw 对象的宽度。
|
|
967
|
+
* @param height MxDraw 对象的高度。
|
|
968
|
+
* @param canvasId MxDraw 对象所在的 canvas 的 id。
|
|
969
|
+
* @param isWebgl2 是否使用 webgl2。
|
|
970
|
+
* @param mxObjectId MxDraw 对象的 id。
|
|
971
|
+
* @returns 返回创建的 McObject 对象。
|
|
972
|
+
*/
|
|
278
973
|
CreateMxCAD(width: number, height: number, canvasId: string, isWebgl2: boolean, mxObjectId: number): McObject;
|
|
974
|
+
/**
|
|
975
|
+
* 销毁对象。
|
|
976
|
+
* @param pObject 要销毁的对象。
|
|
977
|
+
*/
|
|
279
978
|
DestroyObject(pObject: MdRxObjectImp): void;
|
|
979
|
+
/**
|
|
980
|
+
* 获取当前的 MxDraw 对象。
|
|
981
|
+
* @returns 返回当前的 McObject 对象。
|
|
982
|
+
*/
|
|
280
983
|
GetCurrentMxCAD(): McObject;
|
|
984
|
+
/**
|
|
985
|
+
* 将 RGB 值转换为索引。
|
|
986
|
+
* @param red 红色值。
|
|
987
|
+
* @param green 绿色值。
|
|
988
|
+
* @param blue 蓝色值。
|
|
989
|
+
* @param bAutoNearest 是否自动获取最近的颜色值。
|
|
990
|
+
* @returns 返回转换后的索引值。
|
|
991
|
+
*/
|
|
281
992
|
mcedRGB2Index(red: number, green: number, blue: number, bAutoNearest?: boolean): number;
|
|
993
|
+
/**
|
|
994
|
+
* 将对象 id 转换为 MdDbObject 对象。
|
|
995
|
+
* @param lIdIndex 对象的 id。
|
|
996
|
+
* @returns 返回转换后的 MdDbObject 对象,如果转换失败,则返回 null。
|
|
997
|
+
*/
|
|
282
998
|
ObjectIdToObject(lIdIndex: number): MdDbObject | null;
|
|
999
|
+
/**
|
|
1000
|
+
* 创建克隆对象。
|
|
1001
|
+
* @param clonobjImp 被克隆的对象。
|
|
1002
|
+
* @returns 返回创建的 MdDbObject 对象。
|
|
1003
|
+
*/
|
|
283
1004
|
CreateCloneObject(clonobjImp: any): MdDbObject;
|
|
284
1005
|
}
|
|
285
1006
|
declare class MxCppType {
|
|
1007
|
+
/**
|
|
1008
|
+
* MxCpp 程序集
|
|
1009
|
+
*/
|
|
286
1010
|
mxcadassemblyimp?: any;
|
|
1011
|
+
/**
|
|
1012
|
+
* McAppType 实例
|
|
1013
|
+
*/
|
|
287
1014
|
App: McAppType;
|
|
1015
|
+
/**
|
|
1016
|
+
* 创建新的 MdCmColor 实例
|
|
1017
|
+
* @returns {MdCmColor} MdCmColor 实例
|
|
1018
|
+
*/
|
|
288
1019
|
NewMdCmColor(): MdCmColor;
|
|
1020
|
+
/**
|
|
1021
|
+
* 获取上一次调用的结果
|
|
1022
|
+
* @returns {number} 调用结果
|
|
1023
|
+
*/
|
|
289
1024
|
getCallResult(): number;
|
|
1025
|
+
/**
|
|
1026
|
+
* 创建新的 MdGePoint3d 实例
|
|
1027
|
+
* @param {any} pt 点坐标
|
|
1028
|
+
* @param {boolean} isDoc 是否为文档坐标
|
|
1029
|
+
* @returns {MdGePoint3d} MdGePoint3d 实例
|
|
1030
|
+
*/
|
|
290
1031
|
NewMdGePoint3d(pt?: any, isDoc?: boolean): MdGePoint3d;
|
|
1032
|
+
/**
|
|
1033
|
+
* 创建新的 MdGePoint3d 实例
|
|
1034
|
+
* @param {number} x x 坐标
|
|
1035
|
+
* @param {number} y y 坐标
|
|
1036
|
+
* @param {number} z z 坐标
|
|
1037
|
+
* @returns {MdGePoint3d} MdGePoint3d 实例
|
|
1038
|
+
*/
|
|
291
1039
|
NewMdGePoint3d2(x: number, y: number, z?: number): MdGePoint3d;
|
|
292
1040
|
}
|
|
1041
|
+
/**
|
|
1042
|
+
* 表示一个直线对象。
|
|
1043
|
+
*/
|
|
293
1044
|
export declare class MdDbLine extends MdDbCurve {
|
|
1045
|
+
/**
|
|
1046
|
+
* 构造函数。
|
|
1047
|
+
* @param imp C++ 实现对象。
|
|
1048
|
+
*/
|
|
294
1049
|
constructor(imp?: any);
|
|
1050
|
+
/**
|
|
1051
|
+
* 获取起点。
|
|
1052
|
+
*/
|
|
295
1053
|
get startPoint(): MdGePoint3d;
|
|
1054
|
+
/**
|
|
1055
|
+
* 设置起点。
|
|
1056
|
+
* @param pt 新的起点。
|
|
1057
|
+
*/
|
|
296
1058
|
set startPoint(pt: MdGePoint3d);
|
|
1059
|
+
/**
|
|
1060
|
+
* 获取终点。
|
|
1061
|
+
*/
|
|
297
1062
|
get endPoint(): MdGePoint3d;
|
|
1063
|
+
/**
|
|
1064
|
+
* 设置终点。
|
|
1065
|
+
* @param pt 新的终点。
|
|
1066
|
+
*/
|
|
298
1067
|
set endPoint(pt: MdGePoint3d);
|
|
299
1068
|
}
|
|
1069
|
+
/**
|
|
1070
|
+
* 表示一个 CAD 文字实体。
|
|
1071
|
+
*/
|
|
300
1072
|
export declare class MdDbText extends MdDbEntity {
|
|
1073
|
+
/**
|
|
1074
|
+
* 构造函数。
|
|
1075
|
+
* @param imp 实现对象。
|
|
1076
|
+
*/
|
|
301
1077
|
constructor(imp?: any);
|
|
1078
|
+
/**
|
|
1079
|
+
* 获取或设置文字的位置。
|
|
1080
|
+
*/
|
|
302
1081
|
get position(): MdGePoint3d;
|
|
303
1082
|
set position(pt: MdGePoint3d);
|
|
1083
|
+
/**
|
|
1084
|
+
* 获取或设置文字的对齐点。
|
|
1085
|
+
*/
|
|
304
1086
|
get alignmentPoint(): MdGePoint3d;
|
|
305
1087
|
set alignmentPoint(pt: MdGePoint3d);
|
|
1088
|
+
/**
|
|
1089
|
+
* 获取或设置文字的倾斜角度。
|
|
1090
|
+
*/
|
|
306
1091
|
get oblique(): number;
|
|
307
1092
|
set oblique(val: number);
|
|
1093
|
+
/**
|
|
1094
|
+
* 获取或设置文字的旋转角度。
|
|
1095
|
+
*/
|
|
308
1096
|
get rotation(): number;
|
|
309
1097
|
set rotation(pt: number);
|
|
1098
|
+
/**
|
|
1099
|
+
* 获取或设置文字的高度。
|
|
1100
|
+
*/
|
|
310
1101
|
get height(): number;
|
|
311
1102
|
set height(val: number);
|
|
1103
|
+
/**
|
|
1104
|
+
* 获取或设置文字的宽度因子。
|
|
1105
|
+
*/
|
|
312
1106
|
get widthFactor(): number;
|
|
313
1107
|
set widthFactor(val: number);
|
|
1108
|
+
/**
|
|
1109
|
+
* 获取或设置文字的字符串。
|
|
1110
|
+
*/
|
|
314
1111
|
get textString(): string;
|
|
315
1112
|
set textString(val: string);
|
|
1113
|
+
/**
|
|
1114
|
+
* 获取或设置文字的水平对齐方式。
|
|
1115
|
+
*/
|
|
316
1116
|
get horizontalMode(): McDb.TextHorzMode;
|
|
317
1117
|
set horizontalMode(val: McDb.TextHorzMode);
|
|
1118
|
+
/**
|
|
1119
|
+
* 获取或设置文字的垂直对齐方式。
|
|
1120
|
+
*/
|
|
318
1121
|
get verticalMode(): McDb.TextVertMode;
|
|
319
1122
|
set verticalMode(val: McDb.TextVertMode);
|
|
320
1123
|
}
|
|
1124
|
+
/**
|
|
1125
|
+
* 表示一个圆形。
|
|
1126
|
+
*/
|
|
321
1127
|
export declare class MdDbCircle extends MdDbCurve {
|
|
1128
|
+
/**
|
|
1129
|
+
* 构造函数。
|
|
1130
|
+
* @param imp 内部对象。
|
|
1131
|
+
*/
|
|
322
1132
|
constructor(imp?: any);
|
|
1133
|
+
/**
|
|
1134
|
+
* 设置圆心坐标。
|
|
1135
|
+
* @param x 圆心 x 坐标。
|
|
1136
|
+
* @param y 圆心 y 坐标。
|
|
1137
|
+
* @param z 圆心 z 坐标。
|
|
1138
|
+
*/
|
|
323
1139
|
setCenter(x: number, y: number, z?: number): void;
|
|
1140
|
+
/**
|
|
1141
|
+
* 获取圆心坐标。
|
|
1142
|
+
*/
|
|
324
1143
|
get center(): MdGePoint3d;
|
|
1144
|
+
/**
|
|
1145
|
+
* 设置圆心坐标。
|
|
1146
|
+
* @param pt 圆心坐标。
|
|
1147
|
+
*/
|
|
325
1148
|
set center(pt: MdGePoint3d);
|
|
1149
|
+
/**
|
|
1150
|
+
* 获取圆半径。
|
|
1151
|
+
*/
|
|
326
1152
|
get radius(): number;
|
|
1153
|
+
/**
|
|
1154
|
+
* 设置圆半径。
|
|
1155
|
+
* @param r 圆半径。
|
|
1156
|
+
*/
|
|
327
1157
|
set radius(r: number);
|
|
328
1158
|
}
|
|
1159
|
+
/**
|
|
1160
|
+
* 多段线类
|
|
1161
|
+
*/
|
|
329
1162
|
export declare class MdDbPolyline extends MdDbCurve {
|
|
1163
|
+
/**
|
|
1164
|
+
* 构造函数
|
|
1165
|
+
* @param imp 实现对象
|
|
1166
|
+
*/
|
|
330
1167
|
constructor(imp?: any);
|
|
1168
|
+
/**
|
|
1169
|
+
* 获取是否闭合
|
|
1170
|
+
*/
|
|
331
1171
|
get isClosed(): boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* 设置是否闭合
|
|
1174
|
+
* @param val 是否闭合
|
|
1175
|
+
*/
|
|
332
1176
|
set isClosed(val: boolean);
|
|
1177
|
+
/**
|
|
1178
|
+
* 获取常量宽度
|
|
1179
|
+
*/
|
|
333
1180
|
get constantWidth(): number;
|
|
1181
|
+
/**
|
|
1182
|
+
* 设置常量宽度
|
|
1183
|
+
* @param val 常量宽度
|
|
1184
|
+
*/
|
|
334
1185
|
set constantWidth(val: number);
|
|
1186
|
+
/**
|
|
1187
|
+
* 在指定位置添加顶点
|
|
1188
|
+
* @param index 位置
|
|
1189
|
+
* @param pt 点
|
|
1190
|
+
* @param bulge 凸度
|
|
1191
|
+
* @param startWidth 起始宽度
|
|
1192
|
+
* @param endWidth 结束宽度
|
|
1193
|
+
*/
|
|
335
1194
|
addVertexAt(index: number, pt: McGePoint3d, bulge: number, startWidth: number, endWidth: number): boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* 移除指定位置的顶点
|
|
1197
|
+
* @param index 位置
|
|
1198
|
+
*/
|
|
336
1199
|
removeVertexAt(index: number): boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* 获取顶点数量
|
|
1202
|
+
*/
|
|
337
1203
|
numVerts(): number;
|
|
1204
|
+
/**
|
|
1205
|
+
* 获取指定位置的点
|
|
1206
|
+
* @param index 位置
|
|
1207
|
+
* @returns val: 点, ret: 返回值
|
|
1208
|
+
*/
|
|
338
1209
|
getPointAt(index: number): {
|
|
339
1210
|
val: number;
|
|
340
1211
|
ret: number;
|
|
341
1212
|
};
|
|
1213
|
+
/**
|
|
1214
|
+
* 获取指定位置的凸度
|
|
1215
|
+
* @param index 位置
|
|
1216
|
+
*/
|
|
342
1217
|
getBulgeAt(index: number): number;
|
|
1218
|
+
/**
|
|
1219
|
+
* 获取指定位置的起始和结束宽度
|
|
1220
|
+
* @param index 位置
|
|
1221
|
+
* @returns val1: 起始宽度, val2: 结束宽度, ret: 返回值
|
|
1222
|
+
*/
|
|
343
1223
|
getWidthsAt(index: number): {
|
|
344
1224
|
val1: number;
|
|
345
1225
|
val2: number;
|
|
346
1226
|
ret: number;
|
|
347
1227
|
};
|
|
1228
|
+
/**
|
|
1229
|
+
* 设置指定位置的点
|
|
1230
|
+
* @param index 位置
|
|
1231
|
+
* @param pt 点
|
|
1232
|
+
*/
|
|
348
1233
|
setPointAt(index: number, pt: McGePoint3d): boolean;
|
|
1234
|
+
/**
|
|
1235
|
+
* 设置指定位置的凸度
|
|
1236
|
+
* @param index 位置
|
|
1237
|
+
* @param bulge 凸度
|
|
1238
|
+
*/
|
|
349
1239
|
setBulgeAt(index: number, bulge: number): boolean;
|
|
350
1240
|
}
|
|
1241
|
+
/**
|
|
1242
|
+
* McDrawResbuf 类用于操作 AutoCAD 中的 resbuf 数据。
|
|
1243
|
+
*/
|
|
351
1244
|
export declare class McDrawResbuf extends MdRxObject {
|
|
1245
|
+
/**
|
|
1246
|
+
* 构造函数。
|
|
1247
|
+
* @param imp 实现对象。
|
|
1248
|
+
*/
|
|
352
1249
|
constructor(imp?: any);
|
|
1250
|
+
/**
|
|
1251
|
+
* 清空 resbuf 数据。
|
|
1252
|
+
*/
|
|
353
1253
|
Clear(): void;
|
|
1254
|
+
/**
|
|
1255
|
+
* 获取 resbuf 数据项个数。
|
|
1256
|
+
* @returns resbuf 数据项个数。
|
|
1257
|
+
*/
|
|
354
1258
|
GetCount(): number;
|
|
1259
|
+
/**
|
|
1260
|
+
* 获取 resbuf 数据项中的 double 类型值。
|
|
1261
|
+
* @param lItem 数据项索引。
|
|
1262
|
+
* @returns 包含 double 类型值和返回值的对象。
|
|
1263
|
+
*/
|
|
355
1264
|
AtDouble(lItem: number): {
|
|
356
1265
|
val: number;
|
|
357
1266
|
ret: number;
|
|
358
1267
|
};
|
|
1268
|
+
/**
|
|
1269
|
+
* 获取 resbuf 数据项中的 long 类型值。
|
|
1270
|
+
* @param lItem 数据项索引。
|
|
1271
|
+
* @returns 包含 long 类型值和返回值的对象。
|
|
1272
|
+
*/
|
|
359
1273
|
Atlong(lItem: number): {
|
|
360
1274
|
val: number;
|
|
361
1275
|
ret: number;
|
|
362
1276
|
};
|
|
1277
|
+
/**
|
|
1278
|
+
* 获取 resbuf 数据项中的 ObjectId。
|
|
1279
|
+
* @param lItem 数据项索引。
|
|
1280
|
+
* @returns 包含 ObjectId 和返回值的对象。
|
|
1281
|
+
*/
|
|
363
1282
|
AtObjectId(lItem: number): {
|
|
364
1283
|
val: number;
|
|
365
1284
|
ret: number;
|
|
366
1285
|
};
|
|
1286
|
+
/**
|
|
1287
|
+
* 获取 resbuf 数据项中的字符串。
|
|
1288
|
+
* @param lItem 数据项索引。
|
|
1289
|
+
* @returns 包含字符串和返回值的对象。
|
|
1290
|
+
*/
|
|
367
1291
|
AtString(lItem: number): {
|
|
368
1292
|
val: string;
|
|
369
1293
|
ret: number;
|
|
370
1294
|
};
|
|
1295
|
+
/**
|
|
1296
|
+
* 获取 resbuf 数据项中的点坐标。
|
|
1297
|
+
* @param lItem 数据项索引。
|
|
1298
|
+
* @returns 包含点坐标和返回值的对象。
|
|
1299
|
+
*/
|
|
371
1300
|
AtPoint(lItem: number): {
|
|
372
1301
|
val: MdGePoint3d;
|
|
373
1302
|
ret: number;
|
|
374
1303
|
};
|
|
1304
|
+
/**
|
|
1305
|
+
* 获取 resbuf 数据项中的数据类型。
|
|
1306
|
+
* @returns 数据类型。
|
|
1307
|
+
*/
|
|
375
1308
|
ItemDataType(): number;
|
|
1309
|
+
/**
|
|
1310
|
+
* 添加 double 类型值到 resbuf 中。
|
|
1311
|
+
* @param val double 类型值。
|
|
1312
|
+
* @param lDataType 数据类型。
|
|
1313
|
+
* @returns 添加的数据项索引。
|
|
1314
|
+
*/
|
|
376
1315
|
AddDouble(val: number, lDataType?: number): number;
|
|
1316
|
+
/**
|
|
1317
|
+
* 添加 long 类型值到 resbuf 中。
|
|
1318
|
+
* @param val long 类型值。
|
|
1319
|
+
* @param lDataType 数据类型。
|
|
1320
|
+
* @returns 添加的数据项索引。
|
|
1321
|
+
*/
|
|
377
1322
|
Addlong(val: number, lDataType?: number): number;
|
|
1323
|
+
/**
|
|
1324
|
+
* 添加 ObjectId 到 resbuf 中。
|
|
1325
|
+
* @param val ObjectId。
|
|
1326
|
+
* @param lDataType 数据类型。
|
|
1327
|
+
* @returns 添加的数据项索引。
|
|
1328
|
+
*/
|
|
378
1329
|
AddObjectId(val: number, lDataType?: number): number;
|
|
1330
|
+
/**
|
|
1331
|
+
* 添加字符串到 resbuf 中。
|
|
1332
|
+
* @param str 字符串。
|
|
1333
|
+
* @param lDataType 数据类型。
|
|
1334
|
+
* @returns 添加的数据项索引。
|
|
1335
|
+
*/
|
|
379
1336
|
AddString(str: string, lDataType?: number): number;
|
|
1337
|
+
/**
|
|
1338
|
+
* 添加点坐标到 resbuf 中。
|
|
1339
|
+
* @param pt 点坐标。
|
|
1340
|
+
* @param lDataType 数据类型。
|
|
1341
|
+
* @returns 添加的数据项索引。
|
|
1342
|
+
*/
|
|
380
1343
|
AddPoint(pt: MdGePoint3d, lDataType?: number): number;
|
|
1344
|
+
/**
|
|
1345
|
+
* 移除所有 resbuf 数据项。
|
|
1346
|
+
*/
|
|
381
1347
|
RemoveAll(): void;
|
|
1348
|
+
/**
|
|
1349
|
+
* 移除指定索引的 resbuf 数据项。
|
|
1350
|
+
* @param lItem 数据项索引。
|
|
1351
|
+
*/
|
|
382
1352
|
Remove(lItem: number): void;
|
|
383
1353
|
}
|
|
384
1354
|
declare enum MxObjectIdType {
|
|
@@ -386,22 +1356,66 @@ declare enum MxObjectIdType {
|
|
|
386
1356
|
kMxDraw = 1,
|
|
387
1357
|
kInvalid = 2
|
|
388
1358
|
}
|
|
1359
|
+
/**
|
|
1360
|
+
* MxObjectId类表示一个模型对象的唯一标识符。
|
|
1361
|
+
*/
|
|
389
1362
|
export declare class MxObjectId {
|
|
390
1363
|
private id;
|
|
391
1364
|
private type;
|
|
1365
|
+
/**
|
|
1366
|
+
* 创建一个MxObjectId实例。
|
|
1367
|
+
* @param id 对象的唯一标识符。
|
|
1368
|
+
* @param type 对象的类型。
|
|
1369
|
+
*/
|
|
392
1370
|
constructor(id: number, type: MxObjectIdType);
|
|
1371
|
+
/**
|
|
1372
|
+
* 获取对象的类型。
|
|
1373
|
+
* @returns 对象的类型。
|
|
1374
|
+
*/
|
|
393
1375
|
getType(): MxObjectIdType;
|
|
1376
|
+
/**
|
|
1377
|
+
* 获取对象的唯一标识符。
|
|
1378
|
+
* @returns 对象的唯一标识符。
|
|
1379
|
+
*/
|
|
394
1380
|
getId(): number;
|
|
1381
|
+
/**
|
|
1382
|
+
* 删除对象。
|
|
1383
|
+
*/
|
|
395
1384
|
erase(): void;
|
|
396
1385
|
}
|
|
397
1386
|
declare class McDrawUtilityClass {
|
|
398
1387
|
private imp;
|
|
399
1388
|
constructor();
|
|
400
|
-
|
|
1389
|
+
/**
|
|
1390
|
+
* eraseEntity 方法用于删除指定的图形对象
|
|
1391
|
+
* @param lId - 需要删除的图形对象的 ID
|
|
1392
|
+
* @returns 返回一个布尔值,表示是否删除成功
|
|
1393
|
+
*/
|
|
401
1394
|
eraseEntity(lId: number): boolean;
|
|
1395
|
+
/**
|
|
1396
|
+
* highlightEntity 方法用于高亮指定的图形对象
|
|
1397
|
+
* @param lId - 需要高亮的图形对象的 ID
|
|
1398
|
+
* @param isHighlight - 是否需要高亮,默认为 true
|
|
1399
|
+
*/
|
|
402
1400
|
highlightEntity(lId: number, isHighlight?: boolean): any;
|
|
1401
|
+
/**
|
|
1402
|
+
* findEntAtPoint 方法用于在指定坐标点附近查找图形对象
|
|
1403
|
+
* @param dX - 坐标点的 X 坐标值
|
|
1404
|
+
* @param dY - 坐标点的 Y 坐标值
|
|
1405
|
+
* @param dZ - 坐标点的 Z 坐标值
|
|
1406
|
+
* @param dSearhRange - 查找范围,默认为 -1(表示查找整个绘图区域)
|
|
1407
|
+
* @param filter - 过滤器,用于过滤查找到的图形对象,默认为 null(表示不进行过滤)
|
|
1408
|
+
* @returns 返回查找到的图形对象的 ID
|
|
1409
|
+
*/
|
|
403
1410
|
findEntAtPoint(dX: number, dY: number, dZ: number, dSearhRange?: number, filter?: McDrawResbuf | null): number;
|
|
1411
|
+
/**
|
|
1412
|
+
* selectEnt 方法用于在指定位置选择图形对象
|
|
1413
|
+
* @param strPrompt - 选择时的提示信息,默认为 null(表示不显示提示信息)
|
|
1414
|
+
* @param filter - 过滤器,用于过滤选择到的图形对象,默认为 null(表示不进行过滤)
|
|
1415
|
+
* @returns 返回一个 Promise,其中包含选择到的图形对象的 ID 数组
|
|
1416
|
+
*/
|
|
404
1417
|
selectEnt(strPrompt?: string, filter?: McDrawResbuf | null): Promise<MxObjectId[]>;
|
|
1418
|
+
private init;
|
|
405
1419
|
}
|
|
406
1420
|
export declare let McDrawUtility: McDrawUtilityClass;
|
|
407
1421
|
/** 绘制线段
|