@mlightcad/data-model 1.6.10 → 1.7.0
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 +21 -21
- package/README.md +224 -224
- package/dist/data-model.cjs +5 -5
- package/dist/data-model.js +5420 -5110
- package/lib/base/AcDbDxfCode.d.ts +187 -0
- package/lib/base/AcDbDxfCode.d.ts.map +1 -0
- package/lib/base/AcDbDxfCode.js +2 -0
- package/lib/base/AcDbDxfCode.js.map +1 -0
- package/lib/base/AcDbObject.d.ts +126 -0
- package/lib/base/AcDbObject.d.ts.map +1 -1
- package/lib/base/AcDbObject.js +178 -0
- package/lib/base/AcDbObject.js.map +1 -1
- package/lib/base/AcDbResultBuffer.d.ts +57 -0
- package/lib/base/AcDbResultBuffer.d.ts.map +1 -0
- package/lib/base/AcDbResultBuffer.js +130 -0
- package/lib/base/AcDbResultBuffer.js.map +1 -0
- package/lib/base/AcDbTypedValue.d.ts +19 -0
- package/lib/base/AcDbTypedValue.d.ts.map +1 -0
- package/lib/base/AcDbTypedValue.js +2 -0
- package/lib/base/AcDbTypedValue.js.map +1 -0
- package/lib/base/index.d.ts +3 -0
- package/lib/base/index.d.ts.map +1 -1
- package/lib/base/index.js +3 -0
- package/lib/base/index.js.map +1 -1
- package/lib/converter/AcDbDxfConverter.js +2 -2
- package/lib/converter/AcDbDxfConverter.js.map +1 -1
- package/lib/converter/AcDbRegenerator.js +2 -2
- package/lib/converter/AcDbRegenerator.js.map +1 -1
- package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbBlockTableRecord.js +2 -0
- package/lib/database/AcDbBlockTableRecord.js.map +1 -1
- package/lib/database/AcDbDatabase.d.ts +24 -20
- package/lib/database/AcDbDatabase.d.ts.map +1 -1
- package/lib/database/AcDbDatabase.js +42 -19
- package/lib/database/AcDbDatabase.js.map +1 -1
- package/lib/database/AcDbDatabaseConverter.js +1 -1
- package/lib/database/AcDbDatabaseConverter.js.map +1 -1
- package/lib/database/AcDbRegAppTable.d.ts +16 -0
- package/lib/database/AcDbRegAppTable.d.ts.map +1 -0
- package/lib/database/AcDbRegAppTable.js +34 -0
- package/lib/database/AcDbRegAppTable.js.map +1 -0
- package/lib/database/AcDbRegAppTableRecord.d.ts +10 -0
- package/lib/database/AcDbRegAppTableRecord.d.ts.map +1 -0
- package/lib/database/AcDbRegAppTableRecord.js +32 -0
- package/lib/database/AcDbRegAppTableRecord.js.map +1 -0
- package/lib/database/AcDbSysVarManager.js +1 -1
- package/lib/database/AcDbSysVarManager.js.map +1 -1
- package/lib/database/index.d.ts +2 -0
- package/lib/database/index.d.ts.map +1 -1
- package/lib/database/index.js +2 -0
- package/lib/database/index.js.map +1 -1
- package/lib/entity/AcDbEntity.d.ts +28 -0
- package/lib/entity/AcDbEntity.d.ts.map +1 -1
- package/lib/entity/AcDbEntity.js +39 -0
- package/lib/entity/AcDbEntity.js.map +1 -1
- package/lib/entity/AcDbRasterImage.js +1 -1
- package/lib/entity/AcDbRasterImage.js.map +1 -1
- package/lib/misc/AcDbDataGenerator.js +1 -1
- package/lib/misc/AcDbDataGenerator.js.map +1 -1
- package/lib/object/AcDbXrecord.d.ts +59 -0
- package/lib/object/AcDbXrecord.d.ts.map +1 -0
- package/lib/object/AcDbXrecord.js +124 -0
- package/lib/object/AcDbXrecord.js.map +1 -0
- package/lib/object/index.d.ts +1 -0
- package/lib/object/index.d.ts.map +1 -1
- package/lib/object/index.js +1 -0
- package/lib/object/index.js.map +1 -1
- package/lib/object/layout/AcDbLayoutManager.js +11 -11
- package/lib/object/layout/AcDbLayoutManager.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DXF group codes used by AutoCAD for reading and writing DXF/DWG data.
|
|
3
|
+
*
|
|
4
|
+
* This enum mirrors Autodesk.AutoCAD.DatabaseServices.DxfCode exactly.
|
|
5
|
+
* Values indicate both semantic meaning and expected data type.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* - Group codes 0–9: string / symbol data
|
|
9
|
+
* - Group codes 10–59: floating-point values
|
|
10
|
+
* - Group codes 60–79: short integers
|
|
11
|
+
* - Group codes 90–99: 32-bit integers
|
|
12
|
+
* - Group codes 100–107: subclass / control strings
|
|
13
|
+
* - Group codes 300–369: strings / handles
|
|
14
|
+
* - Group codes 370–389: lineweight / plot style
|
|
15
|
+
* - Group codes 400+ : extended data (XData)
|
|
16
|
+
* - Negative values : internal / structural markers
|
|
17
|
+
*/
|
|
18
|
+
export declare const enum AcDbDxfCode {
|
|
19
|
+
/** Invalid DXF code */
|
|
20
|
+
Invalid = -9999,
|
|
21
|
+
/** Start of an entity or section */
|
|
22
|
+
Start = 0,
|
|
23
|
+
/** Primary text string */
|
|
24
|
+
Text = 1,
|
|
25
|
+
/** Attribute tag, block name, symbol name */
|
|
26
|
+
AttributeTag = 2,
|
|
27
|
+
BlockName = 2,
|
|
28
|
+
ShapeName = 2,
|
|
29
|
+
SymbolTableName = 2,
|
|
30
|
+
SymbolTableRecordName = 2,
|
|
31
|
+
MlineStyleName = 2,
|
|
32
|
+
/** Attribute prompt, dimension post string, description */
|
|
33
|
+
AttributePrompt = 3,
|
|
34
|
+
Description = 3,
|
|
35
|
+
DimPostString = 3,
|
|
36
|
+
DimStyleName = 3,
|
|
37
|
+
LinetypeProse = 3,
|
|
38
|
+
TextFontFile = 3,
|
|
39
|
+
/** CL shape name, dimension prefix/suffix, text bigfont file */
|
|
40
|
+
CLShapeName = 4,
|
|
41
|
+
DimensionAlternativePrefixSuffix = 4,
|
|
42
|
+
SymbolTableRecordComments = 4,
|
|
43
|
+
TextBigFontFile = 4,
|
|
44
|
+
/** Handle or dimension block name */
|
|
45
|
+
Handle = 5,
|
|
46
|
+
DimensionBlock = 5,
|
|
47
|
+
/** Linetype name or dimension block 1 */
|
|
48
|
+
LinetypeName = 6,
|
|
49
|
+
DimBlk1 = 6,
|
|
50
|
+
/** Text style name or dimension block 2 */
|
|
51
|
+
TextStyleName = 7,
|
|
52
|
+
DimBlk2 = 7,
|
|
53
|
+
/** Layer name */
|
|
54
|
+
LayerName = 8,
|
|
55
|
+
/** CL shape text */
|
|
56
|
+
CLShapeText = 9,
|
|
57
|
+
/** X coordinate (WCS / OCS depending on context) */
|
|
58
|
+
XCoordinate = 10,
|
|
59
|
+
/** Y coordinate */
|
|
60
|
+
YCoordinate = 20,
|
|
61
|
+
/** Z coordinate */
|
|
62
|
+
ZCoordinate = 30,
|
|
63
|
+
/** Real (double precision floating-point) */
|
|
64
|
+
Real = 40,
|
|
65
|
+
TxtSize = 40,
|
|
66
|
+
ViewportHeight = 40,
|
|
67
|
+
/** Angle in degrees */
|
|
68
|
+
Angle = 50,
|
|
69
|
+
ViewportSnapAngle = 50,
|
|
70
|
+
/** Visibility flag */
|
|
71
|
+
Visibility = 60,
|
|
72
|
+
/** 16-bit integer */
|
|
73
|
+
Int16 = 70,
|
|
74
|
+
/** 32-bit integer */
|
|
75
|
+
Int32 = 90,
|
|
76
|
+
/** 64-bit integer */
|
|
77
|
+
Int64 = 160,
|
|
78
|
+
/** 8-bit integer */
|
|
79
|
+
Int8 = 280,
|
|
80
|
+
/** Thickness */
|
|
81
|
+
Thickness = 39,
|
|
82
|
+
/** Elevation */
|
|
83
|
+
Elevation = 38,
|
|
84
|
+
/** Line type scale */
|
|
85
|
+
LinetypeScale = 48,
|
|
86
|
+
/** Dash length or MLine offset */
|
|
87
|
+
DashLength = 49,
|
|
88
|
+
MlineOffset = 49,
|
|
89
|
+
LinetypeElement = 49,
|
|
90
|
+
/** Normal vector components */
|
|
91
|
+
NormalX = 210,
|
|
92
|
+
NormalY = 220,
|
|
93
|
+
NormalZ = 230,
|
|
94
|
+
/** UCS origin */
|
|
95
|
+
UcsOrg = 110,
|
|
96
|
+
/** UCS orientation vectors */
|
|
97
|
+
UcsOrientationX = 111,
|
|
98
|
+
UcsOrientationY = 112,
|
|
99
|
+
/** View parameters */
|
|
100
|
+
ViewHeight = 45,
|
|
101
|
+
ViewWidth = 41,
|
|
102
|
+
ViewLensLength = 42,
|
|
103
|
+
ViewFrontClip = 43,
|
|
104
|
+
ViewBackClip = 44,
|
|
105
|
+
ViewBrightness = 141,
|
|
106
|
+
ViewContrast = 142,
|
|
107
|
+
ViewMode = 71,
|
|
108
|
+
/** Viewport parameters */
|
|
109
|
+
ViewportActive = 68,
|
|
110
|
+
ViewportAspect = 41,
|
|
111
|
+
ViewportGrid = 76,
|
|
112
|
+
ViewportIcon = 74,
|
|
113
|
+
ViewportNumber = 69,
|
|
114
|
+
ViewportSnap = 75,
|
|
115
|
+
ViewportSnapPair = 78,
|
|
116
|
+
ViewportSnapStyle = 77,
|
|
117
|
+
ViewportTwist = 51,
|
|
118
|
+
ViewportVisibility = 67,
|
|
119
|
+
ViewportZoom = 73,
|
|
120
|
+
/** Color values */
|
|
121
|
+
Color = 62,
|
|
122
|
+
ColorRgb = 420,
|
|
123
|
+
ColorName = 430,
|
|
124
|
+
/** Lineweight */
|
|
125
|
+
LineWeight = 370,
|
|
126
|
+
/** Plot style */
|
|
127
|
+
PlotStyleNameType = 380,
|
|
128
|
+
PlotStyleNameId = 390,
|
|
129
|
+
/** Gradient fill parameters */
|
|
130
|
+
GradientObjType = 450,
|
|
131
|
+
GradientAngle = 460,
|
|
132
|
+
GradientName = 470,
|
|
133
|
+
GradientColCount = 453,
|
|
134
|
+
GradientPatType = 451,
|
|
135
|
+
GradientTintType = 452,
|
|
136
|
+
GradientShift = 461,
|
|
137
|
+
GradientColVal = 463,
|
|
138
|
+
GradientTintVal = 462,
|
|
139
|
+
/** Handles and object references */
|
|
140
|
+
SoftPointerId = 330,
|
|
141
|
+
HardPointerId = 340,
|
|
142
|
+
SoftOwnershipId = 350,
|
|
143
|
+
HardOwnershipId = 360,
|
|
144
|
+
ArbitraryHandle = 320,
|
|
145
|
+
/** Extended data (XData) */
|
|
146
|
+
ExtendedDataAsciiString = 1000,
|
|
147
|
+
ExtendedDataRegAppName = 1001,
|
|
148
|
+
ExtendedDataControlString = 1002,
|
|
149
|
+
ExtendedDataLayerName = 1003,
|
|
150
|
+
ExtendedDataBinaryChunk = 1004,
|
|
151
|
+
ExtendedDataHandle = 1005,
|
|
152
|
+
ExtendedDataXCoordinate = 1010,
|
|
153
|
+
ExtendedDataWorldXCoordinate = 1011,
|
|
154
|
+
ExtendedDataWorldXDisp = 1012,
|
|
155
|
+
ExtendedDataWorldXDir = 1013,
|
|
156
|
+
ExtendedDataYCoordinate = 1020,
|
|
157
|
+
ExtendedDataWorldYCoordinate = 1021,
|
|
158
|
+
ExtendedDataWorldYDisp = 1022,
|
|
159
|
+
ExtendedDataWorldYDir = 1023,
|
|
160
|
+
ExtendedDataZCoordinate = 1030,
|
|
161
|
+
ExtendedDataWorldZCoordinate = 1031,
|
|
162
|
+
ExtendedDataWorldZDisp = 1032,
|
|
163
|
+
ExtendedDataWorldZDir = 1033,
|
|
164
|
+
ExtendedDataReal = 1040,
|
|
165
|
+
ExtendedDataDist = 1041,
|
|
166
|
+
ExtendedDataScale = 1042,
|
|
167
|
+
ExtendedDataInteger16 = 1070,
|
|
168
|
+
ExtendedDataInteger32 = 1071,
|
|
169
|
+
/** XData helpers */
|
|
170
|
+
XTextString = 300,
|
|
171
|
+
XReal = 140,
|
|
172
|
+
XInt16 = 170,
|
|
173
|
+
XXInt16 = 270,
|
|
174
|
+
/** Control / structural markers */
|
|
175
|
+
Subclass = 100,
|
|
176
|
+
ControlString = 102,
|
|
177
|
+
EmbeddedObjectStart = 101,
|
|
178
|
+
/** Internal markers */
|
|
179
|
+
End = -1,
|
|
180
|
+
FirstEntityId = -2,
|
|
181
|
+
HeaderId = -2,
|
|
182
|
+
XDataStart = -3,
|
|
183
|
+
Operator = -4,
|
|
184
|
+
PReactors = -5,
|
|
185
|
+
XDictionary = -6
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=AcDbDxfCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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IAC/B,kBAAkB,OAAQ;IAC1B,uBAAuB,OAAQ;IAC/B,4BAA4B,OAAQ;IACpC,sBAAsB,OAAQ;IAC9B,qBAAqB,OAAQ;IAC7B,uBAAuB,OAAQ;IAC/B,4BAA4B,OAAQ;IACpC,sBAAsB,OAAQ;IAC9B,qBAAqB,OAAQ;IAC7B,uBAAuB,OAAQ;IAC/B,4BAA4B,OAAQ;IACpC,sBAAsB,OAAQ;IAC9B,qBAAqB,OAAQ;IAC7B,gBAAgB,OAAQ;IACxB,gBAAgB,OAAQ;IACxB,iBAAiB,OAAQ;IACzB,qBAAqB,OAAQ;IAC7B,qBAAqB,OAAQ;IAE7B,oBAAoB;IACpB,WAAW,MAAM;IACjB,KAAK,MAAM;IACX,MAAM,MAAM;IACZ,OAAO,MAAM;IAEb,mCAAmC;IACnC,QAAQ,MAAM;IACd,aAAa,MAAO;IACpB,mBAAmB,MAAO;IAE1B,uBAAuB;IACvB,GAAG,KAAK;IACR,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,UAAU,KAAK;IACf,QAAQ,KAAK;IACb,SAAS,KAAK;IACd,WAAW,KAAK;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbDxfCode.js","sourceRoot":"","sources":["../../src/base/AcDbDxfCode.ts"],"names":[],"mappings":""}
|
package/lib/base/AcDbObject.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AcCmAttributes, AcCmObject, AcCmStringKey } from '@mlightcad/common';
|
|
2
2
|
import { AcDbDatabase } from '../database/AcDbDatabase';
|
|
3
|
+
import { AcDbResultBuffer } from './AcDbResultBuffer';
|
|
3
4
|
/** Type alias for object ID as string */
|
|
4
5
|
export type AcDbObjectId = string;
|
|
5
6
|
/**
|
|
@@ -13,6 +14,11 @@ export interface AcDbObjectAttrs extends AcCmAttributes {
|
|
|
13
14
|
objectId?: AcDbObjectId;
|
|
14
15
|
/** Identifier of the object that owns this object */
|
|
15
16
|
ownerId?: AcDbObjectId;
|
|
17
|
+
/**
|
|
18
|
+
* The objectId of the extension dictionary owned by the object. If the object does
|
|
19
|
+
* not own an extension dictionary, then the returned objectId is set to undefined.
|
|
20
|
+
*/
|
|
21
|
+
extensionDictionary?: AcDbObjectId;
|
|
16
22
|
}
|
|
17
23
|
/**
|
|
18
24
|
* The base class for all objects that reside in a drawing database.
|
|
@@ -37,6 +43,8 @@ export declare class AcDbObject<ATTRS extends AcDbObjectAttrs = AcDbObjectAttrs>
|
|
|
37
43
|
private _database?;
|
|
38
44
|
/** The attributes object that stores all object properties */
|
|
39
45
|
private _attrs;
|
|
46
|
+
/** XData attached to this object */
|
|
47
|
+
private _xDataMap;
|
|
40
48
|
/**
|
|
41
49
|
* Creates a new AcDbObject instance.
|
|
42
50
|
*
|
|
@@ -159,6 +167,40 @@ export declare class AcDbObject<ATTRS extends AcDbObjectAttrs = AcDbObjectAttrs>
|
|
|
159
167
|
* ```
|
|
160
168
|
*/
|
|
161
169
|
set ownerId(value: AcDbObjectId);
|
|
170
|
+
/**
|
|
171
|
+
* Gets the objectId of the extension dictionary owned by this object.
|
|
172
|
+
*
|
|
173
|
+
* If the object does not have an extension dictionary, this returns `undefined`.
|
|
174
|
+
*
|
|
175
|
+
* In ObjectARX terms, this is equivalent to `AcDbObject::extensionDictionary()`.
|
|
176
|
+
*
|
|
177
|
+
* @returns The extension dictionary objectId, or undefined
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const dictId = obj.extensionDictionary
|
|
182
|
+
* if (dictId) {
|
|
183
|
+
* console.log('Has extension dictionary:', dictId)
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
get extensionDictionary(): AcDbObjectId | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Sets the objectId of the extension dictionary owned by this object.
|
|
190
|
+
*
|
|
191
|
+
* This does not create or delete the dictionary object itself — it only
|
|
192
|
+
* establishes or clears the ownership relationship.
|
|
193
|
+
*
|
|
194
|
+
* Passing `undefined` removes the association.
|
|
195
|
+
*
|
|
196
|
+
* @param value - The extension dictionary objectId, or undefined
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* obj.extensionDictionary = dict.objectId
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
set extensionDictionary(value: AcDbObjectId | undefined);
|
|
162
204
|
/**
|
|
163
205
|
* Gets the database in which this object is resident.
|
|
164
206
|
*
|
|
@@ -188,6 +230,90 @@ export declare class AcDbObject<ATTRS extends AcDbObjectAttrs = AcDbObjectAttrs>
|
|
|
188
230
|
* ```
|
|
189
231
|
*/
|
|
190
232
|
set database(db: AcDbDatabase);
|
|
233
|
+
/**
|
|
234
|
+
* Retrieves the XData associated with this object for a given application ID.
|
|
235
|
+
*
|
|
236
|
+
* Extended Entity Data (XData) allows applications to attach arbitrary,
|
|
237
|
+
* application-specific data to an AcDbObject. Each XData entry is identified
|
|
238
|
+
* by a registered application name (AppId) and stored as an AcDbResultBuffer.
|
|
239
|
+
*
|
|
240
|
+
* This method is conceptually equivalent to `AcDbObject::xData()` in ObjectARX,
|
|
241
|
+
* but simplified to return the entire result buffer for the specified AppId.
|
|
242
|
+
*
|
|
243
|
+
* @param appId - The application ID (registered AppId name) that owns the XData
|
|
244
|
+
* @returns The AcDbResultBuffer associated with the AppId, or `undefined`
|
|
245
|
+
* if no XData exists for that AppId
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* const xdata = obj.getXData('MY_APP')
|
|
250
|
+
* if (xdata) {
|
|
251
|
+
* // Read values from the result buffer
|
|
252
|
+
* }
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
getXData(appId: string): AcDbResultBuffer | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* Attaches or replaces XData for this object.
|
|
258
|
+
*
|
|
259
|
+
* If XData already exists for the given AppId, it is replaced by the provided
|
|
260
|
+
* AcDbResultBuffer. The caller is responsible for ensuring that:
|
|
261
|
+
*
|
|
262
|
+
* - The AppId is registered in the database's AppId table
|
|
263
|
+
* - The result buffer follows valid DXF/XData conventions (e.g. starts with
|
|
264
|
+
* a 1001 group code for the AppId)
|
|
265
|
+
*
|
|
266
|
+
* This method is conceptually similar to `AcDbObject::setXData()` in ObjectARX.
|
|
267
|
+
*
|
|
268
|
+
* @param resbuf - The result buffer containing the XData to attach
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* const rb = new AcDbResultBuffer([
|
|
273
|
+
* { code: AcDbDxfCode.ExtendedDataRegAppName, value: 'MY_APP' },
|
|
274
|
+
* { code: AcDbDxfCode.ExtendedDataAsciiString, value: 'custom value' }
|
|
275
|
+
* ])
|
|
276
|
+
*
|
|
277
|
+
* obj.setXData('MY_APP', rb)
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
setXData(resbuf: AcDbResultBuffer): void;
|
|
281
|
+
/**
|
|
282
|
+
* Removes the XData associated with the specified application ID.
|
|
283
|
+
*
|
|
284
|
+
* After removal, calls to getXData() for the same AppId will return `undefined`.
|
|
285
|
+
* If no XData exists for the given AppId, this method has no effect.
|
|
286
|
+
*
|
|
287
|
+
* This mirrors the behavior of clearing XData for a specific application
|
|
288
|
+
* in ObjectARX rather than removing all XData from the object.
|
|
289
|
+
*
|
|
290
|
+
* @param appId - The application ID whose XData should be removed
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* obj.removeXData('MY_APP')
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
removeXData(appId: string): void;
|
|
298
|
+
/**
|
|
299
|
+
* Creates the extension dictionary for this object if it does not already exist.
|
|
300
|
+
*
|
|
301
|
+
* This method closely mirrors the behavior of
|
|
302
|
+
* `AcDbObject::createExtensionDictionary()` in ObjectARX.
|
|
303
|
+
*
|
|
304
|
+
* - If the object already owns an extension dictionary, no new dictionary
|
|
305
|
+
* is created and the existing dictionary's objectId is returned.
|
|
306
|
+
* - Otherwise, a new AcDbDictionary is created, added to the same database,
|
|
307
|
+
* owned by this object, and its objectId is stored on this object.
|
|
308
|
+
*
|
|
309
|
+
* @returns The objectId of the extension dictionary
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* const dictId = obj.createExtensionDictionary()
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
createExtensionDictionary(): AcDbObjectId | undefined;
|
|
191
317
|
/**
|
|
192
318
|
* Closes the object.
|
|
193
319
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbObject.d.ts","sourceRoot":"","sources":["../../src/base/AcDbObject.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EAEd,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGvD,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,uCAAuC;IACvC,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,qDAAqD;IACrD,OAAO,CAAC,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"AcDbObject.d.ts","sourceRoot":"","sources":["../../src/base/AcDbObject.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EAEd,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,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;;;;;;;;OAcG;IACH,IAAI,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAEtD;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,QAAQ,IAAI,YAAY,CAI3B;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,QAAQ,CAAC,EAAE,EAAE,YAAY,EAE5B;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAIrD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAQxC;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC;;;;;;;;;;;;;;;;;OAiBG;IACH,yBAAyB,IAAI,YAAY,GAAG,SAAS;IAyBrD;;;;;;;;;;;OAWG;IACH,KAAK;CACN"}
|
package/lib/base/AcDbObject.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
1
12
|
import { AcCmObject, defaults } from '@mlightcad/common';
|
|
2
13
|
import { uid } from 'uid';
|
|
3
14
|
import { acdbHostApplicationServices } from './AcDbHostApplicationServices';
|
|
@@ -35,6 +46,7 @@ var AcDbObject = /** @class */ (function () {
|
|
|
35
46
|
attrs = attrs || {};
|
|
36
47
|
defaults(attrs, { objectId: uid() });
|
|
37
48
|
this._attrs = new AcCmObject(attrs, defaultAttrs);
|
|
49
|
+
this._xDataMap = new Map();
|
|
38
50
|
}
|
|
39
51
|
Object.defineProperty(AcDbObject.prototype, "attrs", {
|
|
40
52
|
/**
|
|
@@ -178,6 +190,48 @@ var AcDbObject = /** @class */ (function () {
|
|
|
178
190
|
enumerable: false,
|
|
179
191
|
configurable: true
|
|
180
192
|
});
|
|
193
|
+
Object.defineProperty(AcDbObject.prototype, "extensionDictionary", {
|
|
194
|
+
/**
|
|
195
|
+
* Gets the objectId of the extension dictionary owned by this object.
|
|
196
|
+
*
|
|
197
|
+
* If the object does not have an extension dictionary, this returns `undefined`.
|
|
198
|
+
*
|
|
199
|
+
* In ObjectARX terms, this is equivalent to `AcDbObject::extensionDictionary()`.
|
|
200
|
+
*
|
|
201
|
+
* @returns The extension dictionary objectId, or undefined
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* const dictId = obj.extensionDictionary
|
|
206
|
+
* if (dictId) {
|
|
207
|
+
* console.log('Has extension dictionary:', dictId)
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
get: function () {
|
|
212
|
+
return this.getAttrWithoutException('extensionDictionary');
|
|
213
|
+
},
|
|
214
|
+
/**
|
|
215
|
+
* Sets the objectId of the extension dictionary owned by this object.
|
|
216
|
+
*
|
|
217
|
+
* This does not create or delete the dictionary object itself — it only
|
|
218
|
+
* establishes or clears the ownership relationship.
|
|
219
|
+
*
|
|
220
|
+
* Passing `undefined` removes the association.
|
|
221
|
+
*
|
|
222
|
+
* @param value - The extension dictionary objectId, or undefined
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* obj.extensionDictionary = dict.objectId
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
set: function (value) {
|
|
230
|
+
this._attrs.set('extensionDictionary', value);
|
|
231
|
+
},
|
|
232
|
+
enumerable: false,
|
|
233
|
+
configurable: true
|
|
234
|
+
});
|
|
181
235
|
Object.defineProperty(AcDbObject.prototype, "database", {
|
|
182
236
|
/**
|
|
183
237
|
* Gets the database in which this object is resident.
|
|
@@ -217,6 +271,130 @@ var AcDbObject = /** @class */ (function () {
|
|
|
217
271
|
enumerable: false,
|
|
218
272
|
configurable: true
|
|
219
273
|
});
|
|
274
|
+
/**
|
|
275
|
+
* Retrieves the XData associated with this object for a given application ID.
|
|
276
|
+
*
|
|
277
|
+
* Extended Entity Data (XData) allows applications to attach arbitrary,
|
|
278
|
+
* application-specific data to an AcDbObject. Each XData entry is identified
|
|
279
|
+
* by a registered application name (AppId) and stored as an AcDbResultBuffer.
|
|
280
|
+
*
|
|
281
|
+
* This method is conceptually equivalent to `AcDbObject::xData()` in ObjectARX,
|
|
282
|
+
* but simplified to return the entire result buffer for the specified AppId.
|
|
283
|
+
*
|
|
284
|
+
* @param appId - The application ID (registered AppId name) that owns the XData
|
|
285
|
+
* @returns The AcDbResultBuffer associated with the AppId, or `undefined`
|
|
286
|
+
* if no XData exists for that AppId
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* const xdata = obj.getXData('MY_APP')
|
|
291
|
+
* if (xdata) {
|
|
292
|
+
* // Read values from the result buffer
|
|
293
|
+
* }
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
AcDbObject.prototype.getXData = function (appId) {
|
|
297
|
+
return this._xDataMap.get(appId);
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Attaches or replaces XData for this object.
|
|
301
|
+
*
|
|
302
|
+
* If XData already exists for the given AppId, it is replaced by the provided
|
|
303
|
+
* AcDbResultBuffer. The caller is responsible for ensuring that:
|
|
304
|
+
*
|
|
305
|
+
* - The AppId is registered in the database's AppId table
|
|
306
|
+
* - The result buffer follows valid DXF/XData conventions (e.g. starts with
|
|
307
|
+
* a 1001 group code for the AppId)
|
|
308
|
+
*
|
|
309
|
+
* This method is conceptually similar to `AcDbObject::setXData()` in ObjectARX.
|
|
310
|
+
*
|
|
311
|
+
* @param resbuf - The result buffer containing the XData to attach
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* const rb = new AcDbResultBuffer([
|
|
316
|
+
* { code: AcDbDxfCode.ExtendedDataRegAppName, value: 'MY_APP' },
|
|
317
|
+
* { code: AcDbDxfCode.ExtendedDataAsciiString, value: 'custom value' }
|
|
318
|
+
* ])
|
|
319
|
+
*
|
|
320
|
+
* obj.setXData('MY_APP', rb)
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
AcDbObject.prototype.setXData = function (resbuf) {
|
|
324
|
+
var e_1, _a;
|
|
325
|
+
try {
|
|
326
|
+
for (var resbuf_1 = __values(resbuf), resbuf_1_1 = resbuf_1.next(); !resbuf_1_1.done; resbuf_1_1 = resbuf_1.next()) {
|
|
327
|
+
var item = resbuf_1_1.value;
|
|
328
|
+
if (item.code === 1001 /* AcDbDxfCode.ExtendedDataRegAppName */) {
|
|
329
|
+
this._xDataMap.set(item.value, resbuf);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
334
|
+
finally {
|
|
335
|
+
try {
|
|
336
|
+
if (resbuf_1_1 && !resbuf_1_1.done && (_a = resbuf_1.return)) _a.call(resbuf_1);
|
|
337
|
+
}
|
|
338
|
+
finally { if (e_1) throw e_1.error; }
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Removes the XData associated with the specified application ID.
|
|
343
|
+
*
|
|
344
|
+
* After removal, calls to getXData() for the same AppId will return `undefined`.
|
|
345
|
+
* If no XData exists for the given AppId, this method has no effect.
|
|
346
|
+
*
|
|
347
|
+
* This mirrors the behavior of clearing XData for a specific application
|
|
348
|
+
* in ObjectARX rather than removing all XData from the object.
|
|
349
|
+
*
|
|
350
|
+
* @param appId - The application ID whose XData should be removed
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```typescript
|
|
354
|
+
* obj.removeXData('MY_APP')
|
|
355
|
+
* ```
|
|
356
|
+
*/
|
|
357
|
+
AcDbObject.prototype.removeXData = function (appId) {
|
|
358
|
+
this._xDataMap.delete(appId);
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Creates the extension dictionary for this object if it does not already exist.
|
|
362
|
+
*
|
|
363
|
+
* This method closely mirrors the behavior of
|
|
364
|
+
* `AcDbObject::createExtensionDictionary()` in ObjectARX.
|
|
365
|
+
*
|
|
366
|
+
* - If the object already owns an extension dictionary, no new dictionary
|
|
367
|
+
* is created and the existing dictionary's objectId is returned.
|
|
368
|
+
* - Otherwise, a new AcDbDictionary is created, added to the same database,
|
|
369
|
+
* owned by this object, and its objectId is stored on this object.
|
|
370
|
+
*
|
|
371
|
+
* @returns The objectId of the extension dictionary
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* const dictId = obj.createExtensionDictionary()
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
378
|
+
AcDbObject.prototype.createExtensionDictionary = function () {
|
|
379
|
+
// If already exists, behave like ObjectARX: do nothing
|
|
380
|
+
// const existingId = this.extensionDictionary
|
|
381
|
+
// if (existingId) {
|
|
382
|
+
// return existingId
|
|
383
|
+
// }
|
|
384
|
+
// const db = this.database
|
|
385
|
+
// if (db) {
|
|
386
|
+
// // Create a new extension dictionary
|
|
387
|
+
// const dict = new AcDbDictionary(db)
|
|
388
|
+
// // Ensure dictionary lives in the same database
|
|
389
|
+
// dict.database = db
|
|
390
|
+
// // Add dictionary to database
|
|
391
|
+
// db.objects.dictionary.setAt(dict.objectId, dict)
|
|
392
|
+
// // Establish ownership relationship
|
|
393
|
+
// this.extensionDictionary = dict.objectId
|
|
394
|
+
// return dict.objectId
|
|
395
|
+
// }
|
|
396
|
+
return undefined;
|
|
397
|
+
};
|
|
220
398
|
/**
|
|
221
399
|
* Closes the object.
|
|
222
400
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbObject.js","sourceRoot":"","sources":["../../src/base/AcDbObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,QAAQ,EACT,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"AcDbObject.js","sourceRoot":"","sources":["../../src/base/AcDbObject.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAEL,UAAU,EAEV,QAAQ,EACT,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAIzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAwB3E;;;;;;;;;;;;;;;;;GAiBG;AACH;IAQE;;;;;;;;;;OAUG;IACH,oBAAY,KAAsB,EAAE,YAA6B;QAC/D,KAAK,GAAG,KAAK,IAAI,EAAE,CAAA;QACnB,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAQ,KAAK,EAAE,YAAY,CAAC,CAAA;QACxD,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAC5B,CAAC;IAaD,sBAAI,6BAAK;QAXT;;;;;;;;;;WAUG;aACH;YACE,OAAO,IAAI,CAAC,MAAM,CAAA;QACpB,CAAC;;;OAAA;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,4BAAO,GAAP,UAAQ,QAA8B;QACpC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,uCAAgC,QAAQ,mCA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XC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AcDbTypedValue } from './AcDbTypedValue';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an ordered collection of typed values.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This class corresponds to AutoCAD's ResultBuffer class.
|
|
7
|
+
* It is commonly used to store Xrecord data, XData, and
|
|
8
|
+
* other extensible data structures.
|
|
9
|
+
*/
|
|
10
|
+
export declare class AcDbResultBuffer implements Iterable<AcDbTypedValue> {
|
|
11
|
+
private readonly _values;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new result buffer.
|
|
14
|
+
*
|
|
15
|
+
* @param values - Optional initial typed values
|
|
16
|
+
*/
|
|
17
|
+
constructor(values?: Iterable<AcDbTypedValue>);
|
|
18
|
+
/**
|
|
19
|
+
* Gets the number of typed values in the buffer.
|
|
20
|
+
*/
|
|
21
|
+
get length(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the typed value at the specified index.
|
|
24
|
+
*
|
|
25
|
+
* @param index - Zero-based index
|
|
26
|
+
*/
|
|
27
|
+
at(index: number): AcDbTypedValue | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Adds a typed value to the end of the buffer.
|
|
30
|
+
*
|
|
31
|
+
* @param value - Typed value to add
|
|
32
|
+
*/
|
|
33
|
+
add(value: AcDbTypedValue): void;
|
|
34
|
+
/**
|
|
35
|
+
* Adds multiple typed values to the buffer.
|
|
36
|
+
*
|
|
37
|
+
* @param values - Typed values to add
|
|
38
|
+
*/
|
|
39
|
+
addRange(values: Iterable<AcDbTypedValue>): void;
|
|
40
|
+
/**
|
|
41
|
+
* Removes all values from the buffer.
|
|
42
|
+
*/
|
|
43
|
+
clear(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a shallow copy of the typed values.
|
|
46
|
+
*/
|
|
47
|
+
toArray(): AcDbTypedValue[];
|
|
48
|
+
/**
|
|
49
|
+
* Creates a deep copy of this result buffer.
|
|
50
|
+
*/
|
|
51
|
+
clone(): AcDbResultBuffer;
|
|
52
|
+
/**
|
|
53
|
+
* Returns an iterator for the typed values.
|
|
54
|
+
*/
|
|
55
|
+
[Symbol.iterator](): Iterator<AcDbTypedValue>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=AcDbResultBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbResultBuffer.d.ts","sourceRoot":"","sources":["../../src/base/AcDbResultBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;;;;GAOG;AACH,qBAAa,gBAAiB,YAAW,QAAQ,CAAC,cAAc,CAAC;IAC/D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAE/C;;;;OAIG;gBACS,MAAM,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IAQ7C;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI7C;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAIhC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI;IAMhD;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,IAAI,cAAc,EAAE;IAI3B;;OAEG;IACH,KAAK,IAAI,gBAAgB;IAIzB;;OAEG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,cAAc,CAAC;CAG9C"}
|