@mlightcad/libredwg-web 0.7.4 → 0.7.6
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/libredwg-web.js +1309 -1041
- package/dist/libredwg-web.umd.cjs +1309 -1041
- package/lib/converter/converter.d.ts +1 -0
- package/lib/converter/converter.js +253 -343
- package/lib/converter/dwgColorToMLeaderRawColor.d.ts +10 -0
- package/lib/converter/dwgColorToMLeaderRawColor.js +55 -0
- package/lib/converter/entityConverter.d.ts +2 -0
- package/lib/converter/entityConverter.js +705 -592
- package/lib/converter/index.d.ts +1 -0
- package/lib/converter/index.js +1 -0
- package/lib/database/database.d.ts +2 -1
- package/lib/database/entities/index.d.ts +2 -0
- package/lib/database/entities/index.js +2 -0
- package/lib/database/entities/multileader.d.ts +190 -0
- package/lib/database/entities/multileader.js +2 -0
- package/lib/database/entities/shape.d.ts +50 -0
- package/lib/database/entities/shape.js +2 -0
- package/lib/database/objects/index.d.ts +1 -0
- package/lib/database/objects/index.js +1 -0
- package/lib/database/objects/mleaderStyle.d.ts +101 -0
- package/lib/database/objects/mleaderStyle.js +2 -0
- package/lib/libredwg.d.ts +61 -0
- package/lib/libredwg.js +107 -18
- package/lib/svg/svgConverter.js +1 -0
- package/package.json +2 -2
- package/wasm/libredwg-web.d.ts +3 -0
- package/wasm/libredwg-web.wasm +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DwgBoundaryPathEdgeType, DwgHatchAssociativity, DwgHatchGradientColorFlag, DwgHatchGradientFlag, DwgHatchSolidFill } from '../database';
|
|
2
2
|
import { Dwg_Hatch_Edge_Type, Dwg_Object_Type } from '../types';
|
|
3
|
+
import { dwgColorToMLeaderRawColor } from './dwgColorToMLeaderRawColor';
|
|
3
4
|
import { idToString, uint8ArrayToHexString } from './utils';
|
|
4
5
|
export class LibreEntityConverter {
|
|
5
6
|
libredwg;
|
|
@@ -101,6 +102,9 @@ export class LibreEntityConverter {
|
|
|
101
102
|
else if (fixedtype == Dwg_Object_Type.DWG_TYPE_MLINE) {
|
|
102
103
|
return this.convertMLine(entity_tio, commonAttrs);
|
|
103
104
|
}
|
|
105
|
+
else if (fixedtype == Dwg_Object_Type.DWG_TYPE_MULTILEADER) {
|
|
106
|
+
return this.convertMultiLeader(entity_tio, commonAttrs);
|
|
107
|
+
}
|
|
104
108
|
else if (fixedtype == Dwg_Object_Type.DWG_TYPE_MTEXT) {
|
|
105
109
|
return this.convertMText(entity_tio, commonAttrs);
|
|
106
110
|
}
|
|
@@ -128,6 +132,9 @@ export class LibreEntityConverter {
|
|
|
128
132
|
else if (fixedtype == Dwg_Object_Type.DWG_TYPE_SECTIONOBJECT) {
|
|
129
133
|
return this.convertSection(entity_tio, commonAttrs);
|
|
130
134
|
}
|
|
135
|
+
else if (fixedtype == Dwg_Object_Type.DWG_TYPE_SHAPE) {
|
|
136
|
+
return this.convertShape(entity_tio, commonAttrs);
|
|
137
|
+
}
|
|
131
138
|
else if (fixedtype == Dwg_Object_Type.DWG_TYPE_SOLID) {
|
|
132
139
|
return this.convertSolid(entity_tio, commonAttrs);
|
|
133
140
|
}
|
|
@@ -160,16 +167,11 @@ export class LibreEntityConverter {
|
|
|
160
167
|
}
|
|
161
168
|
convert3dFace(entity, commonAttrs) {
|
|
162
169
|
const libredwg = this.libredwg;
|
|
163
|
-
const corner1 = libredwg.
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
.data;
|
|
169
|
-
const corner4 = libredwg.dwg_dynapi_entity_value(entity, 'corner4')
|
|
170
|
-
.data;
|
|
171
|
-
const flag = libredwg.dwg_dynapi_entity_value(entity, 'invis_flags')
|
|
172
|
-
.data;
|
|
170
|
+
const corner1 = libredwg.dwg_dynapi_entity_data(entity, 'corner1');
|
|
171
|
+
const corner2 = libredwg.dwg_dynapi_entity_data(entity, 'corner2');
|
|
172
|
+
const corner3 = libredwg.dwg_dynapi_entity_data(entity, 'corner3');
|
|
173
|
+
const corner4 = libredwg.dwg_dynapi_entity_data(entity, 'corner4');
|
|
174
|
+
const flag = libredwg.dwg_dynapi_entity_data(entity, 'invis_flags');
|
|
173
175
|
return {
|
|
174
176
|
type: '3DFACE',
|
|
175
177
|
...commonAttrs,
|
|
@@ -182,17 +184,12 @@ export class LibreEntityConverter {
|
|
|
182
184
|
}
|
|
183
185
|
convertArc(entity, commonAttrs) {
|
|
184
186
|
const libredwg = this.libredwg;
|
|
185
|
-
const center = libredwg.
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
192
|
-
const startAngle = libredwg.dwg_dynapi_entity_value(entity, 'start_angle')
|
|
193
|
-
.data;
|
|
194
|
-
const endAngle = libredwg.dwg_dynapi_entity_value(entity, 'end_angle')
|
|
195
|
-
.data;
|
|
187
|
+
const center = libredwg.dwg_dynapi_entity_data(entity, 'center');
|
|
188
|
+
const radius = libredwg.dwg_dynapi_entity_data(entity, 'radius');
|
|
189
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
190
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
191
|
+
const startAngle = libredwg.dwg_dynapi_entity_data(entity, 'start_angle');
|
|
192
|
+
const endAngle = libredwg.dwg_dynapi_entity_data(entity, 'end_angle');
|
|
196
193
|
return {
|
|
197
194
|
type: 'ARC',
|
|
198
195
|
...commonAttrs,
|
|
@@ -206,13 +203,13 @@ export class LibreEntityConverter {
|
|
|
206
203
|
}
|
|
207
204
|
convertEmbeddedMText(entity, subclassName) {
|
|
208
205
|
const libredwg = this.libredwg;
|
|
209
|
-
const attachmentPoint = libredwg.
|
|
210
|
-
const insertionPoint = libredwg.
|
|
211
|
-
const direction = libredwg.
|
|
212
|
-
const rectHeight = libredwg.
|
|
213
|
-
const rectWidth = libredwg.
|
|
214
|
-
const extentsHeight = libredwg.
|
|
215
|
-
const extentsWidth = libredwg.
|
|
206
|
+
const attachmentPoint = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'attachment');
|
|
207
|
+
const insertionPoint = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'ins_pt');
|
|
208
|
+
const direction = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'x_axis_dir');
|
|
209
|
+
const rectHeight = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'rect_height');
|
|
210
|
+
const rectWidth = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'rect_width');
|
|
211
|
+
const extentsHeight = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'extents_height');
|
|
212
|
+
const extentsWidth = libredwg.dwg_dynapi_subclass_data(entity, subclassName, 'extents_width');
|
|
216
213
|
// const columnType = libredwg.dwg_dynapi_subclass_value(entity, subclassName, 'column_type')
|
|
217
214
|
// .data as number
|
|
218
215
|
// const columnWidth = libredwg.dwg_dynapi_subclass_value(entity, subclassName, 'column_width')
|
|
@@ -265,24 +262,19 @@ export class LibreEntityConverter {
|
|
|
265
262
|
// Because the field name of text string in Dwg_Entity_ATTDEF is 'default_value'
|
|
266
263
|
// instead of 'text_value'. So we need to get its value again using the correct
|
|
267
264
|
// field name.
|
|
268
|
-
const textValue = libredwg.
|
|
269
|
-
.data;
|
|
265
|
+
const textValue = libredwg.dwg_dynapi_entity_data(entity, 'default_value');
|
|
270
266
|
const text = this.convertTextBase(entity);
|
|
271
267
|
text.text = textValue;
|
|
272
|
-
const prompt = libredwg.
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
const lockPositionFlag = libredwg.dwg_dynapi_entity_value(entity, 'lock_position_flag').data;
|
|
280
|
-
const duplicateRecordCloningFlag = libredwg.dwg_dynapi_entity_value(entity, 'keep_duplicate_records').data;
|
|
281
|
-
const isReallyLocked = libredwg.dwg_dynapi_entity_value(entity, 'is_really_locked').data;
|
|
268
|
+
const prompt = libredwg.dwg_dynapi_entity_data(entity, 'prompt');
|
|
269
|
+
const tag = libredwg.dwg_dynapi_entity_data(entity, 'tag');
|
|
270
|
+
const flags = libredwg.dwg_dynapi_entity_data(entity, 'flags');
|
|
271
|
+
const fieldLength = libredwg.dwg_dynapi_entity_data(entity, 'field_length');
|
|
272
|
+
const lockPositionFlag = libredwg.dwg_dynapi_entity_data(entity, 'lock_position_flag');
|
|
273
|
+
const duplicateRecordCloningFlag = libredwg.dwg_dynapi_entity_data(entity, 'keep_duplicate_records');
|
|
274
|
+
const isReallyLocked = libredwg.dwg_dynapi_entity_data(entity, 'is_really_locked');
|
|
282
275
|
// TODO: double check whether 'mtext_type' is 'mtextFlag'
|
|
283
|
-
const mtextFlag = libredwg.
|
|
284
|
-
|
|
285
|
-
const alignmentPoint = libredwg.dwg_dynapi_entity_value(entity, 'alignment_pt').data;
|
|
276
|
+
const mtextFlag = libredwg.dwg_dynapi_entity_data(entity, 'mtext_type');
|
|
277
|
+
const alignmentPoint = libredwg.dwg_dynapi_entity_data(entity, 'alignment_pt');
|
|
286
278
|
return {
|
|
287
279
|
type: 'ATTDEF',
|
|
288
280
|
...commonAttrs,
|
|
@@ -304,18 +296,15 @@ export class LibreEntityConverter {
|
|
|
304
296
|
convertAttrib(entity, commonAttrs) {
|
|
305
297
|
const libredwg = this.libredwg;
|
|
306
298
|
const text = this.convertTextBase(entity);
|
|
307
|
-
const tag = libredwg.
|
|
308
|
-
const flags = libredwg.
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
const lockPositionFlag = libredwg.dwg_dynapi_entity_value(entity, 'lock_position_flag').data;
|
|
313
|
-
const duplicateRecordCloningFlag = libredwg.dwg_dynapi_entity_value(entity, 'keep_duplicate_records').data;
|
|
299
|
+
const tag = libredwg.dwg_dynapi_entity_data(entity, 'tag');
|
|
300
|
+
const flags = libredwg.dwg_dynapi_entity_data(entity, 'flags');
|
|
301
|
+
const fieldLength = libredwg.dwg_dynapi_entity_data(entity, 'field_length');
|
|
302
|
+
const lockPositionFlag = libredwg.dwg_dynapi_entity_data(entity, 'lock_position_flag');
|
|
303
|
+
const duplicateRecordCloningFlag = libredwg.dwg_dynapi_entity_data(entity, 'keep_duplicate_records');
|
|
314
304
|
// TODO: double check whether 'mtext_type' is 'mtextFlag'
|
|
315
|
-
const mtextFlag = libredwg.
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
const alignmentPoint = libredwg.dwg_dynapi_entity_value(entity, 'alignment_pt').data;
|
|
305
|
+
const mtextFlag = libredwg.dwg_dynapi_entity_data(entity, 'mtext_type');
|
|
306
|
+
const isReallyLocked = libredwg.dwg_dynapi_entity_data(entity, 'is_really_locked');
|
|
307
|
+
const alignmentPoint = libredwg.dwg_dynapi_entity_data(entity, 'alignment_pt');
|
|
319
308
|
return {
|
|
320
309
|
type: 'ATTRIB',
|
|
321
310
|
...commonAttrs,
|
|
@@ -337,13 +326,10 @@ export class LibreEntityConverter {
|
|
|
337
326
|
}
|
|
338
327
|
convertCircle(entity, commonAttrs) {
|
|
339
328
|
const libredwg = this.libredwg;
|
|
340
|
-
const center = libredwg.
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
const thickness = libredwg.dwg_dynapi_entity_value(entity, 'thickness')
|
|
345
|
-
.data;
|
|
346
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
329
|
+
const center = libredwg.dwg_dynapi_entity_data(entity, 'center');
|
|
330
|
+
const radius = libredwg.dwg_dynapi_entity_data(entity, 'radius');
|
|
331
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
332
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
347
333
|
return {
|
|
348
334
|
type: 'CIRCLE',
|
|
349
335
|
...commonAttrs,
|
|
@@ -357,11 +343,11 @@ export class LibreEntityConverter {
|
|
|
357
343
|
const libredwg = this.libredwg;
|
|
358
344
|
const dimensionCommonAttrs = this.getDimensionCommonAttrs(entity);
|
|
359
345
|
// TODO: Not sure whether 'clone_ins_pt' is same as 'insertionPoint'
|
|
360
|
-
const insertionPoint = libredwg.
|
|
361
|
-
const subDefinitionPoint1 = libredwg.
|
|
362
|
-
const subDefinitionPoint2 = libredwg.
|
|
363
|
-
const rotationAngle = libredwg.
|
|
364
|
-
const obliqueAngle = libredwg.
|
|
346
|
+
const insertionPoint = libredwg.dwg_dynapi_entity_data(entity, 'clone_ins_pt');
|
|
347
|
+
const subDefinitionPoint1 = libredwg.dwg_dynapi_entity_data(entity, 'xline1_pt');
|
|
348
|
+
const subDefinitionPoint2 = libredwg.dwg_dynapi_entity_data(entity, 'xline2_pt');
|
|
349
|
+
const rotationAngle = libredwg.dwg_dynapi_entity_data(entity, 'ins_rotation');
|
|
350
|
+
const obliqueAngle = libredwg.dwg_dynapi_entity_data(entity, 'oblique_angle');
|
|
365
351
|
return {
|
|
366
352
|
subclassMarker: 'AcDbAlignedDimension',
|
|
367
353
|
...commonAttrs,
|
|
@@ -376,12 +362,10 @@ export class LibreEntityConverter {
|
|
|
376
362
|
convert3PointAngularDimension(entity, commonAttrs) {
|
|
377
363
|
const libredwg = this.libredwg;
|
|
378
364
|
const dimensionCommonAttrs = this.getDimensionCommonAttrs(entity);
|
|
379
|
-
const subDefinitionPoint1 = libredwg.
|
|
380
|
-
const subDefinitionPoint2 = libredwg.
|
|
381
|
-
const centerPoint = libredwg.
|
|
382
|
-
|
|
383
|
-
const arcPoint = libredwg.dwg_dynapi_entity_value(entity, 'xline2end_pt')
|
|
384
|
-
.data;
|
|
365
|
+
const subDefinitionPoint1 = libredwg.dwg_dynapi_entity_data(entity, 'xline1_pt');
|
|
366
|
+
const subDefinitionPoint2 = libredwg.dwg_dynapi_entity_data(entity, 'xline2_pt');
|
|
367
|
+
const centerPoint = libredwg.dwg_dynapi_entity_data(entity, 'center_pt');
|
|
368
|
+
const arcPoint = libredwg.dwg_dynapi_entity_data(entity, 'xline2end_pt');
|
|
385
369
|
return {
|
|
386
370
|
subclassMarker: 'AcDb3PointAngularDimension',
|
|
387
371
|
...commonAttrs,
|
|
@@ -396,10 +380,8 @@ export class LibreEntityConverter {
|
|
|
396
380
|
const libredwg = this.libredwg;
|
|
397
381
|
const dimensionCommonAttrs = this.getDimensionCommonAttrs(entity);
|
|
398
382
|
// TODO: Not sure whether 'first_arc_pt' is same as 'centerPoint'
|
|
399
|
-
const centerPoint = libredwg.
|
|
400
|
-
|
|
401
|
-
const leaderLength = libredwg.dwg_dynapi_entity_value(entity, 'leader_len')
|
|
402
|
-
.data;
|
|
383
|
+
const centerPoint = libredwg.dwg_dynapi_entity_data(entity, 'first_arc_pt');
|
|
384
|
+
const leaderLength = libredwg.dwg_dynapi_entity_data(entity, 'leader_len');
|
|
403
385
|
return {
|
|
404
386
|
subclassMarker: 'AcDbDiametricDimension',
|
|
405
387
|
...commonAttrs,
|
|
@@ -412,9 +394,9 @@ export class LibreEntityConverter {
|
|
|
412
394
|
const libredwg = this.libredwg;
|
|
413
395
|
const dimensionCommonAttrs = this.getDimensionCommonAttrs(entity);
|
|
414
396
|
// TODO: Not sure whether 'feature_location_pt' is same as 'subDefinitionPoint1'
|
|
415
|
-
const subDefinitionPoint1 = libredwg.
|
|
397
|
+
const subDefinitionPoint1 = libredwg.dwg_dynapi_entity_data(entity, 'feature_location_pt');
|
|
416
398
|
// TODO: Not sure whether 'leader_endpt' is same as 'subDefinitionPoint2'
|
|
417
|
-
const subDefinitionPoint2 = libredwg.
|
|
399
|
+
const subDefinitionPoint2 = libredwg.dwg_dynapi_entity_data(entity, 'leader_endpt');
|
|
418
400
|
return {
|
|
419
401
|
subclassMarker: 'AcDbOrdinateDimension',
|
|
420
402
|
...commonAttrs,
|
|
@@ -427,10 +409,8 @@ export class LibreEntityConverter {
|
|
|
427
409
|
const libredwg = this.libredwg;
|
|
428
410
|
const dimensionCommonAttrs = this.getDimensionCommonAttrs(entity);
|
|
429
411
|
// TODO: Not sure whether 'first_arc_pt' is same as 'centerPoint'
|
|
430
|
-
const centerPoint = libredwg.
|
|
431
|
-
|
|
432
|
-
const leaderLength = libredwg.dwg_dynapi_entity_value(entity, 'leader_len')
|
|
433
|
-
.data;
|
|
412
|
+
const centerPoint = libredwg.dwg_dynapi_entity_data(entity, 'first_arc_pt');
|
|
413
|
+
const leaderLength = libredwg.dwg_dynapi_entity_data(entity, 'leader_len');
|
|
434
414
|
return {
|
|
435
415
|
subclassMarker: 'AcDbRadialDimension',
|
|
436
416
|
...commonAttrs,
|
|
@@ -441,16 +421,12 @@ export class LibreEntityConverter {
|
|
|
441
421
|
}
|
|
442
422
|
convertEllise(entity, commonAttrs) {
|
|
443
423
|
const libredwg = this.libredwg;
|
|
444
|
-
const center = libredwg.
|
|
445
|
-
|
|
446
|
-
const
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
const startAngle = libredwg.dwg_dynapi_entity_value(entity, 'start_angle')
|
|
451
|
-
.data;
|
|
452
|
-
const endAngle = libredwg.dwg_dynapi_entity_value(entity, 'end_angle')
|
|
453
|
-
.data;
|
|
424
|
+
const center = libredwg.dwg_dynapi_entity_data(entity, 'center');
|
|
425
|
+
const majorAxisEndPoint = libredwg.dwg_dynapi_entity_data(entity, 'sm_axis');
|
|
426
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
427
|
+
const axisRatio = libredwg.dwg_dynapi_entity_data(entity, 'axis_ratio');
|
|
428
|
+
const startAngle = libredwg.dwg_dynapi_entity_data(entity, 'start_angle');
|
|
429
|
+
const endAngle = libredwg.dwg_dynapi_entity_data(entity, 'end_angle');
|
|
454
430
|
return {
|
|
455
431
|
type: 'ELLIPSE',
|
|
456
432
|
...commonAttrs,
|
|
@@ -464,30 +440,23 @@ export class LibreEntityConverter {
|
|
|
464
440
|
}
|
|
465
441
|
convertHatch(entity, commonAttrs) {
|
|
466
442
|
const libredwg = this.libredwg;
|
|
467
|
-
const extrusionDirection = libredwg.
|
|
468
|
-
const patternName = libredwg.
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
const
|
|
472
|
-
const
|
|
473
|
-
const paths_ptr = libredwg.dwg_dynapi_entity_value(entity, 'paths')
|
|
474
|
-
.data;
|
|
443
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
444
|
+
const patternName = libredwg.dwg_dynapi_entity_data(entity, 'name');
|
|
445
|
+
const isSolidFill = libredwg.dwg_dynapi_entity_data(entity, 'is_solid_fill');
|
|
446
|
+
const isAssociative = libredwg.dwg_dynapi_entity_data(entity, 'is_associative');
|
|
447
|
+
const numberOfBoundaryPaths = libredwg.dwg_dynapi_entity_data(entity, 'num_paths');
|
|
448
|
+
const paths_ptr = libredwg.dwg_dynapi_entity_data(entity, 'paths');
|
|
475
449
|
const boundaryPaths = libredwg.dwg_ptr_to_hatch_path_array(paths_ptr, numberOfBoundaryPaths);
|
|
476
|
-
const patternStyle = libredwg.
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
const patternScale = libredwg.dwg_dynapi_entity_value(entity, 'scale_spacing').data;
|
|
483
|
-
const numberOfDefinitionLines = libredwg.dwg_dynapi_entity_value(entity, 'num_deflines').data;
|
|
484
|
-
const definitionLines_ptr = libredwg.dwg_dynapi_entity_value(entity, 'deflines').data;
|
|
450
|
+
const patternStyle = libredwg.dwg_dynapi_entity_data(entity, 'style');
|
|
451
|
+
const patternType = libredwg.dwg_dynapi_entity_data(entity, 'pattern_type');
|
|
452
|
+
const patternAngle = libredwg.dwg_dynapi_entity_data(entity, 'angle');
|
|
453
|
+
const patternScale = libredwg.dwg_dynapi_entity_data(entity, 'scale_spacing');
|
|
454
|
+
const numberOfDefinitionLines = libredwg.dwg_dynapi_entity_data(entity, 'num_deflines');
|
|
455
|
+
const definitionLines_ptr = libredwg.dwg_dynapi_entity_data(entity, 'deflines');
|
|
485
456
|
const definitionLines = libredwg.dwg_ptr_to_hatch_defline_array(definitionLines_ptr, numberOfDefinitionLines);
|
|
486
|
-
const pixelSize = libredwg.
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
const seedPoints_ptr = libredwg.dwg_dynapi_entity_value(entity, 'seeds')
|
|
490
|
-
.data;
|
|
457
|
+
const pixelSize = libredwg.dwg_dynapi_entity_data(entity, 'pixel_size');
|
|
458
|
+
const numberOfSeedPoints = libredwg.dwg_dynapi_entity_data(entity, 'num_seeds');
|
|
459
|
+
const seedPoints_ptr = libredwg.dwg_dynapi_entity_data(entity, 'seeds');
|
|
491
460
|
const seedPoints = libredwg.dwg_ptr_to_point2d_array(seedPoints_ptr, numberOfSeedPoints);
|
|
492
461
|
const result = {
|
|
493
462
|
...commonAttrs,
|
|
@@ -523,23 +492,16 @@ export class LibreEntityConverter {
|
|
|
523
492
|
seedPoints: seedPoints
|
|
524
493
|
// gradientFlag?: DwgHatchGradientFlag
|
|
525
494
|
};
|
|
526
|
-
const gradientFlag = libredwg.
|
|
527
|
-
.data;
|
|
495
|
+
const gradientFlag = libredwg.dwg_dynapi_entity_data(entity, 'is_gradient_fill');
|
|
528
496
|
if (gradientFlag > 0) {
|
|
529
|
-
const gradientName = libredwg.
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
.data;
|
|
535
|
-
const colorTint = libredwg.dwg_dynapi_entity_value(entity, 'gradient_tint')
|
|
536
|
-
.data;
|
|
537
|
-
const gradientColorFlag = libredwg.dwg_dynapi_entity_value(entity, 'single_color_gradient')
|
|
538
|
-
.data;
|
|
497
|
+
const gradientName = libredwg.dwg_dynapi_entity_data(entity, 'gradient_name');
|
|
498
|
+
const gradientRotation = libredwg.dwg_dynapi_entity_data(entity, 'gradient_angle');
|
|
499
|
+
const gradientDefinition = libredwg.dwg_dynapi_entity_data(entity, 'gradient_shift');
|
|
500
|
+
const colorTint = libredwg.dwg_dynapi_entity_data(entity, 'gradient_tint');
|
|
501
|
+
const gradientColorFlag = libredwg.dwg_dynapi_entity_data(entity, 'single_color_gradient');
|
|
539
502
|
// const numberOfColors = libredwg.dwg_dynapi_entity_value(entity, 'num_colors')
|
|
540
503
|
// .data as number
|
|
541
|
-
const gradientColors_ptr = libredwg.
|
|
542
|
-
.data;
|
|
504
|
+
const gradientColors_ptr = libredwg.dwg_dynapi_entity_data(entity, 'colors');
|
|
543
505
|
const gradientColors = libredwg.dwg_ptr_to_hatch_gradient_color_array(gradientColors_ptr, (gradientColorFlag == 1) ? 1 : 2);
|
|
544
506
|
return {
|
|
545
507
|
type: 'HATCH',
|
|
@@ -641,37 +603,25 @@ export class LibreEntityConverter {
|
|
|
641
603
|
}
|
|
642
604
|
convertImage(entity, commonAttrs) {
|
|
643
605
|
const libredwg = this.libredwg;
|
|
644
|
-
const version = libredwg.
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
const brightness = libredwg.dwg_dynapi_entity_value(entity, 'brightness')
|
|
659
|
-
.data;
|
|
660
|
-
const contrast = libredwg.dwg_dynapi_entity_value(entity, 'contrast')
|
|
661
|
-
.data;
|
|
662
|
-
const fade = libredwg.dwg_dynapi_entity_value(entity, 'fade').data;
|
|
663
|
-
const clipMode = libredwg.dwg_dynapi_entity_value(entity, 'clip_mode')
|
|
664
|
-
.data;
|
|
665
|
-
const clippingBoundaryType = libredwg.dwg_dynapi_entity_value(entity, 'clip_boundary_type').data;
|
|
666
|
-
const countBoundaryPoints = libredwg.dwg_dynapi_entity_value(entity, 'num_clip_verts').data;
|
|
667
|
-
const clip_verts = libredwg.dwg_dynapi_entity_value(entity, 'clip_verts')
|
|
668
|
-
.data;
|
|
606
|
+
const version = libredwg.dwg_dynapi_entity_data(entity, 'class_version');
|
|
607
|
+
const position = libredwg.dwg_dynapi_entity_data(entity, 'pt0');
|
|
608
|
+
const uPixel = libredwg.dwg_dynapi_entity_data(entity, 'uvec');
|
|
609
|
+
const vPixel = libredwg.dwg_dynapi_entity_data(entity, 'vvec');
|
|
610
|
+
const imageSize = libredwg.dwg_dynapi_entity_data(entity, 'image_size');
|
|
611
|
+
const flags = libredwg.dwg_dynapi_entity_data(entity, 'display_props');
|
|
612
|
+
const clipping = libredwg.dwg_dynapi_entity_data(entity, 'clipping');
|
|
613
|
+
const brightness = libredwg.dwg_dynapi_entity_data(entity, 'brightness');
|
|
614
|
+
const contrast = libredwg.dwg_dynapi_entity_data(entity, 'contrast');
|
|
615
|
+
const fade = libredwg.dwg_dynapi_entity_data(entity, 'fade');
|
|
616
|
+
const clipMode = libredwg.dwg_dynapi_entity_data(entity, 'clip_mode');
|
|
617
|
+
const clippingBoundaryType = libredwg.dwg_dynapi_entity_data(entity, 'clip_boundary_type');
|
|
618
|
+
const countBoundaryPoints = libredwg.dwg_dynapi_entity_data(entity, 'num_clip_verts');
|
|
619
|
+
const clip_verts = libredwg.dwg_dynapi_entity_data(entity, 'clip_verts');
|
|
669
620
|
const clippingBoundaryPath = libredwg.dwg_ptr_to_point3d_array(clip_verts, countBoundaryPoints);
|
|
670
|
-
const imagedef_ref = libredwg.
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
const
|
|
674
|
-
const imageDefReactorHandle = idToString(libredwg.dwg_ref_get_absref(imagedefreactor_ref));
|
|
621
|
+
const imagedef_ref = libredwg.dwg_dynapi_entity_data(entity, 'imagedef');
|
|
622
|
+
const imageDefHandle = (libredwg.dwg_ref_get_id(imagedef_ref) ?? '');
|
|
623
|
+
const imagedefreactor_ref = libredwg.dwg_dynapi_entity_data(entity, 'imagedefreactor');
|
|
624
|
+
const imageDefReactorHandle = (libredwg.dwg_ref_get_id(imagedefreactor_ref) ?? '');
|
|
675
625
|
return {
|
|
676
626
|
type: 'IMAGE',
|
|
677
627
|
...commonAttrs,
|
|
@@ -697,7 +647,7 @@ export class LibreEntityConverter {
|
|
|
697
647
|
const libredwg = this.libredwg;
|
|
698
648
|
// Get block name
|
|
699
649
|
let name = '';
|
|
700
|
-
const block_header_ref = libredwg.
|
|
650
|
+
const block_header_ref = libredwg.dwg_dynapi_entity_data(entity, 'block_header');
|
|
701
651
|
if (block_header_ref) {
|
|
702
652
|
const block_header_obj = libredwg.dwg_ref_get_object(block_header_ref);
|
|
703
653
|
if (block_header_obj) {
|
|
@@ -710,23 +660,16 @@ export class LibreEntityConverter {
|
|
|
710
660
|
}
|
|
711
661
|
if (!name) {
|
|
712
662
|
/* pre-R2.0 */
|
|
713
|
-
name = libredwg.
|
|
714
|
-
.data;
|
|
663
|
+
name = libredwg.dwg_dynapi_entity_data(entity, 'block_name');
|
|
715
664
|
}
|
|
716
|
-
const insertionPoint = libredwg.
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
const rowCount = libredwg.dwg_dynapi_entity_value(entity, 'num_rows')
|
|
725
|
-
.data;
|
|
726
|
-
const columnSpacing = libredwg.dwg_dynapi_entity_value(entity, 'col_spacing').data;
|
|
727
|
-
const rowSpacing = libredwg.dwg_dynapi_entity_value(entity, 'row_spacing')
|
|
728
|
-
.data;
|
|
729
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
665
|
+
const insertionPoint = libredwg.dwg_dynapi_entity_data(entity, 'ins_pt');
|
|
666
|
+
const scale = libredwg.dwg_dynapi_entity_data(entity, 'scale');
|
|
667
|
+
const rotation = libredwg.dwg_dynapi_entity_data(entity, 'rotation');
|
|
668
|
+
const columnCount = libredwg.dwg_dynapi_entity_data(entity, 'num_cols');
|
|
669
|
+
const rowCount = libredwg.dwg_dynapi_entity_data(entity, 'num_rows');
|
|
670
|
+
const columnSpacing = libredwg.dwg_dynapi_entity_data(entity, 'col_spacing');
|
|
671
|
+
const rowSpacing = libredwg.dwg_dynapi_entity_data(entity, 'row_spacing');
|
|
672
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
730
673
|
const attrib_ptr_array = libredwg.dwg_entity_insert_get_attribs(entity);
|
|
731
674
|
const attribs = [];
|
|
732
675
|
attrib_ptr_array.forEach(object_ptr => {
|
|
@@ -762,28 +705,23 @@ export class LibreEntityConverter {
|
|
|
762
705
|
convertLeader(entity, commonAttrs) {
|
|
763
706
|
const libredwg = this.libredwg;
|
|
764
707
|
const styleName = libredwg.dwg_entity_mtext_get_style_name(entity);
|
|
765
|
-
const isArrowheadEnabled = libredwg.
|
|
766
|
-
const isSpline = libredwg.
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
const
|
|
770
|
-
const
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
.data;
|
|
775
|
-
const numberOfVertices = libredwg.dwg_dynapi_entity_value(entity, 'num_points').data;
|
|
776
|
-
const vertices_ptr = libredwg.dwg_dynapi_entity_value(entity, 'points')
|
|
777
|
-
.data;
|
|
708
|
+
const isArrowheadEnabled = libredwg.dwg_dynapi_entity_data(entity, 'arrowhead_type');
|
|
709
|
+
const isSpline = libredwg.dwg_dynapi_entity_data(entity, 'path_type');
|
|
710
|
+
const leaderCreationFlag = libredwg.dwg_dynapi_entity_data(entity, 'annot_type');
|
|
711
|
+
const isHooklineSameDirection = libredwg.dwg_dynapi_entity_data(entity, 'hookline_dir');
|
|
712
|
+
const isHooklineExists = libredwg.dwg_dynapi_entity_data(entity, 'hookline_on');
|
|
713
|
+
const textHeight = libredwg.dwg_dynapi_entity_data(entity, 'box_height');
|
|
714
|
+
const textWidth = libredwg.dwg_dynapi_entity_data(entity, 'box_width');
|
|
715
|
+
const numberOfVertices = libredwg.dwg_dynapi_entity_data(entity, 'num_points');
|
|
716
|
+
const vertices_ptr = libredwg.dwg_dynapi_entity_data(entity, 'points');
|
|
778
717
|
const vertices = numberOfVertices > 0
|
|
779
718
|
? libredwg.dwg_ptr_to_point3d_array(vertices_ptr, numberOfVertices)
|
|
780
719
|
: [];
|
|
781
|
-
const byBlockColor = libredwg.
|
|
782
|
-
const normal = libredwg.
|
|
783
|
-
|
|
784
|
-
const
|
|
785
|
-
const
|
|
786
|
-
const offsetFromAnnotation = libredwg.dwg_dynapi_entity_value(entity, 'endptproj').data;
|
|
720
|
+
const byBlockColor = libredwg.dwg_dynapi_entity_data(entity, 'byblock_color');
|
|
721
|
+
const normal = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
722
|
+
const horizontalDirection = libredwg.dwg_dynapi_entity_data(entity, 'x_direction');
|
|
723
|
+
const offsetFromBlock = libredwg.dwg_dynapi_entity_data(entity, 'inspt_offset');
|
|
724
|
+
const offsetFromAnnotation = libredwg.dwg_dynapi_entity_data(entity, 'endptproj');
|
|
787
725
|
return {
|
|
788
726
|
type: 'LEADER',
|
|
789
727
|
...commonAttrs,
|
|
@@ -806,13 +744,10 @@ export class LibreEntityConverter {
|
|
|
806
744
|
}
|
|
807
745
|
convertLine(entity, commonAttrs) {
|
|
808
746
|
const libredwg = this.libredwg;
|
|
809
|
-
const startPoint = libredwg.
|
|
810
|
-
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
const thickness = libredwg.dwg_dynapi_entity_value(entity, 'thickness')
|
|
814
|
-
.data;
|
|
815
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
747
|
+
const startPoint = libredwg.dwg_dynapi_entity_data(entity, 'start');
|
|
748
|
+
const endPoint = libredwg.dwg_dynapi_entity_data(entity, 'end');
|
|
749
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
750
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
816
751
|
return {
|
|
817
752
|
type: 'LINE',
|
|
818
753
|
...commonAttrs,
|
|
@@ -824,24 +759,18 @@ export class LibreEntityConverter {
|
|
|
824
759
|
}
|
|
825
760
|
convertLWPolyline(entity, commonAttrs) {
|
|
826
761
|
const libredwg = this.libredwg;
|
|
827
|
-
const numberOfVertices = libredwg.
|
|
828
|
-
const flag = libredwg.
|
|
829
|
-
const constantWidth = libredwg.
|
|
830
|
-
const elevation = libredwg.
|
|
831
|
-
|
|
832
|
-
const
|
|
833
|
-
.data;
|
|
834
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
762
|
+
const numberOfVertices = libredwg.dwg_dynapi_entity_data(entity, 'num_points');
|
|
763
|
+
const flag = libredwg.dwg_dynapi_entity_data(entity, 'flag');
|
|
764
|
+
const constantWidth = libredwg.dwg_dynapi_entity_data(entity, 'const_width');
|
|
765
|
+
const elevation = libredwg.dwg_dynapi_entity_data(entity, 'elevation');
|
|
766
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
767
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
835
768
|
const vertices = [];
|
|
836
|
-
const num_points = libredwg.
|
|
837
|
-
|
|
838
|
-
const points_ptr = libredwg.dwg_dynapi_entity_value(entity, 'points')
|
|
839
|
-
.data;
|
|
769
|
+
const num_points = libredwg.dwg_dynapi_entity_data(entity, 'num_points');
|
|
770
|
+
const points_ptr = libredwg.dwg_dynapi_entity_data(entity, 'points');
|
|
840
771
|
const points = libredwg.dwg_ptr_to_point2d_array(points_ptr, num_points);
|
|
841
|
-
const num_bulges = libredwg.
|
|
842
|
-
|
|
843
|
-
const bulges_ptr = libredwg.dwg_dynapi_entity_value(entity, 'bulges')
|
|
844
|
-
.data;
|
|
772
|
+
const num_bulges = libredwg.dwg_dynapi_entity_data(entity, 'num_bulges');
|
|
773
|
+
const bulges_ptr = libredwg.dwg_dynapi_entity_data(entity, 'bulges');
|
|
845
774
|
const bulges = libredwg.dwg_ptr_to_double_array(bulges_ptr, num_bulges);
|
|
846
775
|
points.forEach((point, index) => {
|
|
847
776
|
vertices.push({
|
|
@@ -865,19 +794,14 @@ export class LibreEntityConverter {
|
|
|
865
794
|
}
|
|
866
795
|
convertMLine(entity, commonAttrs) {
|
|
867
796
|
const libredwg = this.libredwg;
|
|
868
|
-
const scale = libredwg.
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
const
|
|
873
|
-
const
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
const numberOfLines = libredwg.dwg_dynapi_entity_value(entity, 'num_lines')
|
|
877
|
-
.data;
|
|
878
|
-
const numberOfVertices = libredwg.dwg_dynapi_entity_value(entity, 'num_verts').data;
|
|
879
|
-
const verts_ptr = libredwg.dwg_dynapi_entity_value(entity, 'verts')
|
|
880
|
-
.data;
|
|
797
|
+
const scale = libredwg.dwg_dynapi_entity_data(entity, 'scale');
|
|
798
|
+
const flags = libredwg.dwg_dynapi_entity_data(entity, 'flags');
|
|
799
|
+
const justification = libredwg.dwg_dynapi_entity_data(entity, 'justification');
|
|
800
|
+
const startPoint = libredwg.dwg_dynapi_entity_data(entity, 'base_point');
|
|
801
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
802
|
+
const numberOfLines = libredwg.dwg_dynapi_entity_data(entity, 'num_lines');
|
|
803
|
+
const numberOfVertices = libredwg.dwg_dynapi_entity_data(entity, 'num_verts');
|
|
804
|
+
const verts_ptr = libredwg.dwg_dynapi_entity_data(entity, 'verts');
|
|
881
805
|
const verts = libredwg.dwg_ptr_to_mline_vertex_array(verts_ptr, numberOfVertices);
|
|
882
806
|
const vertices = [];
|
|
883
807
|
verts.forEach(vert => {
|
|
@@ -910,26 +834,302 @@ export class LibreEntityConverter {
|
|
|
910
834
|
mlineStyle: '' // TODO: Set the correct value
|
|
911
835
|
};
|
|
912
836
|
}
|
|
837
|
+
convertMultiLeader(entity, commonAttrs) {
|
|
838
|
+
const libredwg = this.libredwg;
|
|
839
|
+
const entityVal = (field) => libredwg.dwg_dynapi_entity_data(entity, field);
|
|
840
|
+
const subclassVal = (ptr, subclass, field) => libredwg.dwg_dynapi_subclass_data(ptr, subclass, field);
|
|
841
|
+
const refToId = (ref) => libredwg.dwg_ref_get_id(ref);
|
|
842
|
+
const asBool = (value) => value > 0;
|
|
843
|
+
const mleaderColor = (color) => color != null ? dwgColorToMLeaderRawColor(color) : undefined;
|
|
844
|
+
const version = entityVal('class_version');
|
|
845
|
+
const leaderStyleId = refToId(entityVal('mleaderstyle'));
|
|
846
|
+
const propertyOverrideFlag = entityVal('flags');
|
|
847
|
+
const leaderLineType = entityVal('type');
|
|
848
|
+
const leaderLineColor = mleaderColor(entityVal('line_color'));
|
|
849
|
+
const leaderLineTypeId = refToId(entityVal('line_ltype'));
|
|
850
|
+
const leaderLineWeight = entityVal('line_linewt');
|
|
851
|
+
const landingEnabled = asBool(entityVal('has_landing'));
|
|
852
|
+
const doglegEnabled = asBool(entityVal('has_dogleg'));
|
|
853
|
+
const doglegLength = entityVal('landing_dist');
|
|
854
|
+
const arrowheadId = refToId(entityVal('arrow_handle'));
|
|
855
|
+
const arrowheadSize = entityVal('arrow_size');
|
|
856
|
+
const contentType = entityVal('style_content');
|
|
857
|
+
const textStyleId = refToId(entityVal('text_style'));
|
|
858
|
+
const textLeftAttachmentType = entityVal('text_left');
|
|
859
|
+
const textRightAttachmentType = entityVal('text_right');
|
|
860
|
+
const textAngleType = entityVal('text_angletype');
|
|
861
|
+
const textAlignmentType = entityVal('text_alignment');
|
|
862
|
+
const textColor = mleaderColor(entityVal('text_color'));
|
|
863
|
+
const textFrameEnabled = asBool(entityVal('has_text_frame'));
|
|
864
|
+
const blockContentId = refToId(entityVal('block_style'));
|
|
865
|
+
const blockContentColor = mleaderColor(entityVal('block_color'));
|
|
866
|
+
const blockContentScale = entityVal('block_scale');
|
|
867
|
+
const blockContentRotation = entityVal('block_rotation');
|
|
868
|
+
const blockContentConnectionType = entityVal('style_attachment');
|
|
869
|
+
const annotativeScaleEnabled = asBool(entityVal('is_annotative'));
|
|
870
|
+
const textDirectionNegative = asBool(entityVal('is_neg_textdir'));
|
|
871
|
+
const textAlignInIPE = entityVal('ipe_alignment');
|
|
872
|
+
let textAttachmentPoint = entityVal('justification');
|
|
873
|
+
const textAttachmentDirection = entityVal('attach_dir');
|
|
874
|
+
const bottomTextAttachmentDirection = entityVal('attach_bottom');
|
|
875
|
+
const topTextAttachmentDirection = entityVal('attach_top');
|
|
876
|
+
const contentScale = entityVal('scale_factor');
|
|
877
|
+
const numArrowheads = entityVal('num_arrowheads');
|
|
878
|
+
const arrowheadsPtr = entityVal('arrowheads');
|
|
879
|
+
const arrowHeadSize = libredwg.dwg_dynapi_subclass_size('LEADER_ArrowHead');
|
|
880
|
+
const arrowheadOverrides = [];
|
|
881
|
+
for (let i = 0; i < numArrowheads; i++) {
|
|
882
|
+
const arrowheadPtr = arrowheadsPtr + i * arrowHeadSize;
|
|
883
|
+
arrowheadOverrides.push({
|
|
884
|
+
index: subclassVal(arrowheadPtr, 'LEADER_ArrowHead', 'is_default'),
|
|
885
|
+
handle: refToId(subclassVal(arrowheadPtr, 'LEADER_ArrowHead', 'arrowhead')) ?? ''
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
const numBlocklabels = entityVal('num_blocklabels');
|
|
889
|
+
const blocklabelsPtr = entityVal('blocklabels');
|
|
890
|
+
const blockLabelSize = libredwg.dwg_dynapi_subclass_size('LEADER_BlockLabel');
|
|
891
|
+
const blockAttributes = [];
|
|
892
|
+
for (let i = 0; i < numBlocklabels; i++) {
|
|
893
|
+
const blocklabelPtr = blocklabelsPtr + i * blockLabelSize;
|
|
894
|
+
blockAttributes.push({
|
|
895
|
+
id: refToId(subclassVal(blocklabelPtr, 'LEADER_BlockLabel', 'attdef')),
|
|
896
|
+
index: subclassVal(blocklabelPtr, 'LEADER_BlockLabel', 'ui_index'),
|
|
897
|
+
width: subclassVal(blocklabelPtr, 'LEADER_BlockLabel', 'width'),
|
|
898
|
+
text: subclassVal(blocklabelPtr, 'LEADER_BlockLabel', 'label_text')
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
const ctxPtr = entity + libredwg.dwg_dynapi_entity_field_offset(entity, 'ctx');
|
|
902
|
+
const contentPtr = ctxPtr +
|
|
903
|
+
libredwg.dwg_dynapi_subclass_field_offset('MLEADER_AnnotContext', 'content');
|
|
904
|
+
const contentScaleFactor = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'scale_factor');
|
|
905
|
+
const contentBasePosition = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'content_base');
|
|
906
|
+
const landingGap = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'landing_gap');
|
|
907
|
+
const textAttachment = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'attach_dir');
|
|
908
|
+
const contextTextHeight = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'text_height');
|
|
909
|
+
const contextArrowSize = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'arrow_size');
|
|
910
|
+
const contextTextLeft = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'text_left');
|
|
911
|
+
const contextTextRight = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'text_right');
|
|
912
|
+
const contextTextAngleType = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'text_angletype');
|
|
913
|
+
const contextTextAlignment = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'text_alignment');
|
|
914
|
+
const hasMText = asBool(subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'has_content_txt'));
|
|
915
|
+
const hasBlock = asBool(subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'has_content_blk'));
|
|
916
|
+
const planeOrigin = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'base');
|
|
917
|
+
const planeXAxisDirection = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'base_dir');
|
|
918
|
+
const planeYAxisDirection = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'base_vert');
|
|
919
|
+
const planeNormalReversed = asBool(subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'is_normal_reversed'));
|
|
920
|
+
let textFlowDirection;
|
|
921
|
+
let normal;
|
|
922
|
+
let textRotation;
|
|
923
|
+
let textWidth;
|
|
924
|
+
let textLineSpacingFactor;
|
|
925
|
+
let textLineSpacingStyle;
|
|
926
|
+
let textAnchor;
|
|
927
|
+
let textDirection;
|
|
928
|
+
let textBackgroundColor;
|
|
929
|
+
let textBackgroundScaleFactor;
|
|
930
|
+
let textBackgroundTransparency;
|
|
931
|
+
let textBackgroundColorOn;
|
|
932
|
+
let textFillOn;
|
|
933
|
+
let textColumnType;
|
|
934
|
+
let textUseAutoHeight;
|
|
935
|
+
let textColumnWidth;
|
|
936
|
+
let textColumnGutterWidth;
|
|
937
|
+
let textColumnFlowReversed;
|
|
938
|
+
let textColumnHeight;
|
|
939
|
+
let textUseWordBreak;
|
|
940
|
+
let textContent;
|
|
941
|
+
if (hasMText) {
|
|
942
|
+
const textAlignment = subclassVal(contentPtr, 'MLEADER_Content_MText', 'alignment');
|
|
943
|
+
if (textAlignment != null && textAlignment !== 0) {
|
|
944
|
+
textAttachmentPoint = textAlignment;
|
|
945
|
+
}
|
|
946
|
+
normal = subclassVal(contentPtr, 'MLEADER_Content_MText', 'normal');
|
|
947
|
+
textAnchor = subclassVal(contentPtr, 'MLEADER_Content_MText', 'location');
|
|
948
|
+
textRotation = subclassVal(contentPtr, 'MLEADER_Content_MText', 'rotation');
|
|
949
|
+
textDirection = subclassVal(contentPtr, 'MLEADER_Content_MText', 'direction');
|
|
950
|
+
textWidth = subclassVal(contentPtr, 'MLEADER_Content_MText', 'width');
|
|
951
|
+
textLineSpacingFactor = subclassVal(contentPtr, 'MLEADER_Content_MText', 'line_spacing_factor');
|
|
952
|
+
textLineSpacingStyle = subclassVal(contentPtr, 'MLEADER_Content_MText', 'line_spacing_style');
|
|
953
|
+
textFlowDirection = subclassVal(contentPtr, 'MLEADER_Content_MText', 'flow');
|
|
954
|
+
textBackgroundColor = mleaderColor(subclassVal(contentPtr, 'MLEADER_Content_MText', 'bg_color'));
|
|
955
|
+
textBackgroundScaleFactor = subclassVal(contentPtr, 'MLEADER_Content_MText', 'bg_scale');
|
|
956
|
+
textBackgroundTransparency = subclassVal(contentPtr, 'MLEADER_Content_MText', 'bg_transparency');
|
|
957
|
+
textFillOn = asBool(subclassVal(contentPtr, 'MLEADER_Content_MText', 'is_bg_fill'));
|
|
958
|
+
textBackgroundColorOn = asBool(subclassVal(contentPtr, 'MLEADER_Content_MText', 'is_bg_mask_fill'));
|
|
959
|
+
textColumnType = subclassVal(contentPtr, 'MLEADER_Content_MText', 'col_type');
|
|
960
|
+
textUseAutoHeight = asBool(subclassVal(contentPtr, 'MLEADER_Content_MText', 'is_height_auto'));
|
|
961
|
+
textColumnWidth = subclassVal(contentPtr, 'MLEADER_Content_MText', 'col_width');
|
|
962
|
+
textColumnGutterWidth = subclassVal(contentPtr, 'MLEADER_Content_MText', 'col_gutter');
|
|
963
|
+
textColumnFlowReversed = asBool(subclassVal(contentPtr, 'MLEADER_Content_MText', 'is_col_flow_reversed'));
|
|
964
|
+
const numColSizes = subclassVal(contentPtr, 'MLEADER_Content_MText', 'num_col_sizes');
|
|
965
|
+
const colSizesPtr = subclassVal(contentPtr, 'MLEADER_Content_MText', 'col_sizes');
|
|
966
|
+
if (numColSizes > 0) {
|
|
967
|
+
textColumnHeight = libredwg.dwg_ptr_to_double_array(colSizesPtr, numColSizes)[0];
|
|
968
|
+
}
|
|
969
|
+
textUseWordBreak = asBool(subclassVal(contentPtr, 'MLEADER_Content_MText', 'word_break'));
|
|
970
|
+
textContent = subclassVal(contentPtr, 'MLEADER_Content_MText', 'default_text');
|
|
971
|
+
}
|
|
972
|
+
let blockContent;
|
|
973
|
+
if (hasBlock) {
|
|
974
|
+
const transformPtr = subclassVal(contentPtr, 'MLEADER_Content_Block', 'transform');
|
|
975
|
+
blockContent = {
|
|
976
|
+
blockContentId: refToId(subclassVal(contentPtr, 'MLEADER_Content_Block', 'block_table')),
|
|
977
|
+
normal: subclassVal(contentPtr, 'MLEADER_Content_Block', 'normal'),
|
|
978
|
+
position: subclassVal(contentPtr, 'MLEADER_Content_Block', 'location'),
|
|
979
|
+
scale: subclassVal(contentPtr, 'MLEADER_Content_Block', 'scale'),
|
|
980
|
+
rotation: subclassVal(contentPtr, 'MLEADER_Content_Block', 'rotation'),
|
|
981
|
+
color: mleaderColor(subclassVal(contentPtr, 'MLEADER_Content_Block', 'color')),
|
|
982
|
+
transformationMatrix: transformPtr
|
|
983
|
+
? libredwg.dwg_ptr_to_double_array(transformPtr, 16)
|
|
984
|
+
: undefined
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
const numLeaders = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'num_leaders');
|
|
988
|
+
const leadersPtr = subclassVal(ctxPtr, 'MLEADER_AnnotContext', 'leaders');
|
|
989
|
+
const leaderNodeSize = libredwg.dwg_dynapi_subclass_size('LEADER_Node');
|
|
990
|
+
const leaderLineSize = libredwg.dwg_dynapi_subclass_size('LEADER_Line');
|
|
991
|
+
const leaderBreakSize = libredwg.dwg_dynapi_subclass_size('LEADER_Break');
|
|
992
|
+
const leaderSections = [];
|
|
993
|
+
for (let i = 0; i < numLeaders; i++) {
|
|
994
|
+
const nodePtr = leadersPtr + i * leaderNodeSize;
|
|
995
|
+
const lastLeaderLinePointSet = asBool(subclassVal(nodePtr, 'LEADER_Node', 'has_lastleaderlinepoint'));
|
|
996
|
+
const doglegVectorSet = asBool(subclassVal(nodePtr, 'LEADER_Node', 'has_dogleg'));
|
|
997
|
+
const numBreaks = subclassVal(nodePtr, 'LEADER_Node', 'num_breaks');
|
|
998
|
+
const breaksPtr = subclassVal(nodePtr, 'LEADER_Node', 'breaks');
|
|
999
|
+
const nodeBreaks = [];
|
|
1000
|
+
for (let j = 0; j < numBreaks; j++) {
|
|
1001
|
+
const breakPtr = breaksPtr + j * leaderBreakSize;
|
|
1002
|
+
nodeBreaks.push({
|
|
1003
|
+
start: subclassVal(breakPtr, 'LEADER_Break', 'start'),
|
|
1004
|
+
end: subclassVal(breakPtr, 'LEADER_Break', 'end')
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
const numLines = subclassVal(nodePtr, 'LEADER_Node', 'num_lines');
|
|
1008
|
+
const linesPtr = subclassVal(nodePtr, 'LEADER_Node', 'lines');
|
|
1009
|
+
const leaderLines = [];
|
|
1010
|
+
for (let j = 0; j < numLines; j++) {
|
|
1011
|
+
const linePtr = linesPtr + j * leaderLineSize;
|
|
1012
|
+
const numPoints = subclassVal(linePtr, 'LEADER_Line', 'num_points');
|
|
1013
|
+
const pointsPtr = subclassVal(linePtr, 'LEADER_Line', 'points');
|
|
1014
|
+
const vertices = numPoints > 0
|
|
1015
|
+
? libredwg.dwg_ptr_to_point3d_array(pointsPtr, numPoints)
|
|
1016
|
+
: [];
|
|
1017
|
+
const lineNumBreaks = subclassVal(linePtr, 'LEADER_Line', 'num_breaks');
|
|
1018
|
+
const lineBreaksPtr = subclassVal(linePtr, 'LEADER_Line', 'breaks');
|
|
1019
|
+
const lineBreaks = [];
|
|
1020
|
+
for (let k = 0; k < lineNumBreaks; k++) {
|
|
1021
|
+
const breakPtr = lineBreaksPtr + k * leaderBreakSize;
|
|
1022
|
+
lineBreaks.push({
|
|
1023
|
+
start: subclassVal(breakPtr, 'LEADER_Break', 'start'),
|
|
1024
|
+
end: subclassVal(breakPtr, 'LEADER_Break', 'end')
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
leaderLines.push({
|
|
1028
|
+
vertices,
|
|
1029
|
+
leaderLineIndex: subclassVal(linePtr, 'LEADER_Line', 'line_index'),
|
|
1030
|
+
breaks: lineBreaks.length > 0 ? lineBreaks : undefined
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
leaderSections.push({
|
|
1034
|
+
lastLeaderLinePoint: lastLeaderLinePointSet
|
|
1035
|
+
? subclassVal(nodePtr, 'LEADER_Node', 'lastleaderlinepoint')
|
|
1036
|
+
: undefined,
|
|
1037
|
+
lastLeaderLinePointSet,
|
|
1038
|
+
doglegVector: doglegVectorSet
|
|
1039
|
+
? subclassVal(nodePtr, 'LEADER_Node', 'dogleg_vector')
|
|
1040
|
+
: undefined,
|
|
1041
|
+
doglegVectorSet,
|
|
1042
|
+
doglegLength: subclassVal(nodePtr, 'LEADER_Node', 'dogleg_length'),
|
|
1043
|
+
breaks: nodeBreaks.length > 0 ? nodeBreaks : undefined,
|
|
1044
|
+
leaderBranchIndex: subclassVal(nodePtr, 'LEADER_Node', 'branch_index'),
|
|
1045
|
+
leaderLines
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
return {
|
|
1049
|
+
type: 'MULTILEADER',
|
|
1050
|
+
...commonAttrs,
|
|
1051
|
+
subclassMarker: 'AcDbMLeader',
|
|
1052
|
+
version,
|
|
1053
|
+
leaderStyleId,
|
|
1054
|
+
propertyOverrideFlag,
|
|
1055
|
+
leaderLineType,
|
|
1056
|
+
leaderLineColor,
|
|
1057
|
+
leaderLineTypeId,
|
|
1058
|
+
leaderLineWeight,
|
|
1059
|
+
landingEnabled,
|
|
1060
|
+
doglegEnabled,
|
|
1061
|
+
doglegLength,
|
|
1062
|
+
arrowheadId,
|
|
1063
|
+
arrowheadSize: arrowheadSize || contextArrowSize,
|
|
1064
|
+
contentType,
|
|
1065
|
+
textStyleId,
|
|
1066
|
+
textLeftAttachmentType: textLeftAttachmentType || contextTextLeft,
|
|
1067
|
+
textRightAttachmentType: textRightAttachmentType || contextTextRight,
|
|
1068
|
+
textAngleType: textAngleType || contextTextAngleType,
|
|
1069
|
+
textAlignmentType: textAlignmentType || contextTextAlignment,
|
|
1070
|
+
textColor,
|
|
1071
|
+
textFrameEnabled,
|
|
1072
|
+
landingGap,
|
|
1073
|
+
textAttachment,
|
|
1074
|
+
textFlowDirection,
|
|
1075
|
+
blockContentId,
|
|
1076
|
+
blockContentColor,
|
|
1077
|
+
blockContentScale,
|
|
1078
|
+
blockContentRotation,
|
|
1079
|
+
blockContentConnectionType,
|
|
1080
|
+
annotativeScaleEnabled,
|
|
1081
|
+
arrowheadOverrides: arrowheadOverrides.length > 0 ? arrowheadOverrides : undefined,
|
|
1082
|
+
blockAttributes: blockAttributes.length > 0 ? blockAttributes : undefined,
|
|
1083
|
+
textDirectionNegative,
|
|
1084
|
+
textAlignInIPE,
|
|
1085
|
+
textAttachmentPoint,
|
|
1086
|
+
textAttachmentDirection,
|
|
1087
|
+
bottomTextAttachmentDirection,
|
|
1088
|
+
topTextAttachmentDirection,
|
|
1089
|
+
contentScale: contentScale || contentScaleFactor,
|
|
1090
|
+
contentBasePosition,
|
|
1091
|
+
normal,
|
|
1092
|
+
textHeight: contextTextHeight,
|
|
1093
|
+
textRotation,
|
|
1094
|
+
textWidth,
|
|
1095
|
+
textLineSpacingFactor,
|
|
1096
|
+
textLineSpacingStyle,
|
|
1097
|
+
textAnchor,
|
|
1098
|
+
textDirection,
|
|
1099
|
+
textBackgroundColor,
|
|
1100
|
+
textBackgroundScaleFactor,
|
|
1101
|
+
textBackgroundTransparency,
|
|
1102
|
+
textBackgroundColorOn,
|
|
1103
|
+
textFillOn,
|
|
1104
|
+
textColumnType,
|
|
1105
|
+
textUseAutoHeight,
|
|
1106
|
+
textColumnWidth,
|
|
1107
|
+
textColumnGutterWidth,
|
|
1108
|
+
textColumnFlowReversed,
|
|
1109
|
+
textColumnHeight,
|
|
1110
|
+
textUseWordBreak,
|
|
1111
|
+
textContent,
|
|
1112
|
+
hasMText,
|
|
1113
|
+
hasBlock,
|
|
1114
|
+
blockContent,
|
|
1115
|
+
planeOrigin,
|
|
1116
|
+
planeXAxisDirection,
|
|
1117
|
+
planeYAxisDirection,
|
|
1118
|
+
planeNormalReversed,
|
|
1119
|
+
leaderSections: leaderSections.length > 0 ? leaderSections : undefined
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
913
1122
|
convertOle2Frame(entity, commonAttrs) {
|
|
914
1123
|
const libredwg = this.libredwg;
|
|
915
|
-
const oleVersion = libredwg.
|
|
916
|
-
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
const
|
|
924
|
-
.data;
|
|
925
|
-
const lockAspect = libredwg.dwg_dynapi_entity_value(entity, 'lock_aspect')
|
|
926
|
-
.data;
|
|
927
|
-
const oleObjectType = libredwg.dwg_dynapi_entity_value(entity, 'type')
|
|
928
|
-
.data;
|
|
929
|
-
const tileModeDescriptor = libredwg.dwg_dynapi_entity_value(entity, 'mode')
|
|
930
|
-
.data;
|
|
931
|
-
const binaryData = libredwg.dwg_dynapi_entity_value(entity, 'data')
|
|
932
|
-
.data;
|
|
1124
|
+
const oleVersion = libredwg.dwg_dynapi_entity_data(entity, 'oleversion');
|
|
1125
|
+
const oleClient = libredwg.dwg_dynapi_entity_data(entity, 'oleclient');
|
|
1126
|
+
const dataSize = libredwg.dwg_dynapi_entity_data(entity, 'data_size');
|
|
1127
|
+
const leftUpPoint = libredwg.dwg_dynapi_entity_data(entity, 'pt1');
|
|
1128
|
+
const rightDownPoint = libredwg.dwg_dynapi_entity_data(entity, 'pt2');
|
|
1129
|
+
const lockAspect = libredwg.dwg_dynapi_entity_data(entity, 'lock_aspect');
|
|
1130
|
+
const oleObjectType = libredwg.dwg_dynapi_entity_data(entity, 'type');
|
|
1131
|
+
const tileModeDescriptor = libredwg.dwg_dynapi_entity_data(entity, 'mode');
|
|
1132
|
+
const binaryData = libredwg.dwg_dynapi_entity_data(entity, 'data');
|
|
933
1133
|
return {
|
|
934
1134
|
type: 'OLE2FRAME',
|
|
935
1135
|
...commonAttrs,
|
|
@@ -946,12 +1146,10 @@ export class LibreEntityConverter {
|
|
|
946
1146
|
}
|
|
947
1147
|
convertOleFrame(entity, commonAttrs) {
|
|
948
1148
|
const libredwg = this.libredwg;
|
|
949
|
-
const flag = libredwg.
|
|
950
|
-
const mode = libredwg.
|
|
951
|
-
const dataSize = libredwg.
|
|
952
|
-
|
|
953
|
-
const binaryData = libredwg.dwg_dynapi_entity_value(entity, 'data')
|
|
954
|
-
.data;
|
|
1149
|
+
const flag = libredwg.dwg_dynapi_entity_data(entity, 'flag');
|
|
1150
|
+
const mode = libredwg.dwg_dynapi_entity_data(entity, 'mode');
|
|
1151
|
+
const dataSize = libredwg.dwg_dynapi_entity_data(entity, 'data_size');
|
|
1152
|
+
const binaryData = libredwg.dwg_dynapi_entity_data(entity, 'data');
|
|
955
1153
|
return {
|
|
956
1154
|
type: 'OLEFRAME',
|
|
957
1155
|
...commonAttrs,
|
|
@@ -963,39 +1161,31 @@ export class LibreEntityConverter {
|
|
|
963
1161
|
}
|
|
964
1162
|
convertMText(entity, commonAttrs) {
|
|
965
1163
|
const libredwg = this.libredwg;
|
|
966
|
-
const insertionPoint = libredwg.
|
|
967
|
-
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
const
|
|
975
|
-
const extentsHeight = libredwg.dwg_dynapi_entity_value(entity, 'extents_height').data;
|
|
976
|
-
const attachmentPoint = libredwg.dwg_dynapi_entity_value(entity, 'attachment').data;
|
|
977
|
-
const drawingDirection = libredwg.dwg_dynapi_entity_value(entity, 'flow_dir').data;
|
|
978
|
-
const text = libredwg.dwg_dynapi_entity_value(entity, 'text').data;
|
|
1164
|
+
const insertionPoint = libredwg.dwg_dynapi_entity_data(entity, 'ins_pt');
|
|
1165
|
+
const textHeight = libredwg.dwg_dynapi_entity_data(entity, 'text_height');
|
|
1166
|
+
const rectHeight = libredwg.dwg_dynapi_entity_data(entity, 'rect_height');
|
|
1167
|
+
const rectWidth = libredwg.dwg_dynapi_entity_data(entity, 'rect_width');
|
|
1168
|
+
const extentsWidth = libredwg.dwg_dynapi_entity_data(entity, 'extents_width');
|
|
1169
|
+
const extentsHeight = libredwg.dwg_dynapi_entity_data(entity, 'extents_height');
|
|
1170
|
+
const attachmentPoint = libredwg.dwg_dynapi_entity_data(entity, 'attachment');
|
|
1171
|
+
const drawingDirection = libredwg.dwg_dynapi_entity_data(entity, 'flow_dir');
|
|
1172
|
+
const text = libredwg.dwg_dynapi_entity_data(entity, 'text');
|
|
979
1173
|
const styleName = libredwg.dwg_entity_mtext_get_style_name(entity);
|
|
980
|
-
const extrusionDirection = libredwg.
|
|
981
|
-
const direction = libredwg.
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
const
|
|
985
|
-
const
|
|
986
|
-
const
|
|
987
|
-
const
|
|
988
|
-
const
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
const
|
|
992
|
-
const
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
const columnGutter = libredwg.dwg_dynapi_entity_value(entity, 'gutter')
|
|
996
|
-
.data;
|
|
997
|
-
const columnHeightCount = libredwg.dwg_dynapi_entity_value(entity, 'num_column_heights').data;
|
|
998
|
-
const columnHeights_ptr = libredwg.dwg_dynapi_entity_value(entity, 'column_heights').data;
|
|
1174
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1175
|
+
const direction = libredwg.dwg_dynapi_entity_data(entity, 'x_axis_dir');
|
|
1176
|
+
const lineSpacingStyle = libredwg.dwg_dynapi_entity_data(entity, 'linespace_style');
|
|
1177
|
+
const lineSpacing = libredwg.dwg_dynapi_entity_data(entity, 'linespace_factor');
|
|
1178
|
+
const backgroundFill = libredwg.dwg_dynapi_entity_data(entity, 'bg_fill_flag');
|
|
1179
|
+
const fillBoxScale = libredwg.dwg_dynapi_entity_data(entity, 'bg_fill_scale');
|
|
1180
|
+
const backgroundFillColor = libredwg.dwg_dynapi_entity_data(entity, 'bg_fill_color');
|
|
1181
|
+
const backgroundFillTransparency = libredwg.dwg_dynapi_entity_data(entity, 'bg_fill_trans');
|
|
1182
|
+
const columnType = libredwg.dwg_dynapi_entity_data(entity, 'column_type');
|
|
1183
|
+
const columnFlowReversed = libredwg.dwg_dynapi_entity_data(entity, 'flow_reversed');
|
|
1184
|
+
const columnAutoHeight = libredwg.dwg_dynapi_entity_data(entity, 'auto_height');
|
|
1185
|
+
const columnWidth = libredwg.dwg_dynapi_entity_data(entity, 'column_width');
|
|
1186
|
+
const columnGutter = libredwg.dwg_dynapi_entity_data(entity, 'gutter');
|
|
1187
|
+
const columnHeightCount = libredwg.dwg_dynapi_entity_data(entity, 'num_column_heights');
|
|
1188
|
+
const columnHeights_ptr = libredwg.dwg_dynapi_entity_data(entity, 'column_heights');
|
|
999
1189
|
const columnHeights = libredwg.dwg_ptr_to_double_array(columnHeights_ptr, columnHeightCount);
|
|
1000
1190
|
return {
|
|
1001
1191
|
type: 'MTEXT',
|
|
@@ -1032,14 +1222,12 @@ export class LibreEntityConverter {
|
|
|
1032
1222
|
}
|
|
1033
1223
|
convertPoint(entity, commonAttrs) {
|
|
1034
1224
|
const libredwg = this.libredwg;
|
|
1035
|
-
const x = libredwg.
|
|
1036
|
-
const y = libredwg.
|
|
1037
|
-
const z = libredwg.
|
|
1038
|
-
const thickness = libredwg.
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
const angle = libredwg.dwg_dynapi_entity_value(entity, 'x_ang')
|
|
1042
|
-
.data;
|
|
1225
|
+
const x = libredwg.dwg_dynapi_entity_data(entity, 'x');
|
|
1226
|
+
const y = libredwg.dwg_dynapi_entity_data(entity, 'y');
|
|
1227
|
+
const z = libredwg.dwg_dynapi_entity_data(entity, 'z');
|
|
1228
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
1229
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1230
|
+
const angle = libredwg.dwg_dynapi_entity_data(entity, 'x_ang');
|
|
1043
1231
|
return {
|
|
1044
1232
|
type: 'POINT',
|
|
1045
1233
|
...commonAttrs,
|
|
@@ -1051,18 +1239,13 @@ export class LibreEntityConverter {
|
|
|
1051
1239
|
}
|
|
1052
1240
|
convertPolyline2d(entity, commonAttrs, object) {
|
|
1053
1241
|
const libredwg = this.libredwg;
|
|
1054
|
-
const flag = libredwg.
|
|
1055
|
-
const smoothType = libredwg.
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
const elevation = libredwg.dwg_dynapi_entity_value(entity, 'elevation')
|
|
1062
|
-
.data;
|
|
1063
|
-
const thickness = libredwg.dwg_dynapi_entity_value(entity, 'thickness')
|
|
1064
|
-
.data;
|
|
1065
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
1242
|
+
const flag = libredwg.dwg_dynapi_entity_data(entity, 'flag');
|
|
1243
|
+
const smoothType = libredwg.dwg_dynapi_entity_data(entity, 'curve_type');
|
|
1244
|
+
const startWidth = libredwg.dwg_dynapi_entity_data(entity, 'start_width');
|
|
1245
|
+
const endWidth = libredwg.dwg_dynapi_entity_data(entity, 'end_width');
|
|
1246
|
+
const elevation = libredwg.dwg_dynapi_entity_data(entity, 'elevation');
|
|
1247
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
1248
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1066
1249
|
const vertices = libredwg.dwg_entity_polyline_2d_get_vertices(object);
|
|
1067
1250
|
return {
|
|
1068
1251
|
type: 'POLYLINE2D',
|
|
@@ -1094,14 +1277,11 @@ export class LibreEntityConverter {
|
|
|
1094
1277
|
}
|
|
1095
1278
|
convertPolyline3d(entity, commonAttrs, object) {
|
|
1096
1279
|
const libredwg = this.libredwg;
|
|
1097
|
-
const flag = libredwg.
|
|
1098
|
-
const smoothType = libredwg.
|
|
1099
|
-
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1102
|
-
const endWidth = libredwg.dwg_dynapi_entity_value(entity, 'end_width')
|
|
1103
|
-
.data;
|
|
1104
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
1280
|
+
const flag = libredwg.dwg_dynapi_entity_data(entity, 'flag');
|
|
1281
|
+
const smoothType = libredwg.dwg_dynapi_entity_data(entity, 'curve_type');
|
|
1282
|
+
const startWidth = libredwg.dwg_dynapi_entity_data(entity, 'start_width');
|
|
1283
|
+
const endWidth = libredwg.dwg_dynapi_entity_data(entity, 'end_width');
|
|
1284
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1105
1285
|
const vertices = libredwg.dwg_entity_polyline_3d_get_vertices(object);
|
|
1106
1286
|
return {
|
|
1107
1287
|
type: 'POLYLINE3D',
|
|
@@ -1123,14 +1303,12 @@ export class LibreEntityConverter {
|
|
|
1123
1303
|
}
|
|
1124
1304
|
convertProxyEntity(entity, commonAttrs, objectPtr) {
|
|
1125
1305
|
const libredwg = this.libredwg;
|
|
1126
|
-
const proxyEntityClassId = libredwg.
|
|
1127
|
-
const applicationEntityClassId = libredwg.
|
|
1128
|
-
const entityDataSize = libredwg.
|
|
1129
|
-
const objectDrawingFormat = libredwg.
|
|
1130
|
-
const fromDxf = libredwg.
|
|
1131
|
-
|
|
1132
|
-
const numObjIds = libredwg.dwg_dynapi_entity_value(entity, 'num_objids')
|
|
1133
|
-
.data;
|
|
1306
|
+
const proxyEntityClassId = libredwg.dwg_dynapi_entity_data(entity, 'proxy_id');
|
|
1307
|
+
const applicationEntityClassId = libredwg.dwg_dynapi_entity_data(entity, 'class_id');
|
|
1308
|
+
const entityDataSize = libredwg.dwg_dynapi_entity_data(entity, 'data_numbits');
|
|
1309
|
+
const objectDrawingFormat = libredwg.dwg_dynapi_entity_data(entity, 'version');
|
|
1310
|
+
const fromDxf = libredwg.dwg_dynapi_entity_data(entity, 'from_dxf');
|
|
1311
|
+
const numObjIds = libredwg.dwg_dynapi_entity_data(entity, 'num_objids');
|
|
1134
1312
|
const graphicsBytes = libredwg.dwg_entity_get_preview(objectPtr);
|
|
1135
1313
|
const graphicsDataSize = graphicsBytes?.length ?? 0;
|
|
1136
1314
|
const entityBytes = libredwg.dwg_entity_proxy_entity_get_entity_data(entity);
|
|
@@ -1142,8 +1320,7 @@ export class LibreEntityConverter {
|
|
|
1142
1320
|
: undefined;
|
|
1143
1321
|
let linkedObjectIds;
|
|
1144
1322
|
if (numObjIds > 0) {
|
|
1145
|
-
const objidsPtr = libredwg.
|
|
1146
|
-
.data;
|
|
1323
|
+
const objidsPtr = libredwg.dwg_dynapi_entity_data(entity, 'objids');
|
|
1147
1324
|
if (objidsPtr) {
|
|
1148
1325
|
const objids = libredwg.dwg_ptr_to_object_ref_array(objidsPtr, numObjIds);
|
|
1149
1326
|
linkedObjectIds = objids.map(ref => idToString(ref.absolute_ref));
|
|
@@ -1196,10 +1373,8 @@ export class LibreEntityConverter {
|
|
|
1196
1373
|
}
|
|
1197
1374
|
convertRay(entity, commonAttrs) {
|
|
1198
1375
|
const libredwg = this.libredwg;
|
|
1199
|
-
const firstPoint = libredwg.
|
|
1200
|
-
|
|
1201
|
-
const unitDirection = libredwg.dwg_dynapi_entity_value(entity, 'vector')
|
|
1202
|
-
.data;
|
|
1376
|
+
const firstPoint = libredwg.dwg_dynapi_entity_data(entity, 'point');
|
|
1377
|
+
const unitDirection = libredwg.dwg_dynapi_entity_data(entity, 'vector');
|
|
1203
1378
|
return {
|
|
1204
1379
|
type: 'RAY',
|
|
1205
1380
|
...commonAttrs,
|
|
@@ -1209,30 +1384,26 @@ export class LibreEntityConverter {
|
|
|
1209
1384
|
}
|
|
1210
1385
|
convertSection(entity, commonAttrs) {
|
|
1211
1386
|
const libredwg = this.libredwg;
|
|
1212
|
-
const state = libredwg.
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
const
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
const
|
|
1221
|
-
const
|
|
1222
|
-
const indicatorColor = libredwg.dwg_dynapi_entity_value(entity, 'indicator_color').data;
|
|
1223
|
-
const numberOfVertices = libredwg.dwg_dynapi_entity_value(entity, 'num_verts').data;
|
|
1224
|
-
const vertices_ptr = libredwg.dwg_dynapi_entity_value(entity, 'verts')
|
|
1225
|
-
.data;
|
|
1387
|
+
const state = libredwg.dwg_dynapi_entity_data(entity, 'state');
|
|
1388
|
+
const flags = libredwg.dwg_dynapi_entity_data(entity, 'flag');
|
|
1389
|
+
const name = libredwg.dwg_dynapi_entity_data(entity, 'name');
|
|
1390
|
+
const verticalDirection = libredwg.dwg_dynapi_entity_data(entity, 'vert_dir');
|
|
1391
|
+
const topHeight = libredwg.dwg_dynapi_entity_data(entity, 'top_height');
|
|
1392
|
+
const bottomHeight = libredwg.dwg_dynapi_entity_data(entity, 'bottom_height');
|
|
1393
|
+
const indicatorTransparency = libredwg.dwg_dynapi_entity_data(entity, 'indicator_alpha');
|
|
1394
|
+
const indicatorColor = libredwg.dwg_dynapi_entity_data(entity, 'indicator_color');
|
|
1395
|
+
const numberOfVertices = libredwg.dwg_dynapi_entity_data(entity, 'num_verts');
|
|
1396
|
+
const vertices_ptr = libredwg.dwg_dynapi_entity_data(entity, 'verts');
|
|
1226
1397
|
const vertices = numberOfVertices > 0
|
|
1227
1398
|
? libredwg.dwg_ptr_to_point3d_array(vertices_ptr, numberOfVertices)
|
|
1228
1399
|
: [];
|
|
1229
|
-
const numberOfBackLineVertices = libredwg.
|
|
1230
|
-
const backLineVertices_ptr = libredwg.
|
|
1400
|
+
const numberOfBackLineVertices = libredwg.dwg_dynapi_entity_data(entity, 'num_blverts');
|
|
1401
|
+
const backLineVertices_ptr = libredwg.dwg_dynapi_entity_data(entity, 'blverts');
|
|
1231
1402
|
const backLineVertices = numberOfBackLineVertices > 0
|
|
1232
1403
|
? libredwg.dwg_ptr_to_point3d_array(backLineVertices_ptr, numberOfBackLineVertices)
|
|
1233
1404
|
: [];
|
|
1234
|
-
const geometrySettingHandle = libredwg.
|
|
1235
|
-
const geometrySettingHardId = libredwg.dwg_ref_get_handle_absolute_ref(geometrySettingHandle);
|
|
1405
|
+
const geometrySettingHandle = libredwg.dwg_dynapi_entity_data(entity, 'geometrySettingHardId');
|
|
1406
|
+
const geometrySettingHardId = libredwg.dwg_ref_get_handle_absolute_ref(geometrySettingHandle) ?? 0n;
|
|
1236
1407
|
return {
|
|
1237
1408
|
type: 'SECTION',
|
|
1238
1409
|
...commonAttrs,
|
|
@@ -1251,19 +1422,40 @@ export class LibreEntityConverter {
|
|
|
1251
1422
|
geometrySettingHardId: geometrySettingHardId
|
|
1252
1423
|
};
|
|
1253
1424
|
}
|
|
1425
|
+
convertShape(entity, commonAttrs) {
|
|
1426
|
+
const libredwg = this.libredwg;
|
|
1427
|
+
const insertionPoint = libredwg.dwg_dynapi_entity_data(entity, 'ins_pt');
|
|
1428
|
+
const size = libredwg.dwg_dynapi_entity_data(entity, 'scale');
|
|
1429
|
+
const rotation = libredwg.dwg_dynapi_entity_data(entity, 'rotation');
|
|
1430
|
+
const xScale = libredwg.dwg_dynapi_entity_data(entity, 'width_factor');
|
|
1431
|
+
const obliqueAngle = libredwg.dwg_dynapi_entity_data(entity, 'oblique_angle');
|
|
1432
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
1433
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1434
|
+
const shapeNumber = libredwg.dwg_dynapi_entity_data(entity, 'style_id');
|
|
1435
|
+
const styleName = libredwg.dwg_entity_text_get_style_name(entity);
|
|
1436
|
+
return {
|
|
1437
|
+
type: 'SHAPE',
|
|
1438
|
+
subclassMarker: 'AcDbShape',
|
|
1439
|
+
...commonAttrs,
|
|
1440
|
+
thickness: thickness,
|
|
1441
|
+
insertionPoint: insertionPoint,
|
|
1442
|
+
size: size,
|
|
1443
|
+
shapeNumber: shapeNumber,
|
|
1444
|
+
styleName: styleName,
|
|
1445
|
+
rotation: rotation,
|
|
1446
|
+
xScale: xScale,
|
|
1447
|
+
obliqueAngle: obliqueAngle,
|
|
1448
|
+
extrusionDirection: extrusionDirection
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1254
1451
|
convertSolid(entity, commonAttrs) {
|
|
1255
1452
|
const libredwg = this.libredwg;
|
|
1256
|
-
const corner1 = libredwg.
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1262
|
-
const corner4 = libredwg.dwg_dynapi_entity_value(entity, 'corner4')
|
|
1263
|
-
.data;
|
|
1264
|
-
const thickness = libredwg.dwg_dynapi_entity_value(entity, 'thickness')
|
|
1265
|
-
.data;
|
|
1266
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
1453
|
+
const corner1 = libredwg.dwg_dynapi_entity_data(entity, 'corner1');
|
|
1454
|
+
const corner2 = libredwg.dwg_dynapi_entity_data(entity, 'corner2');
|
|
1455
|
+
const corner3 = libredwg.dwg_dynapi_entity_data(entity, 'corner3');
|
|
1456
|
+
const corner4 = libredwg.dwg_dynapi_entity_data(entity, 'corner4');
|
|
1457
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
1458
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1267
1459
|
return {
|
|
1268
1460
|
type: 'SOLID',
|
|
1269
1461
|
...commonAttrs,
|
|
@@ -1277,37 +1469,26 @@ export class LibreEntityConverter {
|
|
|
1277
1469
|
}
|
|
1278
1470
|
convertSpline(entity, commonAttrs) {
|
|
1279
1471
|
const libredwg = this.libredwg;
|
|
1280
|
-
const flag = libredwg.
|
|
1281
|
-
|
|
1282
|
-
const degree = libredwg.dwg_dynapi_entity_value(entity, 'degree')
|
|
1283
|
-
.data;
|
|
1472
|
+
const flag = libredwg.dwg_dynapi_entity_data(entity, 'splineflags');
|
|
1473
|
+
const degree = libredwg.dwg_dynapi_entity_data(entity, 'degree');
|
|
1284
1474
|
// Convert knots
|
|
1285
|
-
const knotTolerance = libredwg.
|
|
1286
|
-
|
|
1287
|
-
const
|
|
1288
|
-
.data;
|
|
1289
|
-
const knots_ptr = libredwg.dwg_dynapi_entity_value(entity, 'knots')
|
|
1290
|
-
.data;
|
|
1475
|
+
const knotTolerance = libredwg.dwg_dynapi_entity_data(entity, 'knot_tol');
|
|
1476
|
+
const numberOfKnots = libredwg.dwg_dynapi_entity_data(entity, 'num_knots');
|
|
1477
|
+
const knots_ptr = libredwg.dwg_dynapi_entity_data(entity, 'knots');
|
|
1291
1478
|
const knots = libredwg.dwg_ptr_to_double_array(knots_ptr, numberOfKnots);
|
|
1292
1479
|
// Convert fit points
|
|
1293
|
-
const fitTolerance = libredwg.
|
|
1294
|
-
|
|
1295
|
-
const
|
|
1296
|
-
const fit_pts_ptr = libredwg.dwg_dynapi_entity_value(entity, 'fit_pts')
|
|
1297
|
-
.data;
|
|
1480
|
+
const fitTolerance = libredwg.dwg_dynapi_entity_data(entity, 'fit_tol');
|
|
1481
|
+
const numberOfFitPoints = libredwg.dwg_dynapi_entity_data(entity, 'num_fit_pts');
|
|
1482
|
+
const fit_pts_ptr = libredwg.dwg_dynapi_entity_data(entity, 'fit_pts');
|
|
1298
1483
|
const fitPoints = libredwg.dwg_ptr_to_point3d_array(fit_pts_ptr, numberOfFitPoints);
|
|
1299
1484
|
// Convert control points
|
|
1300
|
-
const weighted = libredwg.
|
|
1301
|
-
|
|
1302
|
-
const
|
|
1303
|
-
const
|
|
1304
|
-
const ctrl_pts_ptr = libredwg.dwg_dynapi_entity_value(entity, 'ctrl_pts')
|
|
1305
|
-
.data;
|
|
1485
|
+
const weighted = libredwg.dwg_dynapi_entity_data(entity, 'weighted');
|
|
1486
|
+
const controlTolerance = libredwg.dwg_dynapi_entity_data(entity, 'ctrl_tol');
|
|
1487
|
+
const numberOfControlPoints = libredwg.dwg_dynapi_entity_data(entity, 'num_ctrl_pts');
|
|
1488
|
+
const ctrl_pts_ptr = libredwg.dwg_dynapi_entity_data(entity, 'ctrl_pts');
|
|
1306
1489
|
const controlPoints = libredwg.dwg_ptr_to_point4d_array(ctrl_pts_ptr, numberOfControlPoints);
|
|
1307
|
-
const startTangent = libredwg.
|
|
1308
|
-
|
|
1309
|
-
const endTangent = libredwg.dwg_dynapi_entity_value(entity, 'end_tan_vec')
|
|
1310
|
-
.data;
|
|
1490
|
+
const startTangent = libredwg.dwg_dynapi_entity_data(entity, 'beg_tan_vec');
|
|
1491
|
+
const endTangent = libredwg.dwg_dynapi_entity_data(entity, 'end_tan_vec');
|
|
1311
1492
|
return {
|
|
1312
1493
|
type: 'SPLINE',
|
|
1313
1494
|
...commonAttrs,
|
|
@@ -1336,32 +1517,26 @@ export class LibreEntityConverter {
|
|
|
1336
1517
|
}
|
|
1337
1518
|
convertTable(entity, commonAttrs) {
|
|
1338
1519
|
const libredwg = this.libredwg;
|
|
1339
|
-
const name = libredwg.
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1343
|
-
const
|
|
1344
|
-
const
|
|
1345
|
-
const
|
|
1346
|
-
.data;
|
|
1347
|
-
const columnCount = libredwg.dwg_dynapi_entity_value(entity, 'num_cols')
|
|
1348
|
-
.data;
|
|
1349
|
-
const row_heights_ptr = libredwg.dwg_dynapi_entity_value(entity, 'row_heights').data;
|
|
1520
|
+
const name = libredwg.dwg_dynapi_subclass_data(entity, 'ldata', 'name');
|
|
1521
|
+
const startPoint = libredwg.dwg_dynapi_entity_data(entity, 'ins_pt');
|
|
1522
|
+
const directionVector = libredwg.dwg_dynapi_entity_data(entity, 'horiz_direction');
|
|
1523
|
+
const tableValue = libredwg.dwg_dynapi_entity_data(entity, 'flag_for_table_value');
|
|
1524
|
+
const rowCount = libredwg.dwg_dynapi_entity_data(entity, 'num_rows');
|
|
1525
|
+
const columnCount = libredwg.dwg_dynapi_entity_data(entity, 'num_cols');
|
|
1526
|
+
const row_heights_ptr = libredwg.dwg_dynapi_entity_data(entity, 'row_heights');
|
|
1350
1527
|
const rowHeightArr = libredwg.dwg_ptr_to_double_array(row_heights_ptr, rowCount);
|
|
1351
|
-
const col_widths_ptr = libredwg.
|
|
1528
|
+
const col_widths_ptr = libredwg.dwg_dynapi_entity_data(entity, 'col_widths');
|
|
1352
1529
|
const columnWidthArr = libredwg.dwg_ptr_to_double_array(col_widths_ptr, columnCount);
|
|
1353
|
-
const table_style_ref = libredwg.
|
|
1354
|
-
const tableStyleId =
|
|
1355
|
-
const block_header_ref = libredwg.
|
|
1356
|
-
const blockRecordHandle =
|
|
1357
|
-
const overrideFlag = libredwg.
|
|
1358
|
-
const borderColorOverrideFlag = libredwg.
|
|
1359
|
-
const borderLineWeightOverrideFlag = libredwg.
|
|
1360
|
-
const borderVisibilityOverrideFlag = libredwg.
|
|
1361
|
-
const num_cells = libredwg.
|
|
1362
|
-
|
|
1363
|
-
const cells_ptr = libredwg.dwg_dynapi_entity_value(entity, 'cells')
|
|
1364
|
-
.data;
|
|
1530
|
+
const table_style_ref = libredwg.dwg_dynapi_entity_data(entity, 'tablestyle');
|
|
1531
|
+
const tableStyleId = (libredwg.dwg_ref_get_id(table_style_ref) ?? '');
|
|
1532
|
+
const block_header_ref = libredwg.dwg_dynapi_entity_data(entity, 'block_header');
|
|
1533
|
+
const blockRecordHandle = (libredwg.dwg_ref_get_id(block_header_ref) ?? '');
|
|
1534
|
+
const overrideFlag = libredwg.dwg_dynapi_entity_data(entity, 'table_flag_override');
|
|
1535
|
+
const borderColorOverrideFlag = libredwg.dwg_dynapi_entity_data(entity, 'border_color_overrides_flag');
|
|
1536
|
+
const borderLineWeightOverrideFlag = libredwg.dwg_dynapi_entity_data(entity, 'border_lineweight_overrides_flag');
|
|
1537
|
+
const borderVisibilityOverrideFlag = libredwg.dwg_dynapi_entity_data(entity, 'border_visibility_overrides_flag');
|
|
1538
|
+
const num_cells = libredwg.dwg_dynapi_entity_data(entity, 'num_cells');
|
|
1539
|
+
const cells_ptr = libredwg.dwg_dynapi_entity_data(entity, 'cells');
|
|
1365
1540
|
const cells = libredwg.dwg_ptr_to_table_cell_array(cells_ptr, num_cells);
|
|
1366
1541
|
return {
|
|
1367
1542
|
type: 'ACAD_TABLE',
|
|
@@ -1386,61 +1561,48 @@ export class LibreEntityConverter {
|
|
|
1386
1561
|
};
|
|
1387
1562
|
}
|
|
1388
1563
|
convertTableCells(cells) {
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
extendedCellFlags: cell.additional_data_flag
|
|
1416
|
-
};
|
|
1417
|
-
});
|
|
1418
|
-
return converted;
|
|
1564
|
+
return cells.map(cell => ({
|
|
1565
|
+
text: cell.text_value,
|
|
1566
|
+
attachmentPoint: cell.cell_alignment,
|
|
1567
|
+
textStyle: cell.text_style
|
|
1568
|
+
? String(cell.text_style)
|
|
1569
|
+
: undefined,
|
|
1570
|
+
rotation: cell.rotation,
|
|
1571
|
+
cellType: cell.type,
|
|
1572
|
+
flagValue: cell.flags,
|
|
1573
|
+
mergedValue: cell.is_merged_value,
|
|
1574
|
+
autoFit: cell.is_autofit_flag,
|
|
1575
|
+
topBorderVisibility: !!cell.top_visibility,
|
|
1576
|
+
bottomBorderVisibility: !!cell.bottom_visibility,
|
|
1577
|
+
leftBorderVisibility: !!cell.left_visibility,
|
|
1578
|
+
rightBorderVisibility: !!cell.right_visibility,
|
|
1579
|
+
overrideFlag: cell.cell_flag_override,
|
|
1580
|
+
virtualEdgeFlag: cell.virtual_edge_flag,
|
|
1581
|
+
blockTableRecordId: cell.block_handle
|
|
1582
|
+
? String(cell.block_handle.absolute_ref ?? '')
|
|
1583
|
+
: undefined,
|
|
1584
|
+
blockScale: cell.block_scale,
|
|
1585
|
+
blockAttrNum: cell.attr_defs?.length ?? 0,
|
|
1586
|
+
attrDefineId: cell.attr_defs?.map(value => String(value.attdef?.absolute_ref ?? '')),
|
|
1587
|
+
textHeight: cell.text_height ?? 0,
|
|
1588
|
+
extendedCellFlags: cell.additional_data_flag
|
|
1589
|
+
}));
|
|
1419
1590
|
}
|
|
1420
1591
|
convertTextBase(entity) {
|
|
1421
1592
|
const libredwg = this.libredwg;
|
|
1422
|
-
const text = libredwg.
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1430
|
-
const rotation = libredwg.dwg_dynapi_entity_value(entity, 'rotation')
|
|
1431
|
-
.data;
|
|
1432
|
-
const textHeight = libredwg.dwg_dynapi_entity_value(entity, 'height')
|
|
1433
|
-
.data;
|
|
1434
|
-
const xScale = libredwg.dwg_dynapi_entity_value(entity, 'width_factor')
|
|
1435
|
-
.data;
|
|
1436
|
-
const obliqueAngle = libredwg.dwg_dynapi_entity_value(entity, 'oblique_angle').data;
|
|
1593
|
+
const text = libredwg.dwg_dynapi_entity_data(entity, 'text_value');
|
|
1594
|
+
const thickness = libredwg.dwg_dynapi_entity_data(entity, 'thickness');
|
|
1595
|
+
const startPoint = libredwg.dwg_dynapi_entity_data(entity, 'ins_pt');
|
|
1596
|
+
const endPoint = libredwg.dwg_dynapi_entity_data(entity, 'alignment_pt');
|
|
1597
|
+
const rotation = libredwg.dwg_dynapi_entity_data(entity, 'rotation');
|
|
1598
|
+
const textHeight = libredwg.dwg_dynapi_entity_data(entity, 'height');
|
|
1599
|
+
const xScale = libredwg.dwg_dynapi_entity_data(entity, 'width_factor');
|
|
1600
|
+
const obliqueAngle = libredwg.dwg_dynapi_entity_data(entity, 'oblique_angle');
|
|
1437
1601
|
const styleName = libredwg.dwg_entity_text_get_style_name(entity);
|
|
1438
|
-
const generationFlag = libredwg.
|
|
1439
|
-
const halign = libredwg.
|
|
1440
|
-
|
|
1441
|
-
const
|
|
1442
|
-
.data;
|
|
1443
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
1602
|
+
const generationFlag = libredwg.dwg_dynapi_entity_data(entity, 'generation');
|
|
1603
|
+
const halign = libredwg.dwg_dynapi_entity_data(entity, 'horiz_alignment');
|
|
1604
|
+
const valign = libredwg.dwg_dynapi_entity_data(entity, 'vert_alignment');
|
|
1605
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1444
1606
|
return {
|
|
1445
1607
|
text: text,
|
|
1446
1608
|
thickness: thickness,
|
|
@@ -1466,12 +1628,10 @@ export class LibreEntityConverter {
|
|
|
1466
1628
|
}
|
|
1467
1629
|
convertTolerance(entity, commonAttrs) {
|
|
1468
1630
|
const libredwg = this.libredwg;
|
|
1469
|
-
const insertionPoint = libredwg.
|
|
1470
|
-
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
const xAxisDirection = libredwg.dwg_dynapi_entity_value(entity, 'x_direction').data;
|
|
1474
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
1631
|
+
const insertionPoint = libredwg.dwg_dynapi_entity_data(entity, 'ins_pt');
|
|
1632
|
+
const text = libredwg.dwg_dynapi_entity_data(entity, 'text_value');
|
|
1633
|
+
const xAxisDirection = libredwg.dwg_dynapi_entity_data(entity, 'x_direction');
|
|
1634
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1475
1635
|
const dimStyleName = libredwg.dwg_entity_get_dimstyle_name(entity);
|
|
1476
1636
|
return {
|
|
1477
1637
|
type: 'TOLERANCE',
|
|
@@ -1485,82 +1645,55 @@ export class LibreEntityConverter {
|
|
|
1485
1645
|
}
|
|
1486
1646
|
convertViewport(entity, commonAttrs) {
|
|
1487
1647
|
const libredwg = this.libredwg;
|
|
1488
|
-
const viewportCenter = libredwg.
|
|
1489
|
-
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1500
|
-
const
|
|
1501
|
-
.data;
|
|
1502
|
-
const gridSpacing = libredwg.dwg_dynapi_entity_value(entity, 'GRIDUNIT')
|
|
1503
|
-
.data;
|
|
1504
|
-
const viewDirection = libredwg.dwg_dynapi_entity_value(entity, 'VIEWDIR')
|
|
1505
|
-
.data;
|
|
1506
|
-
const targetPoint = libredwg.dwg_dynapi_entity_value(entity, 'view_target')
|
|
1507
|
-
.data;
|
|
1508
|
-
const perspectiveLensLength = libredwg.dwg_dynapi_entity_value(entity, 'lens_length').data;
|
|
1509
|
-
const frontClipZ = libredwg.dwg_dynapi_entity_value(entity, 'front_clip_z')
|
|
1510
|
-
.data;
|
|
1511
|
-
const backClipZ = libredwg.dwg_dynapi_entity_value(entity, 'back_clip_z')
|
|
1512
|
-
.data;
|
|
1648
|
+
const viewportCenter = libredwg.dwg_dynapi_entity_data(entity, 'center');
|
|
1649
|
+
const width = libredwg.dwg_dynapi_entity_data(entity, 'width');
|
|
1650
|
+
const height = libredwg.dwg_dynapi_entity_data(entity, 'height');
|
|
1651
|
+
const status = libredwg.dwg_dynapi_entity_data(entity, 'on_off');
|
|
1652
|
+
const displayCenter = libredwg.dwg_dynapi_entity_data(entity, 'VIEWCTR');
|
|
1653
|
+
const snapBase = libredwg.dwg_dynapi_entity_data(entity, 'SNAPBASE');
|
|
1654
|
+
const snapSpacing = libredwg.dwg_dynapi_entity_data(entity, 'SNAPUNIT');
|
|
1655
|
+
const gridSpacing = libredwg.dwg_dynapi_entity_data(entity, 'GRIDUNIT');
|
|
1656
|
+
const viewDirection = libredwg.dwg_dynapi_entity_data(entity, 'VIEWDIR');
|
|
1657
|
+
const targetPoint = libredwg.dwg_dynapi_entity_data(entity, 'view_target');
|
|
1658
|
+
const perspectiveLensLength = libredwg.dwg_dynapi_entity_data(entity, 'lens_length');
|
|
1659
|
+
const frontClipZ = libredwg.dwg_dynapi_entity_data(entity, 'front_clip_z');
|
|
1660
|
+
const backClipZ = libredwg.dwg_dynapi_entity_data(entity, 'back_clip_z');
|
|
1513
1661
|
// TODO: I am not sure whether view size in libredwg represents view height
|
|
1514
|
-
const viewHeight = libredwg.
|
|
1515
|
-
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
const viewTwistAngle = libredwg.dwg_dynapi_entity_value(entity, 'twist_angle').data;
|
|
1519
|
-
const circleZoomPercent = libredwg.dwg_dynapi_entity_value(entity, 'circle_zoom').data;
|
|
1662
|
+
const viewHeight = libredwg.dwg_dynapi_entity_data(entity, 'VIEWSIZE');
|
|
1663
|
+
const snapAngle = libredwg.dwg_dynapi_entity_data(entity, 'SNAPANG');
|
|
1664
|
+
const viewTwistAngle = libredwg.dwg_dynapi_entity_data(entity, 'twist_angle');
|
|
1665
|
+
const circleZoomPercent = libredwg.dwg_dynapi_entity_data(entity, 'circle_zoom');
|
|
1520
1666
|
// TODO: convert frozenLayerIds and clippingBoundaryId
|
|
1521
|
-
const statusBitFlags = libredwg.
|
|
1522
|
-
const sheetName = libredwg.
|
|
1523
|
-
|
|
1524
|
-
const renderMode = libredwg.dwg_dynapi_entity_value(entity, 'render_mode')
|
|
1525
|
-
.data;
|
|
1667
|
+
const statusBitFlags = libredwg.dwg_dynapi_entity_data(entity, 'status_flag');
|
|
1668
|
+
const sheetName = libredwg.dwg_dynapi_entity_data(entity, 'style_sheet');
|
|
1669
|
+
const renderMode = libredwg.dwg_dynapi_entity_data(entity, 'render_mode');
|
|
1526
1670
|
// TODO: Not sure whether UCSVP in libredwg represents ucsPerViewport
|
|
1527
|
-
const ucsPerViewport = libredwg.
|
|
1528
|
-
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
const named_ucs_ref = libredwg.dwg_dynapi_entity_value(entity, 'named_ucs')
|
|
1536
|
-
.data;
|
|
1537
|
-
const ucsId = libredwg.dwg_ref_get_absref(named_ucs_ref);
|
|
1538
|
-
const base_ucs_ref = libredwg.dwg_dynapi_entity_value(entity, 'base_ucs')
|
|
1539
|
-
.data;
|
|
1540
|
-
const ucsBaseId = libredwg.dwg_ref_get_absref(base_ucs_ref);
|
|
1671
|
+
const ucsPerViewport = libredwg.dwg_dynapi_entity_data(entity, 'UCSVP');
|
|
1672
|
+
const ucsOrigin = libredwg.dwg_dynapi_entity_data(entity, 'ucsorg');
|
|
1673
|
+
const ucsXAxis = libredwg.dwg_dynapi_entity_data(entity, 'ucsxdir');
|
|
1674
|
+
const ucsYAxis = libredwg.dwg_dynapi_entity_data(entity, 'ucsydir');
|
|
1675
|
+
const named_ucs_ref = libredwg.dwg_dynapi_entity_data(entity, 'named_ucs');
|
|
1676
|
+
const ucsId = libredwg.dwg_ref_get_id(named_ucs_ref);
|
|
1677
|
+
const base_ucs_ref = libredwg.dwg_dynapi_entity_data(entity, 'base_ucs');
|
|
1678
|
+
const ucsBaseId = libredwg.dwg_ref_get_id(base_ucs_ref);
|
|
1541
1679
|
// TODO: Not sure whether UCSORTHOVIEW represents orthographicType
|
|
1542
|
-
const orthographicType = libredwg.
|
|
1543
|
-
const elevation = libredwg.
|
|
1544
|
-
|
|
1545
|
-
const
|
|
1546
|
-
const
|
|
1547
|
-
const
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1552
|
-
const
|
|
1553
|
-
const
|
|
1554
|
-
const
|
|
1555
|
-
const
|
|
1556
|
-
.data;
|
|
1557
|
-
const shadePlotId = libredwg.dwg_ref_get_absref(shadeplot_ref);
|
|
1558
|
-
const visualstyle_ref = libredwg.dwg_dynapi_entity_value(entity, 'visualstyle').data;
|
|
1559
|
-
const visualStyleId = libredwg.dwg_ref_get_absref(visualstyle_ref);
|
|
1680
|
+
const orthographicType = libredwg.dwg_dynapi_entity_data(entity, 'UCSORTHOVIEW');
|
|
1681
|
+
const elevation = libredwg.dwg_dynapi_entity_data(entity, 'ucs_elevation');
|
|
1682
|
+
const shadePlotMode = libredwg.dwg_dynapi_entity_data(entity, 'shadeplot_mode');
|
|
1683
|
+
const isDefaultLighting = libredwg.dwg_dynapi_entity_data(entity, 'use_default_lights');
|
|
1684
|
+
const defaultLightingType = libredwg.dwg_dynapi_entity_data(entity, 'default_lighting_type');
|
|
1685
|
+
const brightness = libredwg.dwg_dynapi_entity_data(entity, 'brightness');
|
|
1686
|
+
const contrast = libredwg.dwg_dynapi_entity_data(entity, 'contrast');
|
|
1687
|
+
const majorGridFrequency = libredwg.dwg_dynapi_entity_data(entity, 'grid_major');
|
|
1688
|
+
const background_ref = libredwg.dwg_dynapi_entity_data(entity, 'background');
|
|
1689
|
+
const backgroundId = libredwg.dwg_ref_get_id(background_ref);
|
|
1690
|
+
const shadeplot_ref = libredwg.dwg_dynapi_entity_data(entity, 'shadeplot');
|
|
1691
|
+
const shadePlotId = libredwg.dwg_ref_get_id(shadeplot_ref);
|
|
1692
|
+
const visualstyle_ref = libredwg.dwg_dynapi_entity_data(entity, 'visualstyle');
|
|
1693
|
+
const visualStyleId = libredwg.dwg_ref_get_id(visualstyle_ref);
|
|
1560
1694
|
// TODO: convert ambientLightColor
|
|
1561
|
-
const sun_ref = libredwg.
|
|
1562
|
-
|
|
1563
|
-
const sunId = libredwg.dwg_ref_get_absref(sun_ref);
|
|
1695
|
+
const sun_ref = libredwg.dwg_dynapi_entity_data(entity, 'sun');
|
|
1696
|
+
const sunId = libredwg.dwg_ref_get_id(sun_ref);
|
|
1564
1697
|
return {
|
|
1565
1698
|
type: 'VIEWPORT',
|
|
1566
1699
|
...commonAttrs,
|
|
@@ -1589,55 +1722,43 @@ export class LibreEntityConverter {
|
|
|
1589
1722
|
ucsOrigin: ucsOrigin,
|
|
1590
1723
|
ucsXAxis: ucsXAxis,
|
|
1591
1724
|
ucsYAxis: ucsYAxis,
|
|
1592
|
-
ucsId:
|
|
1593
|
-
ucsBaseId:
|
|
1725
|
+
ucsId: ucsId ?? '',
|
|
1726
|
+
ucsBaseId: ucsBaseId ?? '',
|
|
1594
1727
|
orthographicType: orthographicType,
|
|
1595
1728
|
elevation: elevation,
|
|
1596
1729
|
shadePlotMode: shadePlotMode,
|
|
1597
1730
|
majorGridFrequency: majorGridFrequency,
|
|
1598
|
-
backgroundId:
|
|
1599
|
-
shadePlotId:
|
|
1600
|
-
visualStyleId:
|
|
1731
|
+
backgroundId: backgroundId ?? '',
|
|
1732
|
+
shadePlotId: shadePlotId ?? '',
|
|
1733
|
+
visualStyleId: visualStyleId ?? '',
|
|
1601
1734
|
isDefaultLighting: !!isDefaultLighting,
|
|
1602
1735
|
defaultLightingType: defaultLightingType,
|
|
1603
1736
|
brightness: brightness,
|
|
1604
1737
|
contrast: contrast,
|
|
1605
|
-
sunId:
|
|
1738
|
+
sunId: sunId ?? ''
|
|
1606
1739
|
};
|
|
1607
1740
|
}
|
|
1608
1741
|
convertWipeout(entity, commonAttrs) {
|
|
1609
1742
|
const libredwg = this.libredwg;
|
|
1610
|
-
const version = libredwg.
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1624
|
-
const brightness = libredwg.dwg_dynapi_entity_value(entity, 'brightness')
|
|
1625
|
-
.data;
|
|
1626
|
-
const contrast = libredwg.dwg_dynapi_entity_value(entity, 'contrast')
|
|
1627
|
-
.data;
|
|
1628
|
-
const fade = libredwg.dwg_dynapi_entity_value(entity, 'fade').data;
|
|
1629
|
-
const clipMode = libredwg.dwg_dynapi_entity_value(entity, 'clip_mode')
|
|
1630
|
-
.data;
|
|
1631
|
-
const clippingBoundaryType = libredwg.dwg_dynapi_entity_value(entity, 'clip_boundary_type').data;
|
|
1632
|
-
const countBoundaryPoints = libredwg.dwg_dynapi_entity_value(entity, 'num_clip_verts').data;
|
|
1633
|
-
const clip_verts = libredwg.dwg_dynapi_entity_value(entity, 'clip_verts')
|
|
1634
|
-
.data;
|
|
1743
|
+
const version = libredwg.dwg_dynapi_entity_data(entity, 'class_version');
|
|
1744
|
+
const position = libredwg.dwg_dynapi_entity_data(entity, 'pt0');
|
|
1745
|
+
const uPixel = libredwg.dwg_dynapi_entity_data(entity, 'uvec');
|
|
1746
|
+
const vPixel = libredwg.dwg_dynapi_entity_data(entity, 'vvec');
|
|
1747
|
+
const imageSize = libredwg.dwg_dynapi_entity_data(entity, 'image_size');
|
|
1748
|
+
const flags = libredwg.dwg_dynapi_entity_data(entity, 'display_props');
|
|
1749
|
+
const clipping = libredwg.dwg_dynapi_entity_data(entity, 'clipping');
|
|
1750
|
+
const brightness = libredwg.dwg_dynapi_entity_data(entity, 'brightness');
|
|
1751
|
+
const contrast = libredwg.dwg_dynapi_entity_data(entity, 'contrast');
|
|
1752
|
+
const fade = libredwg.dwg_dynapi_entity_data(entity, 'fade');
|
|
1753
|
+
const clipMode = libredwg.dwg_dynapi_entity_data(entity, 'clip_mode');
|
|
1754
|
+
const clippingBoundaryType = libredwg.dwg_dynapi_entity_data(entity, 'clip_boundary_type');
|
|
1755
|
+
const countBoundaryPoints = libredwg.dwg_dynapi_entity_data(entity, 'num_clip_verts');
|
|
1756
|
+
const clip_verts = libredwg.dwg_dynapi_entity_data(entity, 'clip_verts');
|
|
1635
1757
|
const clippingBoundaryPath = libredwg.dwg_ptr_to_point2d_array(clip_verts, countBoundaryPoints);
|
|
1636
|
-
const imagedef_ref = libredwg.
|
|
1637
|
-
|
|
1638
|
-
const
|
|
1639
|
-
const
|
|
1640
|
-
const imageDefReactorHandle = libredwg.dwg_ref_get_absref(imagedefreactor_ref);
|
|
1758
|
+
const imagedef_ref = libredwg.dwg_dynapi_entity_data(entity, 'imagedef');
|
|
1759
|
+
const imageDefHandle = libredwg.dwg_ref_get_absref(imagedef_ref) ?? 0;
|
|
1760
|
+
const imagedefreactor_ref = libredwg.dwg_dynapi_entity_data(entity, 'imagedefreactor');
|
|
1761
|
+
const imageDefReactorHandle = libredwg.dwg_ref_get_absref(imagedefreactor_ref) ?? 0;
|
|
1641
1762
|
return {
|
|
1642
1763
|
type: 'WIPEOUT',
|
|
1643
1764
|
...commonAttrs,
|
|
@@ -1661,10 +1782,8 @@ export class LibreEntityConverter {
|
|
|
1661
1782
|
}
|
|
1662
1783
|
convertXline(entity, commonAttrs) {
|
|
1663
1784
|
const libredwg = this.libredwg;
|
|
1664
|
-
const firstPoint = libredwg.
|
|
1665
|
-
|
|
1666
|
-
const unitDirection = libredwg.dwg_dynapi_entity_value(entity, 'vector')
|
|
1667
|
-
.data;
|
|
1785
|
+
const firstPoint = libredwg.dwg_dynapi_entity_data(entity, 'point');
|
|
1786
|
+
const unitDirection = libredwg.dwg_dynapi_entity_data(entity, 'vector');
|
|
1668
1787
|
return {
|
|
1669
1788
|
type: 'XLINE',
|
|
1670
1789
|
...commonAttrs,
|
|
@@ -1674,26 +1793,20 @@ export class LibreEntityConverter {
|
|
|
1674
1793
|
}
|
|
1675
1794
|
getDimensionCommonAttrs(entity) {
|
|
1676
1795
|
const libredwg = this.libredwg;
|
|
1677
|
-
const version = libredwg.
|
|
1678
|
-
.data;
|
|
1796
|
+
const version = libredwg.dwg_dynapi_entity_data(entity, 'class_version');
|
|
1679
1797
|
const name = libredwg.dwg_entity_get_block_name(entity, 'block');
|
|
1680
|
-
const definitionPoint = libredwg.
|
|
1681
|
-
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1684
|
-
const
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1688
|
-
const
|
|
1689
|
-
const measurement = libredwg.dwg_dynapi_entity_value(entity, 'act_measurement').data;
|
|
1690
|
-
const text = libredwg.dwg_dynapi_entity_value(entity, 'user_text')
|
|
1691
|
-
.data;
|
|
1692
|
-
const textRotation = libredwg.dwg_dynapi_entity_value(entity, 'text_rotation').data;
|
|
1798
|
+
const definitionPoint = libredwg.dwg_dynapi_entity_data(entity, 'def_pt');
|
|
1799
|
+
const textPoint = libredwg.dwg_dynapi_entity_data(entity, 'text_midpt');
|
|
1800
|
+
const attachmentPoint = libredwg.dwg_dynapi_entity_data(entity, 'attachmentPoint');
|
|
1801
|
+
const dimensionType = libredwg.dwg_dynapi_entity_data(entity, 'flag');
|
|
1802
|
+
const textLineSpacingStyle = libredwg.dwg_dynapi_entity_data(entity, 'lspace_factor');
|
|
1803
|
+
const textLineSpacingFactor = libredwg.dwg_dynapi_entity_data(entity, 'lspace_factor');
|
|
1804
|
+
const measurement = libredwg.dwg_dynapi_entity_data(entity, 'act_measurement');
|
|
1805
|
+
const text = libredwg.dwg_dynapi_entity_data(entity, 'user_text');
|
|
1806
|
+
const textRotation = libredwg.dwg_dynapi_entity_data(entity, 'text_rotation');
|
|
1693
1807
|
// TODO: Not sure whether 'ins_rotation' is 'ocsRotation'.
|
|
1694
|
-
const ocsRotation = libredwg.
|
|
1695
|
-
|
|
1696
|
-
const extrusionDirection = libredwg.dwg_dynapi_entity_value(entity, 'extrusion').data;
|
|
1808
|
+
const ocsRotation = libredwg.dwg_dynapi_entity_data(entity, 'ins_rotation');
|
|
1809
|
+
const extrusionDirection = libredwg.dwg_dynapi_entity_data(entity, 'extrusion');
|
|
1697
1810
|
const styleName = libredwg.dwg_entity_get_dimstyle_name(entity);
|
|
1698
1811
|
return {
|
|
1699
1812
|
type: 'DIMENSION',
|