@mlightcad/libredwg-converter 3.16.6 → 3.16.8
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-converter.umd.cjs +1 -1
- package/dist/libredwg-parser-worker.js +7 -7
- package/dist/libredwg-web.wasm +0 -0
- package/lib/AcDbEntitiyConverter.d.ts +1 -0
- package/lib/AcDbEntitiyConverter.d.ts.map +1 -1
- package/lib/AcDbEntitiyConverter.js +7 -1
- package/lib/AcDbEntitiyConverter.js.map +1 -1
- package/lib/AcDbLibreDwgConverter.d.ts.map +1 -1
- package/lib/AcDbLibreDwgConverter.js +114 -69
- package/lib/AcDbLibreDwgConverter.js.map +1 -1
- package/package.json +4 -4
|
@@ -521,8 +521,15 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
521
521
|
});
|
|
522
522
|
};
|
|
523
523
|
AcDbLibreDwgConverter.prototype.processBlockTables = function (model, db) {
|
|
524
|
-
var
|
|
524
|
+
var e_2, _a, e_3, _b;
|
|
525
525
|
var btrs = model.tables.BLOCK_RECORD.entries;
|
|
526
|
+
// Pass 1: register every BTR shell (and metadata) before appending entities.
|
|
527
|
+
// Paper-space INSERTs often appear earlier in BLOCK_RECORD order than the
|
|
528
|
+
// symbol blocks they reference (e.g. *Paper_Space before 注解2). Filling
|
|
529
|
+
// layout entities in the same loop used to fire entityAppended while
|
|
530
|
+
// getAt(blockName) was still undefined, so the viewer committed an empty
|
|
531
|
+
// group and never retried.
|
|
532
|
+
var pendingEntities = [];
|
|
526
533
|
btrs.forEach(function (btr) {
|
|
527
534
|
var _a;
|
|
528
535
|
var dbBlock = db.tables.blockTable.getAt(btr.name);
|
|
@@ -548,11 +555,49 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
548
555
|
dbBlock.previewIcon = acdbHexStringsToBytes([btr.bmpPreview]);
|
|
549
556
|
}
|
|
550
557
|
dbBlock.origin.copy(btr.basePoint);
|
|
551
|
-
//
|
|
552
|
-
if (
|
|
553
|
-
|
|
558
|
+
// Model space is filled later by processEntities (chunked + progress).
|
|
559
|
+
if (dbBlock.isModelSapce || !btr.entities || btr.entities.length === 0) {
|
|
560
|
+
return;
|
|
554
561
|
}
|
|
562
|
+
pendingEntities.push({
|
|
563
|
+
entities: btr.entities,
|
|
564
|
+
block: dbBlock,
|
|
565
|
+
isPaperSpace: dbBlock.isPaperSapce
|
|
566
|
+
});
|
|
555
567
|
});
|
|
568
|
+
try {
|
|
569
|
+
// Pass 2a: symbol / anonymous block bodies first so paper INSERTs can
|
|
570
|
+
// resolve nested definitions (and rendering-cache templates stay non-empty).
|
|
571
|
+
for (var pendingEntities_1 = __values(pendingEntities), pendingEntities_1_1 = pendingEntities_1.next(); !pendingEntities_1_1.done; pendingEntities_1_1 = pendingEntities_1.next()) {
|
|
572
|
+
var pending_1 = pendingEntities_1_1.value;
|
|
573
|
+
if (pending_1.isPaperSpace)
|
|
574
|
+
continue;
|
|
575
|
+
this.processEntitiesInBlock(pending_1.entities, pending_1.block);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
579
|
+
finally {
|
|
580
|
+
try {
|
|
581
|
+
if (pendingEntities_1_1 && !pendingEntities_1_1.done && (_a = pendingEntities_1.return)) _a.call(pendingEntities_1);
|
|
582
|
+
}
|
|
583
|
+
finally { if (e_2) throw e_2.error; }
|
|
584
|
+
}
|
|
585
|
+
try {
|
|
586
|
+
// Pass 2b: paper layouts last — entityAppended converts these into the scene.
|
|
587
|
+
for (var pendingEntities_2 = __values(pendingEntities), pendingEntities_2_1 = pendingEntities_2.next(); !pendingEntities_2_1.done; pendingEntities_2_1 = pendingEntities_2.next()) {
|
|
588
|
+
var pending_2 = pendingEntities_2_1.value;
|
|
589
|
+
if (!pending_2.isPaperSpace)
|
|
590
|
+
continue;
|
|
591
|
+
this.processEntitiesInBlock(pending_2.entities, pending_2.block);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
595
|
+
finally {
|
|
596
|
+
try {
|
|
597
|
+
if (pendingEntities_2_1 && !pendingEntities_2_1.done && (_b = pendingEntities_2.return)) _b.call(pendingEntities_2);
|
|
598
|
+
}
|
|
599
|
+
finally { if (e_3) throw e_3.error; }
|
|
600
|
+
}
|
|
556
601
|
};
|
|
557
602
|
AcDbLibreDwgConverter.prototype.processBlocks = function (_model, _db) {
|
|
558
603
|
// Do nothing because entities are already processsed in method processBlockTables
|
|
@@ -794,7 +839,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
794
839
|
* placeholder is created by {@link acdbImportDynBlockMetadata}.
|
|
795
840
|
*/
|
|
796
841
|
AcDbLibreDwgConverter.prototype.processDynBlockMetadata = function (model, db) {
|
|
797
|
-
var
|
|
842
|
+
var e_4, _a;
|
|
798
843
|
var _b, _c;
|
|
799
844
|
var normalize = function (handle) {
|
|
800
845
|
return handle == null || handle === '' || handle === 0
|
|
@@ -815,12 +860,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
815
860
|
}
|
|
816
861
|
}
|
|
817
862
|
}
|
|
818
|
-
catch (
|
|
863
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
819
864
|
finally {
|
|
820
865
|
try {
|
|
821
866
|
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
822
867
|
}
|
|
823
|
-
finally { if (
|
|
868
|
+
finally { if (e_4) throw e_4.error; }
|
|
824
869
|
}
|
|
825
870
|
var dictObjects = model.objects.DICTIONARY;
|
|
826
871
|
if (!(dictObjects === null || dictObjects === void 0 ? void 0 : dictObjects.length))
|
|
@@ -907,7 +952,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
907
952
|
var layoutDict = db.objects.layout;
|
|
908
953
|
var layouts = model.objects.LAYOUT;
|
|
909
954
|
layouts.forEach(function (layout) {
|
|
910
|
-
var
|
|
955
|
+
var e_5, _a, e_6, _b;
|
|
911
956
|
var dbLayout = new AcDbLayout();
|
|
912
957
|
dbLayout.layoutName = layout.layoutName;
|
|
913
958
|
dbLayout.tabOrder = layout.tabOrder;
|
|
@@ -933,12 +978,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
933
978
|
}
|
|
934
979
|
}
|
|
935
980
|
}
|
|
936
|
-
catch (
|
|
981
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
937
982
|
finally {
|
|
938
983
|
try {
|
|
939
984
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
940
985
|
}
|
|
941
|
-
finally { if (
|
|
986
|
+
finally { if (e_5) throw e_5.error; }
|
|
942
987
|
}
|
|
943
988
|
if (!dbLayout.blockTableRecordId && layout.paperSpaceTableId) {
|
|
944
989
|
var btr = db.tables.blockTable.getIdAt(String(layout.paperSpaceTableId));
|
|
@@ -960,12 +1005,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
960
1005
|
break;
|
|
961
1006
|
}
|
|
962
1007
|
}
|
|
963
|
-
catch (
|
|
1008
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
964
1009
|
finally {
|
|
965
1010
|
try {
|
|
966
1011
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
967
1012
|
}
|
|
968
|
-
finally { if (
|
|
1013
|
+
finally { if (e_6) throw e_6.error; }
|
|
969
1014
|
}
|
|
970
1015
|
}
|
|
971
1016
|
}
|
|
@@ -1025,7 +1070,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1025
1070
|
});
|
|
1026
1071
|
};
|
|
1027
1072
|
AcDbLibreDwgConverter.prototype.processScales = function (model, db) {
|
|
1028
|
-
var
|
|
1073
|
+
var e_7, _a;
|
|
1029
1074
|
var scales = this.optionalObjectArray(model, 'SCALE');
|
|
1030
1075
|
if (!(scales === null || scales === void 0 ? void 0 : scales.length))
|
|
1031
1076
|
return;
|
|
@@ -1040,16 +1085,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1040
1085
|
scaleDict.setAt(key, dbScale);
|
|
1041
1086
|
}
|
|
1042
1087
|
}
|
|
1043
|
-
catch (
|
|
1088
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1044
1089
|
finally {
|
|
1045
1090
|
try {
|
|
1046
1091
|
if (scales_1_1 && !scales_1_1.done && (_a = scales_1.return)) _a.call(scales_1);
|
|
1047
1092
|
}
|
|
1048
|
-
finally { if (
|
|
1093
|
+
finally { if (e_7) throw e_7.error; }
|
|
1049
1094
|
}
|
|
1050
1095
|
};
|
|
1051
1096
|
AcDbLibreDwgConverter.prototype.processDictionaryVars = function (model, db) {
|
|
1052
|
-
var
|
|
1097
|
+
var e_8, _a;
|
|
1053
1098
|
var dictVars = this.optionalObjectArray(model, 'DICTIONARYVAR');
|
|
1054
1099
|
if (!(dictVars === null || dictVars === void 0 ? void 0 : dictVars.length))
|
|
1055
1100
|
return;
|
|
@@ -1063,16 +1108,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1063
1108
|
dictVarDict.setAt(dbVar.objectId, dbVar);
|
|
1064
1109
|
}
|
|
1065
1110
|
}
|
|
1066
|
-
catch (
|
|
1111
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1067
1112
|
finally {
|
|
1068
1113
|
try {
|
|
1069
1114
|
if (dictVars_1_1 && !dictVars_1_1.done && (_a = dictVars_1.return)) _a.call(dictVars_1);
|
|
1070
1115
|
}
|
|
1071
|
-
finally { if (
|
|
1116
|
+
finally { if (e_8) throw e_8.error; }
|
|
1072
1117
|
}
|
|
1073
1118
|
};
|
|
1074
1119
|
AcDbLibreDwgConverter.prototype.processMTextObjectContextData = function (model, db) {
|
|
1075
|
-
var
|
|
1120
|
+
var e_9, _a;
|
|
1076
1121
|
var _b;
|
|
1077
1122
|
var contexts = (_b = this.optionalObjectArray(model, 'MTEXTOBJECTCONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_MTEXTOBJECTCONTEXTDATA_CLASS');
|
|
1078
1123
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1087,16 +1132,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1087
1132
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1088
1133
|
}
|
|
1089
1134
|
}
|
|
1090
|
-
catch (
|
|
1135
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1091
1136
|
finally {
|
|
1092
1137
|
try {
|
|
1093
1138
|
if (contexts_1_1 && !contexts_1_1.done && (_a = contexts_1.return)) _a.call(contexts_1);
|
|
1094
1139
|
}
|
|
1095
|
-
finally { if (
|
|
1140
|
+
finally { if (e_9) throw e_9.error; }
|
|
1096
1141
|
}
|
|
1097
1142
|
};
|
|
1098
1143
|
AcDbLibreDwgConverter.prototype.processDimensionObjectContextData = function (model, db) {
|
|
1099
|
-
var
|
|
1144
|
+
var e_10, _a, e_11, _b;
|
|
1100
1145
|
var keys = [
|
|
1101
1146
|
'ALDIMOBJECTCONTEXTDATA',
|
|
1102
1147
|
'ACDB_ALDIMOBJECTCONTEXTDATA_CLASS',
|
|
@@ -1124,7 +1169,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1124
1169
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
1125
1170
|
continue;
|
|
1126
1171
|
try {
|
|
1127
|
-
for (var contexts_2 = (
|
|
1172
|
+
for (var contexts_2 = (e_11 = void 0, __values(contexts)), contexts_2_1 = contexts_2.next(); !contexts_2_1.done; contexts_2_1 = contexts_2.next()) {
|
|
1128
1173
|
var context = contexts_2_1.value;
|
|
1129
1174
|
var dbContext = objectConverter.convertDimensionObjectContextData(context);
|
|
1130
1175
|
if (dbContext.objectId) {
|
|
@@ -1132,25 +1177,25 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1132
1177
|
}
|
|
1133
1178
|
}
|
|
1134
1179
|
}
|
|
1135
|
-
catch (
|
|
1180
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1136
1181
|
finally {
|
|
1137
1182
|
try {
|
|
1138
1183
|
if (contexts_2_1 && !contexts_2_1.done && (_b = contexts_2.return)) _b.call(contexts_2);
|
|
1139
1184
|
}
|
|
1140
|
-
finally { if (
|
|
1185
|
+
finally { if (e_11) throw e_11.error; }
|
|
1141
1186
|
}
|
|
1142
1187
|
}
|
|
1143
1188
|
}
|
|
1144
|
-
catch (
|
|
1189
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1145
1190
|
finally {
|
|
1146
1191
|
try {
|
|
1147
1192
|
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
|
|
1148
1193
|
}
|
|
1149
|
-
finally { if (
|
|
1194
|
+
finally { if (e_10) throw e_10.error; }
|
|
1150
1195
|
}
|
|
1151
1196
|
};
|
|
1152
1197
|
AcDbLibreDwgConverter.prototype.processTextObjectContextData = function (model, db) {
|
|
1153
|
-
var
|
|
1198
|
+
var e_12, _a;
|
|
1154
1199
|
var _b;
|
|
1155
1200
|
var contexts = (_b = this.optionalObjectArray(model, 'TEXTOBJECTCONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_TEXTOBJECTCONTEXTDATA_CLASS');
|
|
1156
1201
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1165,16 +1210,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1165
1210
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1166
1211
|
}
|
|
1167
1212
|
}
|
|
1168
|
-
catch (
|
|
1213
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1169
1214
|
finally {
|
|
1170
1215
|
try {
|
|
1171
1216
|
if (contexts_3_1 && !contexts_3_1.done && (_a = contexts_3.return)) _a.call(contexts_3);
|
|
1172
1217
|
}
|
|
1173
|
-
finally { if (
|
|
1218
|
+
finally { if (e_12) throw e_12.error; }
|
|
1174
1219
|
}
|
|
1175
1220
|
};
|
|
1176
1221
|
AcDbLibreDwgConverter.prototype.processHatchScaleContextData = function (model, db) {
|
|
1177
|
-
var
|
|
1222
|
+
var e_13, _a;
|
|
1178
1223
|
var _b;
|
|
1179
1224
|
var contexts = (_b = this.optionalObjectArray(model, 'HATCHSCALECONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_HATCHSCALECONTEXTDATA_CLASS');
|
|
1180
1225
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1189,16 +1234,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1189
1234
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1190
1235
|
}
|
|
1191
1236
|
}
|
|
1192
|
-
catch (
|
|
1237
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1193
1238
|
finally {
|
|
1194
1239
|
try {
|
|
1195
1240
|
if (contexts_4_1 && !contexts_4_1.done && (_a = contexts_4.return)) _a.call(contexts_4);
|
|
1196
1241
|
}
|
|
1197
|
-
finally { if (
|
|
1242
|
+
finally { if (e_13) throw e_13.error; }
|
|
1198
1243
|
}
|
|
1199
1244
|
};
|
|
1200
1245
|
AcDbLibreDwgConverter.prototype.processBlkRefObjectContextData = function (model, db) {
|
|
1201
|
-
var
|
|
1246
|
+
var e_14, _a;
|
|
1202
1247
|
var _b;
|
|
1203
1248
|
var contexts = (_b = this.optionalObjectArray(model, 'BLKREFOBJECTCONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_BLKREFOBJECTCONTEXTDATA_CLASS');
|
|
1204
1249
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1213,16 +1258,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1213
1258
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1214
1259
|
}
|
|
1215
1260
|
}
|
|
1216
|
-
catch (
|
|
1261
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1217
1262
|
finally {
|
|
1218
1263
|
try {
|
|
1219
1264
|
if (contexts_5_1 && !contexts_5_1.done && (_a = contexts_5.return)) _a.call(contexts_5);
|
|
1220
1265
|
}
|
|
1221
|
-
finally { if (
|
|
1266
|
+
finally { if (e_14) throw e_14.error; }
|
|
1222
1267
|
}
|
|
1223
1268
|
};
|
|
1224
1269
|
AcDbLibreDwgConverter.prototype.processLeaderObjectContextData = function (model, db) {
|
|
1225
|
-
var
|
|
1270
|
+
var e_15, _a;
|
|
1226
1271
|
var _b;
|
|
1227
1272
|
var contexts = (_b = this.optionalObjectArray(model, 'LEADEROBJECTCONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_LEADEROBJECTCONTEXTDATA_CLASS');
|
|
1228
1273
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1237,16 +1282,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1237
1282
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1238
1283
|
}
|
|
1239
1284
|
}
|
|
1240
|
-
catch (
|
|
1285
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1241
1286
|
finally {
|
|
1242
1287
|
try {
|
|
1243
1288
|
if (contexts_6_1 && !contexts_6_1.done && (_a = contexts_6.return)) _a.call(contexts_6);
|
|
1244
1289
|
}
|
|
1245
|
-
finally { if (
|
|
1290
|
+
finally { if (e_15) throw e_15.error; }
|
|
1246
1291
|
}
|
|
1247
1292
|
};
|
|
1248
1293
|
AcDbLibreDwgConverter.prototype.processMLeaderObjectContextData = function (model, db) {
|
|
1249
|
-
var
|
|
1294
|
+
var e_16, _a;
|
|
1250
1295
|
var _b;
|
|
1251
1296
|
var contexts = (_b = this.optionalObjectArray(model, 'MLEADEROBJECTCONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_MLEADEROBJECTCONTEXTDATA_CLASS');
|
|
1252
1297
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1261,16 +1306,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1261
1306
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1262
1307
|
}
|
|
1263
1308
|
}
|
|
1264
|
-
catch (
|
|
1309
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1265
1310
|
finally {
|
|
1266
1311
|
try {
|
|
1267
1312
|
if (contexts_7_1 && !contexts_7_1.done && (_a = contexts_7.return)) _a.call(contexts_7);
|
|
1268
1313
|
}
|
|
1269
|
-
finally { if (
|
|
1314
|
+
finally { if (e_16) throw e_16.error; }
|
|
1270
1315
|
}
|
|
1271
1316
|
};
|
|
1272
1317
|
AcDbLibreDwgConverter.prototype.processMTextAttributeObjectContextData = function (model, db) {
|
|
1273
|
-
var
|
|
1318
|
+
var e_17, _a;
|
|
1274
1319
|
var _b;
|
|
1275
1320
|
var contexts = (_b = this.optionalObjectArray(model, 'MTEXTATTRIBUTEOBJECTCONTEXTDATA')) !== null && _b !== void 0 ? _b : this.optionalObjectArray(model, 'ACDB_MTEXTATTRIBUTEOBJECTCONTEXTDATA_CLASS');
|
|
1276
1321
|
if (!(contexts === null || contexts === void 0 ? void 0 : contexts.length))
|
|
@@ -1285,16 +1330,16 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1285
1330
|
contextDict.setAt(dbContext.objectId, dbContext);
|
|
1286
1331
|
}
|
|
1287
1332
|
}
|
|
1288
|
-
catch (
|
|
1333
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1289
1334
|
finally {
|
|
1290
1335
|
try {
|
|
1291
1336
|
if (contexts_8_1 && !contexts_8_1.done && (_a = contexts_8.return)) _a.call(contexts_8);
|
|
1292
1337
|
}
|
|
1293
|
-
finally { if (
|
|
1338
|
+
finally { if (e_17) throw e_17.error; }
|
|
1294
1339
|
}
|
|
1295
1340
|
};
|
|
1296
1341
|
AcDbLibreDwgConverter.prototype.processXRecords = function (model, db) {
|
|
1297
|
-
var
|
|
1342
|
+
var e_18, _a;
|
|
1298
1343
|
var xrecords = model.objects.XRECORD;
|
|
1299
1344
|
if (!(xrecords === null || xrecords === void 0 ? void 0 : xrecords.length))
|
|
1300
1345
|
return;
|
|
@@ -1308,12 +1353,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1308
1353
|
xrecordDict.setAt(dbXrecord.objectId, dbXrecord);
|
|
1309
1354
|
}
|
|
1310
1355
|
}
|
|
1311
|
-
catch (
|
|
1356
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1312
1357
|
finally {
|
|
1313
1358
|
try {
|
|
1314
1359
|
if (xrecords_1_1 && !xrecords_1_1.done && (_a = xrecords_1.return)) _a.call(xrecords_1);
|
|
1315
1360
|
}
|
|
1316
|
-
finally { if (
|
|
1361
|
+
finally { if (e_18) throw e_18.error; }
|
|
1317
1362
|
}
|
|
1318
1363
|
};
|
|
1319
1364
|
/**
|
|
@@ -1321,7 +1366,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1321
1366
|
* the ACAD_GROUP dictionary so ObjectARX-style names are available.
|
|
1322
1367
|
*/
|
|
1323
1368
|
AcDbLibreDwgConverter.prototype.processGroups = function (model, db) {
|
|
1324
|
-
var
|
|
1369
|
+
var e_19, _a, e_20, _b, e_21, _c, e_22, _d;
|
|
1325
1370
|
var _e, _f, _g, _h;
|
|
1326
1371
|
var groups = (_e = model.objects.GROUP) !== null && _e !== void 0 ? _e : this.optionalObjectArray(model, 'GROUP');
|
|
1327
1372
|
if (!(groups === null || groups === void 0 ? void 0 : groups.length))
|
|
@@ -1344,12 +1389,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1344
1389
|
byHandle.set(normalize(dbGroup.objectId), dbGroup);
|
|
1345
1390
|
}
|
|
1346
1391
|
}
|
|
1347
|
-
catch (
|
|
1392
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1348
1393
|
finally {
|
|
1349
1394
|
try {
|
|
1350
1395
|
if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
|
|
1351
1396
|
}
|
|
1352
|
-
finally { if (
|
|
1397
|
+
finally { if (e_19) throw e_19.error; }
|
|
1353
1398
|
}
|
|
1354
1399
|
// Resolve ACAD_GROUP dictionary entry names → group.name / dict keys.
|
|
1355
1400
|
var acadGroupHandle = '';
|
|
@@ -1363,12 +1408,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1363
1408
|
}
|
|
1364
1409
|
}
|
|
1365
1410
|
}
|
|
1366
|
-
catch (
|
|
1411
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1367
1412
|
finally {
|
|
1368
1413
|
try {
|
|
1369
1414
|
if (_k && !_k.done && (_b = _j.return)) _b.call(_j);
|
|
1370
1415
|
}
|
|
1371
|
-
finally { if (
|
|
1416
|
+
finally { if (e_20) throw e_20.error; }
|
|
1372
1417
|
}
|
|
1373
1418
|
if (!acadGroupHandle)
|
|
1374
1419
|
return;
|
|
@@ -1384,7 +1429,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1384
1429
|
continue;
|
|
1385
1430
|
var storedKey = void 0;
|
|
1386
1431
|
try {
|
|
1387
|
-
for (var _p = (
|
|
1432
|
+
for (var _p = (e_22 = void 0, __values(groupDict.entries())), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1388
1433
|
var _r = __read(_q.value, 2), key = _r[0], existing = _r[1];
|
|
1389
1434
|
if (normalize(existing.objectId) === handle) {
|
|
1390
1435
|
storedKey = key;
|
|
@@ -1392,12 +1437,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1392
1437
|
}
|
|
1393
1438
|
}
|
|
1394
1439
|
}
|
|
1395
|
-
catch (
|
|
1440
|
+
catch (e_22_1) { e_22 = { error: e_22_1 }; }
|
|
1396
1441
|
finally {
|
|
1397
1442
|
try {
|
|
1398
1443
|
if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
|
|
1399
1444
|
}
|
|
1400
|
-
finally { if (
|
|
1445
|
+
finally { if (e_22) throw e_22.error; }
|
|
1401
1446
|
}
|
|
1402
1447
|
var occupied = groupDict.getAt(entryName);
|
|
1403
1448
|
if (occupied && occupied !== group) {
|
|
@@ -1414,12 +1459,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1414
1459
|
group.name = entryName;
|
|
1415
1460
|
}
|
|
1416
1461
|
}
|
|
1417
|
-
catch (
|
|
1462
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1418
1463
|
finally {
|
|
1419
1464
|
try {
|
|
1420
1465
|
if (_m && !_m.done && (_c = _l.return)) _c.call(_l);
|
|
1421
1466
|
}
|
|
1422
|
-
finally { if (
|
|
1467
|
+
finally { if (e_21) throw e_21.error; }
|
|
1423
1468
|
}
|
|
1424
1469
|
};
|
|
1425
1470
|
/**
|
|
@@ -1427,7 +1472,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1427
1472
|
* dictionaries have been materialized.
|
|
1428
1473
|
*/
|
|
1429
1474
|
AcDbLibreDwgConverter.prototype.finishCannoscale = function (model, db) {
|
|
1430
|
-
var
|
|
1475
|
+
var e_23, _a;
|
|
1431
1476
|
var _b, _c;
|
|
1432
1477
|
var tryRead = function (variableDict) {
|
|
1433
1478
|
var cannoscaleVar = variableDict.getAt('CANNOSCALE');
|
|
@@ -1468,19 +1513,19 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1468
1513
|
return;
|
|
1469
1514
|
}
|
|
1470
1515
|
}
|
|
1471
|
-
catch (
|
|
1516
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
1472
1517
|
finally {
|
|
1473
1518
|
try {
|
|
1474
1519
|
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
1475
1520
|
}
|
|
1476
|
-
finally { if (
|
|
1521
|
+
finally { if (e_23) throw e_23.error; }
|
|
1477
1522
|
}
|
|
1478
1523
|
};
|
|
1479
1524
|
/**
|
|
1480
1525
|
* Reads ANNOALLVISIBLE from AcDbVariableDictionary → DICTIONARYVAR.
|
|
1481
1526
|
*/
|
|
1482
1527
|
AcDbLibreDwgConverter.prototype.finishAnnoallvisible = function (model, db) {
|
|
1483
|
-
var
|
|
1528
|
+
var e_24, _a;
|
|
1484
1529
|
var _b, _c;
|
|
1485
1530
|
var tryRead = function (variableDict) {
|
|
1486
1531
|
var annoVar = variableDict.getAt('ANNOALLVISIBLE');
|
|
@@ -1513,12 +1558,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1513
1558
|
return;
|
|
1514
1559
|
}
|
|
1515
1560
|
}
|
|
1516
|
-
catch (
|
|
1561
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
1517
1562
|
finally {
|
|
1518
1563
|
try {
|
|
1519
1564
|
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
1520
1565
|
}
|
|
1521
|
-
finally { if (
|
|
1566
|
+
finally { if (e_24) throw e_24.error; }
|
|
1522
1567
|
}
|
|
1523
1568
|
};
|
|
1524
1569
|
/** Reads optional object arrays that newer libredwg-web builds may expose. */
|
|
@@ -1547,7 +1592,7 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1547
1592
|
* @returns A new array of entities grouped by their `type` property.
|
|
1548
1593
|
*/
|
|
1549
1594
|
AcDbLibreDwgConverter.prototype.groupAndFlattenByType = function (entities) {
|
|
1550
|
-
var
|
|
1595
|
+
var e_25, _a, e_26, _b;
|
|
1551
1596
|
var groups = {};
|
|
1552
1597
|
var order = [];
|
|
1553
1598
|
try {
|
|
@@ -1560,12 +1605,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1560
1605
|
groups[entity.type].push(entity);
|
|
1561
1606
|
}
|
|
1562
1607
|
}
|
|
1563
|
-
catch (
|
|
1608
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1564
1609
|
finally {
|
|
1565
1610
|
try {
|
|
1566
1611
|
if (entities_1_1 && !entities_1_1.done && (_a = entities_1.return)) _a.call(entities_1);
|
|
1567
1612
|
}
|
|
1568
|
-
finally { if (
|
|
1613
|
+
finally { if (e_25) throw e_25.error; }
|
|
1569
1614
|
}
|
|
1570
1615
|
var result = [];
|
|
1571
1616
|
try {
|
|
@@ -1578,12 +1623,12 @@ var AcDbLibreDwgConverter = /** @class */ (function (_super) {
|
|
|
1578
1623
|
}
|
|
1579
1624
|
}
|
|
1580
1625
|
}
|
|
1581
|
-
catch (
|
|
1626
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
1582
1627
|
finally {
|
|
1583
1628
|
try {
|
|
1584
1629
|
if (order_1_1 && !order_1_1.done && (_b = order_1.return)) _b.call(order_1);
|
|
1585
1630
|
}
|
|
1586
|
-
finally { if (
|
|
1631
|
+
finally { if (e_26) throw e_26.error; }
|
|
1587
1632
|
}
|
|
1588
1633
|
return result;
|
|
1589
1634
|
};
|