@mlightcad/data-model 1.7.34 → 1.7.36
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/data-model.cjs +6 -6
- package/dist/data-model.js +3174 -2708
- package/lib/converter/AcDbDxfConverter.d.ts.map +1 -1
- package/lib/converter/AcDbDxfConverter.js +20 -9
- package/lib/converter/AcDbDxfConverter.js.map +1 -1
- package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -1
- package/lib/converter/AcDbEntitiyConverter.js +3 -7
- package/lib/converter/AcDbEntitiyConverter.js.map +1 -1
- package/lib/database/AcDbDatabase.d.ts +127 -11
- package/lib/database/AcDbDatabase.d.ts.map +1 -1
- package/lib/database/AcDbDatabase.js +200 -18
- package/lib/database/AcDbDatabase.js.map +1 -1
- package/lib/database/AcDbSysVarManager.d.ts +1 -0
- package/lib/database/AcDbSysVarManager.d.ts.map +1 -1
- package/lib/database/AcDbSysVarManager.js +126 -15
- package/lib/database/AcDbSysVarManager.js.map +1 -1
- package/lib/database/AcDbSystemVariables.d.ts +25 -9
- package/lib/database/AcDbSystemVariables.d.ts.map +1 -1
- package/lib/database/AcDbSystemVariables.js +24 -8
- package/lib/database/AcDbSystemVariables.js.map +1 -1
- package/lib/misc/AcDbConstants.d.ts +26 -0
- package/lib/misc/AcDbConstants.d.ts.map +1 -1
- package/lib/misc/AcDbConstants.js +9 -0
- package/lib/misc/AcDbConstants.js.map +1 -1
- package/lib/misc/AcDbFormatter.d.ts +215 -0
- package/lib/misc/AcDbFormatter.d.ts.map +1 -0
- package/lib/misc/AcDbFormatter.js +863 -0
- package/lib/misc/AcDbFormatter.js.map +1 -0
- package/lib/misc/AcDbLinearUnits.d.ts +21 -0
- package/lib/misc/AcDbLinearUnits.d.ts.map +1 -0
- package/lib/misc/AcDbLinearUnits.js +22 -0
- package/lib/misc/AcDbLinearUnits.js.map +1 -0
- package/lib/misc/index.d.ts +2 -0
- package/lib/misc/index.d.ts.map +1 -1
- package/lib/misc/index.js +2 -0
- package/lib/misc/index.js.map +1 -1
- package/lib/misc/pat/AcDbPatSvgRenderer.d.ts.map +1 -1
- package/lib/misc/pat/AcDbPatSvgRenderer.js.map +1 -1
- package/package.json +4 -4
|
@@ -2,6 +2,7 @@ import { AcCmColor, AcCmEventManager, AcCmTransparency } from '@mlightcad/common
|
|
|
2
2
|
import { AcDbObject, AcDbObjectId } from '../base/AcDbObject';
|
|
3
3
|
import { AcDbConverterType } from './AcDbDatabaseConverterManager';
|
|
4
4
|
import { AcDbEntity } from '../entity';
|
|
5
|
+
import { AcDbFormatter } from '../misc';
|
|
5
6
|
import { AcDbDictionary } from '../object/AcDbDictionary';
|
|
6
7
|
import { AcDbMLeaderStyle } from '../object/AcDbMLeaderStyle';
|
|
7
8
|
import { AcDbMlineStyle } from '../object/AcDbMlineStyle';
|
|
@@ -242,11 +243,17 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
242
243
|
/** Version of the database */
|
|
243
244
|
private _version;
|
|
244
245
|
/** Angle base for the database */
|
|
245
|
-
private
|
|
246
|
+
private _angbase;
|
|
246
247
|
/** Angle direction for the database */
|
|
247
|
-
private
|
|
248
|
+
private _angdir;
|
|
248
249
|
/** Angle units for the database */
|
|
249
250
|
private _aunits;
|
|
251
|
+
/** Angular display precision (AUPREC), used with {@link AcDbDatabase.aunits | AUNITS}. */
|
|
252
|
+
private _auprec;
|
|
253
|
+
/** Linear unit display format (LUNITS) for coordinates and distances. */
|
|
254
|
+
private _lunits;
|
|
255
|
+
/** Linear display precision (LUPREC), used with {@link lunits}. */
|
|
256
|
+
private _luprec;
|
|
250
257
|
/** Current entity color */
|
|
251
258
|
private _cecolor;
|
|
252
259
|
/** Current entity linetype scale */
|
|
@@ -279,6 +286,10 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
279
286
|
private _extents;
|
|
280
287
|
/** Insertion units for the database */
|
|
281
288
|
private _insunits;
|
|
289
|
+
/** Feet-inch / fractional delimiter style (UNITMODE) */
|
|
290
|
+
private _unitmode;
|
|
291
|
+
/** Legacy metric vs imperial flag (MEASUREMENT) */
|
|
292
|
+
private _measurement;
|
|
282
293
|
/** Global linetype scale */
|
|
283
294
|
private _ltscale;
|
|
284
295
|
/** The flag whether to display line weight */
|
|
@@ -297,6 +308,8 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
297
308
|
private _currentSpace?;
|
|
298
309
|
/** The maximum handle value in the database, used for generating unique object IDs */
|
|
299
310
|
private _maxHandle;
|
|
311
|
+
/** Lazily created formatter for lengths, angles, and coordinates */
|
|
312
|
+
private _formatter?;
|
|
300
313
|
/**
|
|
301
314
|
* Events that can be triggered by the database.
|
|
302
315
|
*
|
|
@@ -359,6 +372,18 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
359
372
|
readonly mlineStyle: AcDbDictionary<AcDbMlineStyle>;
|
|
360
373
|
readonly xrecord: AcDbDictionary<AcDbXrecord>;
|
|
361
374
|
};
|
|
375
|
+
/**
|
|
376
|
+
* Formatter for linear distances, point coordinates, and angles using this database's
|
|
377
|
+
* **LUNITS**, **AUNITS**, and related system variables.
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* database.formatter.formatLength(12.3456);
|
|
382
|
+
* database.formatter.formatPoint3d(point);
|
|
383
|
+
* database.formatter.formatAngle(angleRadians, { showUnits: true });
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
get formatter(): AcDbFormatter;
|
|
362
387
|
/**
|
|
363
388
|
* Generates a new unique object ID (handle) for the database.
|
|
364
389
|
* The handle is a hexadecimal string that increments from the current max handle.
|
|
@@ -419,11 +444,27 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
419
444
|
*/
|
|
420
445
|
set currentSpaceId(value: AcDbObjectId);
|
|
421
446
|
/**
|
|
422
|
-
*
|
|
447
|
+
* Angular unit **display and entry** format for the drawing (AutoCAD system variable **AUNITS**).
|
|
448
|
+
*
|
|
449
|
+
* This does not change how angles are stored internally (radians in geometry); it controls how
|
|
450
|
+
* angles are formatted in the UI and how numeric angle input is interpreted, together with
|
|
451
|
+
* {@link angbase} (**ANGBASE**) and {@link angdir} (**ANGDIR**).
|
|
452
|
+
*
|
|
453
|
+
* @returns Integer code matching {@link AcDbAngleUnits}:
|
|
423
454
|
*
|
|
424
|
-
*
|
|
455
|
+
* | Value | Meaning |
|
|
456
|
+
* |------:|---------|
|
|
457
|
+
* | `0` | **Decimal degrees** — e.g. `45.5` |
|
|
458
|
+
* | `1` | **Degrees/minutes/seconds** — e.g. `45d30'15"` |
|
|
459
|
+
* | `2` | **Gradians** — e.g. `50g` (400 grads = full circle) |
|
|
460
|
+
* | `3` | **Radians** — e.g. `0.785398...` |
|
|
461
|
+
* | `4` | **Surveyor's units** — quadrant bearing notation (e.g. `N 45d30'15" E`) |
|
|
425
462
|
*
|
|
426
|
-
* @
|
|
463
|
+
* @remarks
|
|
464
|
+
* Prefer assigning {@link AcDbAngleUnits} enum members for readability instead of raw integers.
|
|
465
|
+
*
|
|
466
|
+
* @see {@link AcDbAngleUnits} for the canonical enum used by this codebase.
|
|
467
|
+
* @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?caas=caas/documentation/ACD/2014/ENU/files/GUID-C7C0F6A5-7982-43DB-97F9-5B9B0044E9FA-htm.html | AutoCAD Help: AUNITS}
|
|
427
468
|
*
|
|
428
469
|
* @example
|
|
429
470
|
* ```typescript
|
|
@@ -432,9 +473,9 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
432
473
|
*/
|
|
433
474
|
get aunits(): number;
|
|
434
475
|
/**
|
|
435
|
-
* Sets the
|
|
476
|
+
* Sets **AUNITS** — the angular unit display format (see {@link aunits} getter for value meanings).
|
|
436
477
|
*
|
|
437
|
-
* @param value -
|
|
478
|
+
* @param value - Integer `0`–`4` per {@link AcDbAngleUnits}, or `undefined`/`null` coerced to `0` by the setter chain.
|
|
438
479
|
*
|
|
439
480
|
* @example
|
|
440
481
|
* ```typescript
|
|
@@ -442,6 +483,64 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
442
483
|
* ```
|
|
443
484
|
*/
|
|
444
485
|
set aunits(value: number);
|
|
486
|
+
/**
|
|
487
|
+
* Angular display precision for the drawing (**AUPREC**): how many decimal places (or equivalent)
|
|
488
|
+
* are used when showing angles, in conjunction with {@link aunits}.
|
|
489
|
+
*
|
|
490
|
+
* AutoCAD typically uses integers in the range **0–8**; behavior for other values is
|
|
491
|
+
* implementation-defined in this library (stored as-is).
|
|
492
|
+
*
|
|
493
|
+
* @see {@link https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-EE1ED20C-1096-4299-820F-83F1BC9B96F3 | AutoCAD Help: AUPREC}
|
|
494
|
+
*/
|
|
495
|
+
get auprec(): number;
|
|
496
|
+
/**
|
|
497
|
+
* Sets **AUPREC** — angular display precision (see {@link auprec} getter).
|
|
498
|
+
*/
|
|
499
|
+
set auprec(value: number);
|
|
500
|
+
/**
|
|
501
|
+
* Linear unit **display and entry** format for coordinates and lengths (**LUNITS**).
|
|
502
|
+
*
|
|
503
|
+
* This does not set real-world drawing units for inserts (see {@link insunits}); it controls how
|
|
504
|
+
* linear distances are shown and parsed (scientific, decimal, engineering, and so on).
|
|
505
|
+
*
|
|
506
|
+
* @returns Integer code matching {@link AcDbLinearUnits}:
|
|
507
|
+
*
|
|
508
|
+
* | Value | Meaning |
|
|
509
|
+
* |------:|---------|
|
|
510
|
+
* | `1` | **Scientific** |
|
|
511
|
+
* | `2` | **Decimal** |
|
|
512
|
+
* | `3` | **Engineering** (feet + decimal inches) |
|
|
513
|
+
* | `4` | **Architectural** (feet + fractional inches) |
|
|
514
|
+
* | `5` | **Fractional** |
|
|
515
|
+
* | `6` | **Windows desktop** (processing / computational format) |
|
|
516
|
+
*
|
|
517
|
+
* @remarks
|
|
518
|
+
* Prefer assigning {@link AcDbLinearUnits} enum members instead of raw integers.
|
|
519
|
+
*
|
|
520
|
+
* @see {@link AcDbLinearUnits}
|
|
521
|
+
* @see {@link https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-D7C80D1F-B1C0-44A9-898E-B3100FF391CB | AutoCAD Help: LUNITS}
|
|
522
|
+
*/
|
|
523
|
+
get lunits(): number;
|
|
524
|
+
/**
|
|
525
|
+
* Sets **LUNITS** — linear display format (see {@link lunits} getter).
|
|
526
|
+
*
|
|
527
|
+
* @param value - Integer per {@link AcDbLinearUnits}, or coerced default {@link AcDbLinearUnits.Decimal} when `undefined`/`null`.
|
|
528
|
+
*/
|
|
529
|
+
set lunits(value: number);
|
|
530
|
+
/**
|
|
531
|
+
* Linear display precision for the drawing (**LUPREC**): number of decimal places (or equivalent)
|
|
532
|
+
* used when showing linear distances, together with {@link lunits}.
|
|
533
|
+
*
|
|
534
|
+
* AutoCAD typically uses integers in the range **0–8**; initial value is commonly **4**.
|
|
535
|
+
* Values outside that range are stored as-is by this library.
|
|
536
|
+
*
|
|
537
|
+
* @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?guid=GUID-5FFF39D6-EFC7-49F5-B56A-6023EB5C0DE7 | AutoCAD Help: LUPREC}
|
|
538
|
+
*/
|
|
539
|
+
get luprec(): number;
|
|
540
|
+
/**
|
|
541
|
+
* Sets **LUPREC** — linear display precision (see {@link luprec} getter).
|
|
542
|
+
*/
|
|
543
|
+
set luprec(value: number);
|
|
445
544
|
/**
|
|
446
545
|
* Gets the version of the database.
|
|
447
546
|
*
|
|
@@ -479,6 +578,23 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
479
578
|
* ```
|
|
480
579
|
*/
|
|
481
580
|
set insunits(value: number);
|
|
581
|
+
/**
|
|
582
|
+
* Controls how feet-inch and fractional linear values are delimited (**UNITMODE**).
|
|
583
|
+
*
|
|
584
|
+
* - `0`: Report format (for example `1'-3 1/2"`)
|
|
585
|
+
* - `1`: Input format (for example `1'-3-1/2"`, fewer spaces)
|
|
586
|
+
*
|
|
587
|
+
* @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?guid=GUID-C52134E8-10EB-4AE7-A0C0-8F798C68F823 | AutoCAD Help: UNITMODE}
|
|
588
|
+
*/
|
|
589
|
+
get unitmode(): number;
|
|
590
|
+
set unitmode(value: number);
|
|
591
|
+
/**
|
|
592
|
+
* Legacy drawing measurement system (**MEASUREMENT**): `0` = English, `1` = metric.
|
|
593
|
+
*
|
|
594
|
+
* When **INSUNITS** is unitless, this selects the default real-world unit family for labels.
|
|
595
|
+
*/
|
|
596
|
+
get measurement(): number;
|
|
597
|
+
set measurement(value: number);
|
|
482
598
|
/**
|
|
483
599
|
* Gets the line type scale factor.
|
|
484
600
|
*
|
|
@@ -617,15 +733,15 @@ export declare class AcDbDatabase extends AcDbObject {
|
|
|
617
733
|
/**
|
|
618
734
|
* The zero (0) base angle with respect to the current UCS in radians.
|
|
619
735
|
*/
|
|
620
|
-
get
|
|
621
|
-
set
|
|
736
|
+
get angbase(): number;
|
|
737
|
+
set angbase(value: number);
|
|
622
738
|
/**
|
|
623
739
|
* The direction of positive angles.
|
|
624
740
|
* - 0: Counterclockwise
|
|
625
741
|
* - 1: Clockwise
|
|
626
742
|
*/
|
|
627
|
-
get
|
|
628
|
-
set
|
|
743
|
+
get angdir(): number;
|
|
744
|
+
set angdir(value: number);
|
|
629
745
|
/**
|
|
630
746
|
* The current Model Space EXTMAX value
|
|
631
747
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbDatabase.d.ts","sourceRoot":"","sources":["../../src/database/AcDbDatabase.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAET,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,EACL,iBAAiB,EAGlB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcDbDatab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AAC,yBAAyB;IAoBjC;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;CAa3B"}
|
|
@@ -91,7 +91,7 @@ import { AcDbDxfFiler } from '../base/AcDbDxfFiler';
|
|
|
91
91
|
import { AcDbObject } from '../base/AcDbObject';
|
|
92
92
|
import { AcDbRegenerator } from '../converter';
|
|
93
93
|
import { AcDbDatabaseConverterManager, AcDbFileType } from './AcDbDatabaseConverterManager';
|
|
94
|
-
import { ACAD_APPID, AcDbAngleUnits, AcDbDataGenerator, AcDbUnitsValue, ByBlock, ByLayer, DEFAULT_MLEADER_STYLE, DEFAULT_MLINE_STYLE, DEFAULT_LINE_TYPE, DEFAULT_TEXT_STYLE, MLIGHTCAD_APPID } from '../misc';
|
|
94
|
+
import { ACAD_APPID, AcDbAngleUnits, AcDbDataGenerator, AcDbFormatter, AcDbLinearUnits, AcDbUnitsValue, ByBlock, ByLayer, DEFAULT_MLEADER_STYLE, DEFAULT_MLINE_STYLE, DEFAULT_LINE_TYPE, DEFAULT_TEXT_STYLE, MLIGHTCAD_APPID } from '../misc';
|
|
95
95
|
import { AcDbDictionary } from '../object/AcDbDictionary';
|
|
96
96
|
import { AcDbMLeaderStyle } from '../object/AcDbMLeaderStyle';
|
|
97
97
|
import { AcDbMlineStyle } from '../object/AcDbMlineStyle';
|
|
@@ -167,9 +167,12 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
167
167
|
openProgress: new AcCmEventManager()
|
|
168
168
|
};
|
|
169
169
|
_this._version = new AcDbDwgVersion('AC1014');
|
|
170
|
-
_this.
|
|
171
|
-
_this.
|
|
170
|
+
_this._angbase = 0;
|
|
171
|
+
_this._angdir = 0;
|
|
172
172
|
_this._aunits = AcDbAngleUnits.DecimalDegrees;
|
|
173
|
+
_this._auprec = 0;
|
|
174
|
+
_this._lunits = AcDbLinearUnits.Decimal;
|
|
175
|
+
_this._luprec = 4;
|
|
173
176
|
_this._celtscale = 1;
|
|
174
177
|
_this._cecolor = new AcCmColor();
|
|
175
178
|
_this._celtype = ByLayer;
|
|
@@ -187,6 +190,8 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
187
190
|
_this._extents = new AcGeBox3d();
|
|
188
191
|
// TODO: Default value is 1 (imperial) or 4 (metric)
|
|
189
192
|
_this._insunits = AcDbUnitsValue.Millimeters;
|
|
193
|
+
_this._unitmode = 0;
|
|
194
|
+
_this._measurement = 1;
|
|
190
195
|
_this._ltscale = 1;
|
|
191
196
|
_this._lwdisplay = false;
|
|
192
197
|
_this._pdmode = 0;
|
|
@@ -250,6 +255,25 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
250
255
|
enumerable: false,
|
|
251
256
|
configurable: true
|
|
252
257
|
});
|
|
258
|
+
Object.defineProperty(AcDbDatabase.prototype, "formatter", {
|
|
259
|
+
/**
|
|
260
|
+
* Formatter for linear distances, point coordinates, and angles using this database's
|
|
261
|
+
* **LUNITS**, **AUNITS**, and related system variables.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* database.formatter.formatLength(12.3456);
|
|
266
|
+
* database.formatter.formatPoint3d(point);
|
|
267
|
+
* database.formatter.formatAngle(angleRadians, { showUnits: true });
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
get: function () {
|
|
271
|
+
var _a;
|
|
272
|
+
return ((_a = this._formatter) !== null && _a !== void 0 ? _a : (this._formatter = new AcDbFormatter(this)));
|
|
273
|
+
},
|
|
274
|
+
enumerable: false,
|
|
275
|
+
configurable: true
|
|
276
|
+
});
|
|
253
277
|
/**
|
|
254
278
|
* Generates a new unique object ID (handle) for the database.
|
|
255
279
|
* The handle is a hexadecimal string that increments from the current max handle.
|
|
@@ -344,11 +368,27 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
344
368
|
});
|
|
345
369
|
Object.defineProperty(AcDbDatabase.prototype, "aunits", {
|
|
346
370
|
/**
|
|
347
|
-
*
|
|
371
|
+
* Angular unit **display and entry** format for the drawing (AutoCAD system variable **AUNITS**).
|
|
348
372
|
*
|
|
349
|
-
* This
|
|
373
|
+
* This does not change how angles are stored internally (radians in geometry); it controls how
|
|
374
|
+
* angles are formatted in the UI and how numeric angle input is interpreted, together with
|
|
375
|
+
* {@link angbase} (**ANGBASE**) and {@link angdir} (**ANGDIR**).
|
|
350
376
|
*
|
|
351
|
-
* @returns
|
|
377
|
+
* @returns Integer code matching {@link AcDbAngleUnits}:
|
|
378
|
+
*
|
|
379
|
+
* | Value | Meaning |
|
|
380
|
+
* |------:|---------|
|
|
381
|
+
* | `0` | **Decimal degrees** — e.g. `45.5` |
|
|
382
|
+
* | `1` | **Degrees/minutes/seconds** — e.g. `45d30'15"` |
|
|
383
|
+
* | `2` | **Gradians** — e.g. `50g` (400 grads = full circle) |
|
|
384
|
+
* | `3` | **Radians** — e.g. `0.785398...` |
|
|
385
|
+
* | `4` | **Surveyor's units** — quadrant bearing notation (e.g. `N 45d30'15" E`) |
|
|
386
|
+
*
|
|
387
|
+
* @remarks
|
|
388
|
+
* Prefer assigning {@link AcDbAngleUnits} enum members for readability instead of raw integers.
|
|
389
|
+
*
|
|
390
|
+
* @see {@link AcDbAngleUnits} for the canonical enum used by this codebase.
|
|
391
|
+
* @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?caas=caas/documentation/ACD/2014/ENU/files/GUID-C7C0F6A5-7982-43DB-97F9-5B9B0044E9FA-htm.html | AutoCAD Help: AUNITS}
|
|
352
392
|
*
|
|
353
393
|
* @example
|
|
354
394
|
* ```typescript
|
|
@@ -359,9 +399,9 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
359
399
|
return this._aunits;
|
|
360
400
|
},
|
|
361
401
|
/**
|
|
362
|
-
* Sets the
|
|
402
|
+
* Sets **AUNITS** — the angular unit display format (see {@link aunits} getter for value meanings).
|
|
363
403
|
*
|
|
364
|
-
* @param value -
|
|
404
|
+
* @param value - Integer `0`–`4` per {@link AcDbAngleUnits}, or `undefined`/`null` coerced to `0` by the setter chain.
|
|
365
405
|
*
|
|
366
406
|
* @example
|
|
367
407
|
* ```typescript
|
|
@@ -377,6 +417,97 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
377
417
|
enumerable: false,
|
|
378
418
|
configurable: true
|
|
379
419
|
});
|
|
420
|
+
Object.defineProperty(AcDbDatabase.prototype, "auprec", {
|
|
421
|
+
/**
|
|
422
|
+
* Angular display precision for the drawing (**AUPREC**): how many decimal places (or equivalent)
|
|
423
|
+
* are used when showing angles, in conjunction with {@link aunits}.
|
|
424
|
+
*
|
|
425
|
+
* AutoCAD typically uses integers in the range **0–8**; behavior for other values is
|
|
426
|
+
* implementation-defined in this library (stored as-is).
|
|
427
|
+
*
|
|
428
|
+
* @see {@link https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-EE1ED20C-1096-4299-820F-83F1BC9B96F3 | AutoCAD Help: AUPREC}
|
|
429
|
+
*/
|
|
430
|
+
get: function () {
|
|
431
|
+
return this._auprec;
|
|
432
|
+
},
|
|
433
|
+
/**
|
|
434
|
+
* Sets **AUPREC** — angular display precision (see {@link auprec} getter).
|
|
435
|
+
*/
|
|
436
|
+
set: function (value) {
|
|
437
|
+
var _this = this;
|
|
438
|
+
this.updateSysVar(AcDbSystemVariables.AUPREC, this._auprec, value !== null && value !== void 0 ? value : 0, function (nextValue) {
|
|
439
|
+
_this._auprec = nextValue;
|
|
440
|
+
});
|
|
441
|
+
},
|
|
442
|
+
enumerable: false,
|
|
443
|
+
configurable: true
|
|
444
|
+
});
|
|
445
|
+
Object.defineProperty(AcDbDatabase.prototype, "lunits", {
|
|
446
|
+
/**
|
|
447
|
+
* Linear unit **display and entry** format for coordinates and lengths (**LUNITS**).
|
|
448
|
+
*
|
|
449
|
+
* This does not set real-world drawing units for inserts (see {@link insunits}); it controls how
|
|
450
|
+
* linear distances are shown and parsed (scientific, decimal, engineering, and so on).
|
|
451
|
+
*
|
|
452
|
+
* @returns Integer code matching {@link AcDbLinearUnits}:
|
|
453
|
+
*
|
|
454
|
+
* | Value | Meaning |
|
|
455
|
+
* |------:|---------|
|
|
456
|
+
* | `1` | **Scientific** |
|
|
457
|
+
* | `2` | **Decimal** |
|
|
458
|
+
* | `3` | **Engineering** (feet + decimal inches) |
|
|
459
|
+
* | `4` | **Architectural** (feet + fractional inches) |
|
|
460
|
+
* | `5` | **Fractional** |
|
|
461
|
+
* | `6` | **Windows desktop** (processing / computational format) |
|
|
462
|
+
*
|
|
463
|
+
* @remarks
|
|
464
|
+
* Prefer assigning {@link AcDbLinearUnits} enum members instead of raw integers.
|
|
465
|
+
*
|
|
466
|
+
* @see {@link AcDbLinearUnits}
|
|
467
|
+
* @see {@link https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-D7C80D1F-B1C0-44A9-898E-B3100FF391CB | AutoCAD Help: LUNITS}
|
|
468
|
+
*/
|
|
469
|
+
get: function () {
|
|
470
|
+
return this._lunits;
|
|
471
|
+
},
|
|
472
|
+
/**
|
|
473
|
+
* Sets **LUNITS** — linear display format (see {@link lunits} getter).
|
|
474
|
+
*
|
|
475
|
+
* @param value - Integer per {@link AcDbLinearUnits}, or coerced default {@link AcDbLinearUnits.Decimal} when `undefined`/`null`.
|
|
476
|
+
*/
|
|
477
|
+
set: function (value) {
|
|
478
|
+
var _this = this;
|
|
479
|
+
this.updateSysVar(AcDbSystemVariables.LUNITS, this._lunits, value !== null && value !== void 0 ? value : AcDbLinearUnits.Decimal, function (nextValue) {
|
|
480
|
+
_this._lunits = nextValue;
|
|
481
|
+
});
|
|
482
|
+
},
|
|
483
|
+
enumerable: false,
|
|
484
|
+
configurable: true
|
|
485
|
+
});
|
|
486
|
+
Object.defineProperty(AcDbDatabase.prototype, "luprec", {
|
|
487
|
+
/**
|
|
488
|
+
* Linear display precision for the drawing (**LUPREC**): number of decimal places (or equivalent)
|
|
489
|
+
* used when showing linear distances, together with {@link lunits}.
|
|
490
|
+
*
|
|
491
|
+
* AutoCAD typically uses integers in the range **0–8**; initial value is commonly **4**.
|
|
492
|
+
* Values outside that range are stored as-is by this library.
|
|
493
|
+
*
|
|
494
|
+
* @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?guid=GUID-5FFF39D6-EFC7-49F5-B56A-6023EB5C0DE7 | AutoCAD Help: LUPREC}
|
|
495
|
+
*/
|
|
496
|
+
get: function () {
|
|
497
|
+
return this._luprec;
|
|
498
|
+
},
|
|
499
|
+
/**
|
|
500
|
+
* Sets **LUPREC** — linear display precision (see {@link luprec} getter).
|
|
501
|
+
*/
|
|
502
|
+
set: function (value) {
|
|
503
|
+
var _this = this;
|
|
504
|
+
this.updateSysVar(AcDbSystemVariables.LUPREC, this._luprec, value !== null && value !== void 0 ? value : 4, function (nextValue) {
|
|
505
|
+
_this._luprec = nextValue;
|
|
506
|
+
});
|
|
507
|
+
},
|
|
508
|
+
enumerable: false,
|
|
509
|
+
configurable: true
|
|
510
|
+
});
|
|
380
511
|
Object.defineProperty(AcDbDatabase.prototype, "version", {
|
|
381
512
|
/**
|
|
382
513
|
* Gets the version of the database.
|
|
@@ -437,6 +568,45 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
437
568
|
enumerable: false,
|
|
438
569
|
configurable: true
|
|
439
570
|
});
|
|
571
|
+
Object.defineProperty(AcDbDatabase.prototype, "unitmode", {
|
|
572
|
+
/**
|
|
573
|
+
* Controls how feet-inch and fractional linear values are delimited (**UNITMODE**).
|
|
574
|
+
*
|
|
575
|
+
* - `0`: Report format (for example `1'-3 1/2"`)
|
|
576
|
+
* - `1`: Input format (for example `1'-3-1/2"`, fewer spaces)
|
|
577
|
+
*
|
|
578
|
+
* @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?guid=GUID-C52134E8-10EB-4AE7-A0C0-8F798C68F823 | AutoCAD Help: UNITMODE}
|
|
579
|
+
*/
|
|
580
|
+
get: function () {
|
|
581
|
+
return this._unitmode;
|
|
582
|
+
},
|
|
583
|
+
set: function (value) {
|
|
584
|
+
var _this = this;
|
|
585
|
+
this.updateSysVar(AcDbSystemVariables.UNITMODE, this._unitmode, value !== null && value !== void 0 ? value : 0, function (nextValue) {
|
|
586
|
+
_this._unitmode = nextValue;
|
|
587
|
+
});
|
|
588
|
+
},
|
|
589
|
+
enumerable: false,
|
|
590
|
+
configurable: true
|
|
591
|
+
});
|
|
592
|
+
Object.defineProperty(AcDbDatabase.prototype, "measurement", {
|
|
593
|
+
/**
|
|
594
|
+
* Legacy drawing measurement system (**MEASUREMENT**): `0` = English, `1` = metric.
|
|
595
|
+
*
|
|
596
|
+
* When **INSUNITS** is unitless, this selects the default real-world unit family for labels.
|
|
597
|
+
*/
|
|
598
|
+
get: function () {
|
|
599
|
+
return this._measurement;
|
|
600
|
+
},
|
|
601
|
+
set: function (value) {
|
|
602
|
+
var _this = this;
|
|
603
|
+
this.updateSysVar(AcDbSystemVariables.MEASUREMENT, this._measurement, value !== null && value !== void 0 ? value : 1, function (nextValue) {
|
|
604
|
+
_this._measurement = nextValue;
|
|
605
|
+
});
|
|
606
|
+
},
|
|
607
|
+
enumerable: false,
|
|
608
|
+
configurable: true
|
|
609
|
+
});
|
|
440
610
|
Object.defineProperty(AcDbDatabase.prototype, "ltscale", {
|
|
441
611
|
/**
|
|
442
612
|
* Gets the line type scale factor.
|
|
@@ -749,35 +919,35 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
749
919
|
enumerable: false,
|
|
750
920
|
configurable: true
|
|
751
921
|
});
|
|
752
|
-
Object.defineProperty(AcDbDatabase.prototype, "
|
|
922
|
+
Object.defineProperty(AcDbDatabase.prototype, "angbase", {
|
|
753
923
|
/**
|
|
754
924
|
* The zero (0) base angle with respect to the current UCS in radians.
|
|
755
925
|
*/
|
|
756
926
|
get: function () {
|
|
757
|
-
return this.
|
|
927
|
+
return this._angbase;
|
|
758
928
|
},
|
|
759
929
|
set: function (value) {
|
|
760
930
|
var _this = this;
|
|
761
|
-
this.updateSysVar(AcDbSystemVariables.ANGBASE, this.
|
|
762
|
-
_this.
|
|
931
|
+
this.updateSysVar(AcDbSystemVariables.ANGBASE, this._angbase, value !== null && value !== void 0 ? value : 0, function (nextValue) {
|
|
932
|
+
_this._angbase = nextValue;
|
|
763
933
|
});
|
|
764
934
|
},
|
|
765
935
|
enumerable: false,
|
|
766
936
|
configurable: true
|
|
767
937
|
});
|
|
768
|
-
Object.defineProperty(AcDbDatabase.prototype, "
|
|
938
|
+
Object.defineProperty(AcDbDatabase.prototype, "angdir", {
|
|
769
939
|
/**
|
|
770
940
|
* The direction of positive angles.
|
|
771
941
|
* - 0: Counterclockwise
|
|
772
942
|
* - 1: Clockwise
|
|
773
943
|
*/
|
|
774
944
|
get: function () {
|
|
775
|
-
return this.
|
|
945
|
+
return this._angdir;
|
|
776
946
|
},
|
|
777
947
|
set: function (value) {
|
|
778
948
|
var _this = this;
|
|
779
|
-
this.updateSysVar(AcDbSystemVariables.ANGDIR, this.
|
|
780
|
-
_this.
|
|
949
|
+
this.updateSysVar(AcDbSystemVariables.ANGDIR, this._angdir, value !== null && value !== void 0 ? value : 0, function (nextValue) {
|
|
950
|
+
_this._angdir = nextValue;
|
|
781
951
|
});
|
|
782
952
|
},
|
|
783
953
|
enumerable: false,
|
|
@@ -1388,6 +1558,14 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
1388
1558
|
}
|
|
1389
1559
|
filer.writeString(9, '$INSUNITS');
|
|
1390
1560
|
filer.writeInt16(70, this.insunits);
|
|
1561
|
+
filer.writeString(9, '$LUNITS');
|
|
1562
|
+
filer.writeInt16(70, this.lunits);
|
|
1563
|
+
filer.writeString(9, '$LUPREC');
|
|
1564
|
+
filer.writeInt16(70, this.luprec);
|
|
1565
|
+
filer.writeString(9, '$UNITMODE');
|
|
1566
|
+
filer.writeInt16(70, this.unitmode);
|
|
1567
|
+
filer.writeString(9, '$MEASUREMENT');
|
|
1568
|
+
filer.writeInt16(70, this.measurement);
|
|
1391
1569
|
filer.writeString(9, '$LTSCALE');
|
|
1392
1570
|
filer.writeDouble(40, this.ltscale);
|
|
1393
1571
|
filer.writeString(9, '$LWDISPLAY');
|
|
@@ -1423,9 +1601,13 @@ var AcDbDatabase = /** @class */ (function (_super) {
|
|
|
1423
1601
|
filer.writeString(9, '$TEXTSTYLE');
|
|
1424
1602
|
filer.writeString(7, this.textstyle);
|
|
1425
1603
|
filer.writeString(9, '$ANGBASE');
|
|
1426
|
-
filer.writeAngle(50, this.
|
|
1604
|
+
filer.writeAngle(50, this.angbase);
|
|
1427
1605
|
filer.writeString(9, '$ANGDIR');
|
|
1428
|
-
filer.writeInt16(70, this.
|
|
1606
|
+
filer.writeInt16(70, this.angdir);
|
|
1607
|
+
filer.writeString(9, '$AUNITS');
|
|
1608
|
+
filer.writeInt16(70, this.aunits);
|
|
1609
|
+
filer.writeString(9, '$AUPREC');
|
|
1610
|
+
filer.writeInt16(70, this.auprec);
|
|
1429
1611
|
filer.writeString(9, '$EXTMIN');
|
|
1430
1612
|
filer.writePoint3d(10, this.extmin);
|
|
1431
1613
|
filer.writeString(9, '$EXTMAX');
|