@buerli.io/headless 0.4.1 → 0.5.0-beta.2
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/build/cjs/history.js +1226 -0
- package/build/cjs/index.js +35 -0
- package/build/cjs/solid.js +435 -0
- package/build/cjs/utils/selection.js +32 -0
- package/build/{history.js → esm/history.js} +155 -150
- package/build/{index.js → esm/index.js} +0 -0
- package/build/{solid.js → esm/solid.js} +2 -2
- package/build/{utils → esm/utils}/selection.js +0 -0
- package/build/{history.d.ts → types/history.d.ts} +50 -22
- package/build/{index.d.ts → types/index.d.ts} +0 -0
- package/build/{solid.d.ts → types/solid.d.ts} +5 -5
- package/build/{utils → types/utils}/selection.d.ts +0 -0
- package/package.json +11 -11
|
@@ -39,12 +39,13 @@ const getDataType = (value) => {
|
|
|
39
39
|
* @returns cclass type of given type
|
|
40
40
|
*/
|
|
41
41
|
const getDimensionType = (type) => {
|
|
42
|
+
let cclass = CCClasses.CCLinearDimension;
|
|
42
43
|
switch (type) {
|
|
43
44
|
case 'LinearDimension':
|
|
44
|
-
|
|
45
|
-
case undefined:
|
|
45
|
+
cclass = CCClasses.CCLinearDimension;
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
|
+
return cclass;
|
|
48
49
|
};
|
|
49
50
|
/**
|
|
50
51
|
* Transforms the transformation which is local to the ownerId into global
|
|
@@ -283,74 +284,94 @@ export default class CAD {
|
|
|
283
284
|
return ccAPI.assemblyBuilder.addNode(drawingId, rProductId, rOwnerId, globalTransformation, name);
|
|
284
285
|
}, productId, ownerId);
|
|
285
286
|
},
|
|
286
|
-
addNodes: (...nodes) => {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
287
|
+
addNodes: async (...nodes) => {
|
|
288
|
+
var e_1, _a;
|
|
289
|
+
const nodesToAdd = [];
|
|
290
|
+
try {
|
|
291
|
+
for (var nodes_1 = __asyncValues(nodes), nodes_1_1; nodes_1_1 = await nodes_1.next(), !nodes_1_1.done;) {
|
|
292
|
+
const node = nodes_1_1.value;
|
|
293
|
+
const [rProductId, rOwnerId] = await new Promise(res => this.resolve(id => res(id), node.productId, node.ownerId));
|
|
294
|
+
const nodeParam = {
|
|
295
|
+
referenceId: rProductId,
|
|
296
|
+
ownerId: rOwnerId,
|
|
297
|
+
transformation: getGlobalTransformation(drawingId, rOwnerId, node.transformation) || node.transformation,
|
|
298
|
+
name: node.name,
|
|
299
|
+
};
|
|
300
|
+
nodesToAdd.push(nodeParam);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
304
|
+
finally {
|
|
305
|
+
try {
|
|
306
|
+
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) await _a.call(nodes_1);
|
|
307
|
+
}
|
|
308
|
+
finally { if (e_1) throw e_1.error; }
|
|
309
|
+
}
|
|
310
|
+
return ccAPI.assemblyBuilder.addNodes(drawingId, nodesToAdd);
|
|
295
311
|
},
|
|
296
312
|
addDimension: (dim) => {
|
|
297
313
|
return this.resolve(async ([rProductId]) => {
|
|
298
314
|
const dimensionType = getDimensionType(dim.dimParam.dimType);
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return ccAPI.drawing2D.addDimension(drawingId, dimParam);
|
|
318
|
-
}
|
|
315
|
+
const dimParam = {
|
|
316
|
+
productId: rProductId,
|
|
317
|
+
param: {
|
|
318
|
+
type: dimensionType,
|
|
319
|
+
name: dim.dimParam.dimName,
|
|
320
|
+
label: dim.dimParam.dimLabel,
|
|
321
|
+
value: dim.dimParam.dimValue,
|
|
322
|
+
startPos: dim.dimParam.dimStartPos,
|
|
323
|
+
endPos: dim.dimParam.dimEndPos,
|
|
324
|
+
textPos: dim.dimParam.dimTextPos,
|
|
325
|
+
textAngle: dim.dimParam.dimTextAngle,
|
|
326
|
+
orientation: dim.dimParam.dimOrientation,
|
|
327
|
+
color: dim.dimParam.dimColor,
|
|
328
|
+
layer: dim.dimParam.dimLayer,
|
|
329
|
+
},
|
|
330
|
+
dxfView: dim.dxfView,
|
|
331
|
+
};
|
|
332
|
+
return ccAPI.drawing2D.addDimension(drawingId, dimParam);
|
|
319
333
|
}, dim.productId);
|
|
320
334
|
},
|
|
321
|
-
addDimensions: (...dimensions) => {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
335
|
+
addDimensions: async (...dimensions) => {
|
|
336
|
+
var e_2, _a;
|
|
337
|
+
const dimParamsToAdd = [];
|
|
338
|
+
try {
|
|
339
|
+
for (var dimensions_1 = __asyncValues(dimensions), dimensions_1_1; dimensions_1_1 = await dimensions_1.next(), !dimensions_1_1.done;) {
|
|
340
|
+
const dim = dimensions_1_1.value;
|
|
341
|
+
const [rProductId] = await new Promise(res => this.resolve(id => res(id), dim.productId));
|
|
325
342
|
const dimensionType = getDimensionType(dim.dimParam.dimType);
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
343
|
+
const dimParam = {
|
|
344
|
+
productId: rProductId,
|
|
345
|
+
param: {
|
|
346
|
+
type: dimensionType,
|
|
347
|
+
name: dim.dimParam.dimName,
|
|
348
|
+
label: dim.dimParam.dimLabel,
|
|
349
|
+
value: dim.dimParam.dimValue,
|
|
350
|
+
startPos: dim.dimParam.dimStartPos,
|
|
351
|
+
endPos: dim.dimParam.dimEndPos,
|
|
352
|
+
textPos: dim.dimParam.dimTextPos,
|
|
353
|
+
textAngle: dim.dimParam.dimTextAngle,
|
|
354
|
+
orientation: dim.dimParam.dimOrientation,
|
|
355
|
+
color: dim.dimParam.dimColor,
|
|
356
|
+
layer: dim.dimParam.dimLayer,
|
|
357
|
+
},
|
|
358
|
+
dxfView: dim.dxfView,
|
|
359
|
+
};
|
|
360
|
+
dimParamsToAdd.push(dimParam);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
364
|
+
finally {
|
|
365
|
+
try {
|
|
366
|
+
if (dimensions_1_1 && !dimensions_1_1.done && (_a = dimensions_1.return)) await _a.call(dimensions_1);
|
|
367
|
+
}
|
|
368
|
+
finally { if (e_2) throw e_2.error; }
|
|
369
|
+
}
|
|
370
|
+
return ccAPI.drawing2D.addDimensions(drawingId, dimParamsToAdd);
|
|
348
371
|
},
|
|
349
372
|
create2DViews: (productId, viewTypes, viewOptions) => {
|
|
350
373
|
return this.resolve(async ([rProductId]) => {
|
|
351
|
-
const
|
|
352
|
-
const layer = (viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.layer) ? viewOptions.layer : '0';
|
|
353
|
-
const viewIds = await ccAPI.drawing2D.create2DViews(drawingId, rProductId, viewTypes, [color, layer]);
|
|
374
|
+
const viewIds = await ccAPI.drawing2D.create2DViews(drawingId, rProductId, viewTypes, viewOptions);
|
|
354
375
|
if (viewIds !== null) {
|
|
355
376
|
await ccAPI.drawing2D.centerAllViews(drawingId, rProductId, viewTypes);
|
|
356
377
|
return viewIds;
|
|
@@ -366,13 +387,7 @@ export default class CAD {
|
|
|
366
387
|
},
|
|
367
388
|
place2DViews: (productId, viewPositions) => {
|
|
368
389
|
return this.resolve(async ([rProductId]) => {
|
|
369
|
-
|
|
370
|
-
viewPositions.forEach(viewPos => {
|
|
371
|
-
if (viewPos.viewType !== undefined) {
|
|
372
|
-
viewPositionParams.push([viewPos.viewType, viewPos.vector]);
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
return ccAPI.drawing2D.place2DViews(drawingId, rProductId, viewPositionParams);
|
|
390
|
+
return ccAPI.drawing2D.place2DViews(drawingId, rProductId, viewPositions);
|
|
376
391
|
}, productId);
|
|
377
392
|
},
|
|
378
393
|
exportDXF: (productId, dxfTemplateFilename) => {
|
|
@@ -603,7 +618,7 @@ export default class CAD {
|
|
|
603
618
|
const xOffsetParam = { value: xOffset, isExpr: typeof xOffset === 'string' };
|
|
604
619
|
const yOffsetParam = { value: yOffset, isExpr: typeof yOffset === 'string' };
|
|
605
620
|
const zOffsetParam = { value: zOffset, isExpr: typeof zOffset === 'string' };
|
|
606
|
-
await ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, constraintId,
|
|
621
|
+
await ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, constraintId, { matePath: rMatePath1, wcsId: rWcs1, flip: mate1.flip, reoriented: mate1.reoriented }, { matePath: rMatePath2, wcsId: rWcs2, flip: mate2.flip, reoriented: mate2.reoriented }, xOffsetParam, yOffsetParam, zOffsetParam);
|
|
607
622
|
return constraintId;
|
|
608
623
|
}
|
|
609
624
|
return null;
|
|
@@ -615,10 +630,10 @@ export default class CAD {
|
|
|
615
630
|
const xOffsetParam = { value: xOffset, isExpr: typeof xOffset === 'string' };
|
|
616
631
|
const yOffsetParam = { value: yOffset, isExpr: typeof xOffset === 'string' };
|
|
617
632
|
const zOffsetParam = { value: zOffset, isExpr: typeof xOffset === 'string' };
|
|
618
|
-
await ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, rConstrId,
|
|
633
|
+
await ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, rConstrId, { matePath: rMatePath1, wcsId: rWcs1, flip: mate1.flip, reoriented: mate1.reoriented }, { matePath: rMatePath2, wcsId: rWcs2, flip: mate2.flip, reoriented: mate2.reoriented }, xOffsetParam, yOffsetParam, zOffsetParam);
|
|
619
634
|
},
|
|
620
635
|
updateFastenedConstraints: async (...constraints) => {
|
|
621
|
-
var
|
|
636
|
+
var e_3, _a;
|
|
622
637
|
const constrToAdd = [];
|
|
623
638
|
try {
|
|
624
639
|
for (var constraints_1 = __asyncValues(constraints), constraints_1_1; constraints_1_1 = await constraints_1.next(), !constraints_1_1.done;) {
|
|
@@ -626,25 +641,35 @@ export default class CAD {
|
|
|
626
641
|
const [rConstrId, rWcs1, rWcs2] = await new Promise(res => this.resolve(ids => res(ids), constr.constrId, constr.mate1.wcsId, constr.mate2.wcsId));
|
|
627
642
|
const rMatePath1 = await new Promise(res => this.resolve(paths => res(paths), ...constr.mate1.matePath));
|
|
628
643
|
const rMatePath2 = await new Promise(res => this.resolve(paths => res(paths), ...constr.mate2.matePath));
|
|
629
|
-
const xOffsetParam =
|
|
630
|
-
const yOffsetParam =
|
|
631
|
-
const zOffsetParam =
|
|
632
|
-
constrToAdd.push(
|
|
633
|
-
rConstrId,
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
644
|
+
const xOffsetParam = { value: constr.xOffset, isExpr: typeof constr.xOffset === 'string' };
|
|
645
|
+
const yOffsetParam = { value: constr.yOffset, isExpr: typeof constr.yOffset === 'string' };
|
|
646
|
+
const zOffsetParam = { value: constr.zOffset, isExpr: typeof constr.zOffset === 'string' };
|
|
647
|
+
constrToAdd.push({
|
|
648
|
+
constrId: rConstrId,
|
|
649
|
+
mate1: {
|
|
650
|
+
matePath: rMatePath1,
|
|
651
|
+
wcsId: rWcs1,
|
|
652
|
+
flip: constr.mate1.flip,
|
|
653
|
+
reoriented: constr.mate1.reoriented,
|
|
654
|
+
},
|
|
655
|
+
mate2: {
|
|
656
|
+
matePath: rMatePath2,
|
|
657
|
+
wcsId: rWcs2,
|
|
658
|
+
flip: constr.mate2.flip,
|
|
659
|
+
reoriented: constr.mate2.reoriented,
|
|
660
|
+
},
|
|
661
|
+
xOffset: xOffsetParam,
|
|
662
|
+
yOffset: yOffsetParam,
|
|
663
|
+
zOffset: zOffsetParam,
|
|
664
|
+
});
|
|
640
665
|
}
|
|
641
666
|
}
|
|
642
|
-
catch (
|
|
667
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
643
668
|
finally {
|
|
644
669
|
try {
|
|
645
670
|
if (constraints_1_1 && !constraints_1_1.done && (_a = constraints_1.return)) await _a.call(constraints_1);
|
|
646
671
|
}
|
|
647
|
-
finally { if (
|
|
672
|
+
finally { if (e_3) throw e_3.error; }
|
|
648
673
|
}
|
|
649
674
|
await ccAPI.assemblyBuilder.updateFastenedConstraints(drawingId, constrToAdd);
|
|
650
675
|
},
|
|
@@ -656,7 +681,7 @@ export default class CAD {
|
|
|
656
681
|
const xOffsetParam = { value: xOffset, isExpr: typeof xOffset === 'string' };
|
|
657
682
|
const yOffsetParam = { value: yOffset, isExpr: typeof yOffset === 'string' };
|
|
658
683
|
const zOffsetParam = { value: zOffset, isExpr: typeof zOffset === 'string' };
|
|
659
|
-
await ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, constraintId,
|
|
684
|
+
await ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, constraintId, { matePath: rMatePath, wcsId: rWcs1, flip: mate1.flip, reoriented: mate1.reoriented }, xOffsetParam, yOffsetParam, zOffsetParam);
|
|
660
685
|
return constraintId;
|
|
661
686
|
}
|
|
662
687
|
return null;
|
|
@@ -667,36 +692,41 @@ export default class CAD {
|
|
|
667
692
|
const xOffsetParam = { value: xOffset, isExpr: typeof xOffset === 'string' };
|
|
668
693
|
const yOffsetParam = { value: yOffset, isExpr: typeof yOffset === 'string' };
|
|
669
694
|
const zOffsetParam = { value: zOffset, isExpr: typeof zOffset === 'string' };
|
|
670
|
-
await ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, rConstrId,
|
|
695
|
+
await ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, rConstrId, { matePath: rMatePath, wcsId: rWcs1, flip: mate1.flip, reoriented: mate1.reoriented }, xOffsetParam, yOffsetParam, zOffsetParam);
|
|
671
696
|
},
|
|
672
697
|
updateFastenedOriginConstraints: async (...constraints) => {
|
|
673
|
-
var
|
|
674
|
-
const
|
|
698
|
+
var e_4, _a;
|
|
699
|
+
const constraintsToAdd = [];
|
|
675
700
|
try {
|
|
676
701
|
for (var constraints_2 = __asyncValues(constraints), constraints_2_1; constraints_2_1 = await constraints_2.next(), !constraints_2_1.done;) {
|
|
677
702
|
const constr = constraints_2_1.value;
|
|
678
703
|
const [rConstrId, rWcs1] = await new Promise(res => this.resolve(ids => res(ids), constr.constrId, constr.mate1.wcsId));
|
|
679
704
|
const rMatePath = await new Promise(res => this.resolve(paths => res(paths), ...constr.mate1.matePath));
|
|
680
|
-
const xOffsetParam =
|
|
681
|
-
const yOffsetParam =
|
|
682
|
-
const zOffsetParam =
|
|
683
|
-
|
|
684
|
-
rConstrId,
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
705
|
+
const xOffsetParam = { value: constr.xOffset, isExpr: typeof constr.xOffset === 'string' };
|
|
706
|
+
const yOffsetParam = { value: constr.yOffset, isExpr: typeof constr.yOffset === 'string' };
|
|
707
|
+
const zOffsetParam = { value: constr.zOffset, isExpr: typeof constr.zOffset === 'string' };
|
|
708
|
+
constraintsToAdd.push({
|
|
709
|
+
constrId: rConstrId,
|
|
710
|
+
mate1: {
|
|
711
|
+
matePath: rMatePath,
|
|
712
|
+
wcsId: rWcs1,
|
|
713
|
+
flip: constr.mate1.flip,
|
|
714
|
+
reoriented: constr.mate1.reoriented,
|
|
715
|
+
},
|
|
716
|
+
xOffset: xOffsetParam,
|
|
717
|
+
yOffset: yOffsetParam,
|
|
718
|
+
zOffset: zOffsetParam,
|
|
719
|
+
});
|
|
690
720
|
}
|
|
691
721
|
}
|
|
692
|
-
catch (
|
|
722
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
693
723
|
finally {
|
|
694
724
|
try {
|
|
695
725
|
if (constraints_2_1 && !constraints_2_1.done && (_a = constraints_2.return)) await _a.call(constraints_2);
|
|
696
726
|
}
|
|
697
|
-
finally { if (
|
|
727
|
+
finally { if (e_4) throw e_4.error; }
|
|
698
728
|
}
|
|
699
|
-
await ccAPI.assemblyBuilder.updateFastenedOriginConstraints(drawingId,
|
|
729
|
+
await ccAPI.assemblyBuilder.updateFastenedOriginConstraints(drawingId, constraintsToAdd);
|
|
700
730
|
},
|
|
701
731
|
createBufferGeometry: async (objectId) => {
|
|
702
732
|
await this.queue;
|
|
@@ -737,12 +767,12 @@ export default class CAD {
|
|
|
737
767
|
const membersToAdd = [];
|
|
738
768
|
members.forEach(mem => {
|
|
739
769
|
const isExpr = typeof mem.value === 'string'; // TODO Expression unterscheiden von normalen STrings
|
|
740
|
-
const dataType =
|
|
770
|
+
const dataType = DataType.REAL; // TODO: Aktuell nur Real Werte als Expression
|
|
741
771
|
const featureAPIParam = {
|
|
742
772
|
value: mem.value,
|
|
743
773
|
isExpr: isExpr,
|
|
744
774
|
};
|
|
745
|
-
membersToAdd.push(
|
|
775
|
+
membersToAdd.push({ name: mem.name, value: featureAPIParam, dataType });
|
|
746
776
|
});
|
|
747
777
|
const success = featureAPI.updateExpressionSet(drawingId, rPartId, membersToAdd, [], []);
|
|
748
778
|
return success;
|
|
@@ -773,15 +803,7 @@ export default class CAD {
|
|
|
773
803
|
createWorkAxis: (partId, type, references, position, direction, local, name) => {
|
|
774
804
|
return this.resolve(async ([rPartId, ...rReferences]) => {
|
|
775
805
|
const wAName = name ? name : 'WorkAxis';
|
|
776
|
-
const
|
|
777
|
-
const wAId = await featureAPI.createWorkAxis(drawingId, rPartId, {
|
|
778
|
-
axisType: type,
|
|
779
|
-
references: wARefs,
|
|
780
|
-
name: wAName,
|
|
781
|
-
position: position,
|
|
782
|
-
direction: direction,
|
|
783
|
-
local: local,
|
|
784
|
-
});
|
|
806
|
+
const wAId = await featureAPI.createWorkGeometry(drawingId, rPartId, CCClasses.CCWorkAxis, wAName);
|
|
785
807
|
if (wAId != null) {
|
|
786
808
|
const positionParam = {
|
|
787
809
|
value: position,
|
|
@@ -791,7 +813,7 @@ export default class CAD {
|
|
|
791
813
|
value: direction,
|
|
792
814
|
isExpr: typeof direction === 'string',
|
|
793
815
|
};
|
|
794
|
-
await featureAPI.updateWorkAxis(drawingId, wAId, type,
|
|
816
|
+
await featureAPI.updateWorkAxis(drawingId, wAId, type, rReferences, positionParam, directionParam, local);
|
|
795
817
|
return wAId;
|
|
796
818
|
}
|
|
797
819
|
return null;
|
|
@@ -800,24 +822,14 @@ export default class CAD {
|
|
|
800
822
|
createWorkCoordSystem: (partId, type, references, coordinateSystem, offset, rotation, inverted, local, name) => {
|
|
801
823
|
return this.resolve(async ([rPartId, ...rReferences]) => {
|
|
802
824
|
const wCSName = name ? name : 'WorkCoordSystem';
|
|
803
|
-
const
|
|
804
|
-
const wCSId = await featureAPI.createWorkCoordSystem(drawingId, rPartId, {
|
|
805
|
-
coordSystemType: type,
|
|
806
|
-
name: wCSName,
|
|
807
|
-
references: wCSRefs,
|
|
808
|
-
coordinateSystem,
|
|
809
|
-
offset,
|
|
810
|
-
rotation,
|
|
811
|
-
inverted,
|
|
812
|
-
local,
|
|
813
|
-
});
|
|
825
|
+
const wCSId = await featureAPI.createWorkGeometry(drawingId, rPartId, CCClasses.CCWorkCoordSystem, wCSName);
|
|
814
826
|
if (wCSId != null) {
|
|
815
827
|
const offsetParam = { value: offset, isExpr: typeof offset === 'string' };
|
|
816
828
|
const rotationParam = {
|
|
817
829
|
value: rotation,
|
|
818
830
|
isExpr: typeof rotation === 'string',
|
|
819
831
|
};
|
|
820
|
-
await featureAPI.updateWorkCoordSystem(drawingId, wCSId, type,
|
|
832
|
+
await featureAPI.updateWorkCoordSystem(drawingId, wCSId, type, rReferences, coordinateSystem, offsetParam, rotationParam, inverted, local);
|
|
821
833
|
return wCSId;
|
|
822
834
|
}
|
|
823
835
|
return null;
|
|
@@ -826,16 +838,7 @@ export default class CAD {
|
|
|
826
838
|
createWorkPlane: (partId, type, references, offset, angle, position, normal, local, name) => {
|
|
827
839
|
return this.resolve(async ([rPartId, ...rReferences]) => {
|
|
828
840
|
const wPName = name ? name : 'WorkPlane';
|
|
829
|
-
const
|
|
830
|
-
const wPId = await featureAPI.createWorkPlane(drawingId, rPartId, {
|
|
831
|
-
planeType: type,
|
|
832
|
-
references: wPRefs,
|
|
833
|
-
offsetOrAngle: offset,
|
|
834
|
-
name: wPName,
|
|
835
|
-
position: position,
|
|
836
|
-
normal: normal,
|
|
837
|
-
local: local,
|
|
838
|
-
});
|
|
841
|
+
const wPId = await featureAPI.createWorkGeometry(drawingId, rPartId, CCClasses.CCWorkPlane, wPName);
|
|
839
842
|
if (wPId != undefined) {
|
|
840
843
|
const offsetParam = { value: offset, isExpr: typeof offset === 'string' };
|
|
841
844
|
const angleParam = { value: angle, isExpr: typeof angle === 'string' };
|
|
@@ -844,7 +847,7 @@ export default class CAD {
|
|
|
844
847
|
isExpr: typeof position === 'string',
|
|
845
848
|
};
|
|
846
849
|
const normalParam = { value: normal, isExpr: typeof normal === 'string' };
|
|
847
|
-
await featureAPI.updateWorkPlane(drawingId, wPId, type,
|
|
850
|
+
await featureAPI.updateWorkPlane(drawingId, wPId, type, rReferences, offsetParam, angleParam, positionParam, normalParam, local);
|
|
848
851
|
return wPId;
|
|
849
852
|
}
|
|
850
853
|
return null;
|
|
@@ -853,20 +856,13 @@ export default class CAD {
|
|
|
853
856
|
createWorkPoint: (partId, type, references, position, local, name) => {
|
|
854
857
|
return this.resolve(async ([rPartId, ...rReferences]) => {
|
|
855
858
|
const wPTName = name ? name : 'WorkPoint';
|
|
856
|
-
const
|
|
857
|
-
const wPTId = await featureAPI.createWorkPoint(drawingId, rPartId, {
|
|
858
|
-
pointType: type,
|
|
859
|
-
references: wPTRefs,
|
|
860
|
-
name: wPTName,
|
|
861
|
-
position: position,
|
|
862
|
-
local: local,
|
|
863
|
-
});
|
|
859
|
+
const wPTId = await featureAPI.createWorkGeometry(drawingId, rPartId, CCClasses.CCWorkPoint, wPTName);
|
|
864
860
|
if (wPTId != undefined) {
|
|
865
861
|
const positionParam = {
|
|
866
862
|
value: position,
|
|
867
863
|
isExpr: typeof position === 'string',
|
|
868
864
|
};
|
|
869
|
-
await featureAPI.updateWorkPoint(drawingId, wPTId, type,
|
|
865
|
+
await featureAPI.updateWorkPoint(drawingId, wPTId, type, rReferences, positionParam, local);
|
|
870
866
|
return wPTId;
|
|
871
867
|
}
|
|
872
868
|
return null;
|
|
@@ -1140,12 +1136,12 @@ export default class CAD {
|
|
|
1140
1136
|
return this.resolve(async ([rPartId]) => {
|
|
1141
1137
|
const membersToModify = [];
|
|
1142
1138
|
members.forEach(mem => {
|
|
1143
|
-
const isExpr = typeof mem.value === 'string'; // TODO Expression unterscheiden von normalen
|
|
1139
|
+
const isExpr = typeof mem.value === 'string'; // TODO Expression unterscheiden von normalen Strings
|
|
1144
1140
|
const featureAPIParam = {
|
|
1145
1141
|
value: mem.value,
|
|
1146
|
-
isExpr
|
|
1142
|
+
isExpr,
|
|
1147
1143
|
};
|
|
1148
|
-
membersToModify.push(
|
|
1144
|
+
membersToModify.push({ name: mem.name, value: featureAPIParam });
|
|
1149
1145
|
});
|
|
1150
1146
|
const success = featureAPI.updateExpressionSet(drawingId, rPartId, [], membersToModify, []);
|
|
1151
1147
|
return success;
|
|
@@ -1157,10 +1153,19 @@ export default class CAD {
|
|
|
1157
1153
|
rExprSets.forEach(exprSet => {
|
|
1158
1154
|
const membersToModify = [];
|
|
1159
1155
|
exprSet.members.forEach((mem) => {
|
|
1160
|
-
const isExpr = typeof mem.value === 'string'; // TODO Expression unterscheiden von normalen
|
|
1161
|
-
|
|
1156
|
+
const isExpr = typeof mem.value === 'string'; // TODO Expression unterscheiden von normalen Strings
|
|
1157
|
+
const featureAPIParam = {
|
|
1158
|
+
value: mem.value,
|
|
1159
|
+
isExpr,
|
|
1160
|
+
};
|
|
1161
|
+
membersToModify.push({ name: mem.name, value: featureAPIParam });
|
|
1162
|
+
});
|
|
1163
|
+
exprSetsToSet.push({
|
|
1164
|
+
productId: exprSet.partId,
|
|
1165
|
+
toAddMembers: [],
|
|
1166
|
+
toModifyMembers: membersToModify,
|
|
1167
|
+
toDeleteList: [],
|
|
1162
1168
|
});
|
|
1163
|
-
exprSetsToSet.push([exprSet.partId, [], membersToModify, []]);
|
|
1164
1169
|
});
|
|
1165
1170
|
const success = await featureAPI.updateExpressionSets(drawingId, exprSetsToSet);
|
|
1166
1171
|
return success;
|
|
File without changes
|
|
@@ -302,7 +302,7 @@ export default class CAD {
|
|
|
302
302
|
},
|
|
303
303
|
load: (data) => {
|
|
304
304
|
return this.resolve(async () => {
|
|
305
|
-
const productId = await solidAPI.load(drawingId, data, '
|
|
305
|
+
const productId = await solidAPI.load(drawingId, data, 'ofb', true);
|
|
306
306
|
if (productId !== null) {
|
|
307
307
|
const drawing = getDrawing(drawingId);
|
|
308
308
|
const solids = drawing.structure.tree[productId].solids;
|
|
@@ -355,7 +355,7 @@ export default class CAD {
|
|
|
355
355
|
},
|
|
356
356
|
save: () => {
|
|
357
357
|
return this.resolve(async () => {
|
|
358
|
-
return solidAPI.save(drawingId, '
|
|
358
|
+
return solidAPI.save(drawingId, 'ofb');
|
|
359
359
|
});
|
|
360
360
|
},
|
|
361
361
|
scale: (target, pointOrFactor) => {
|
|
File without changes
|