@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.
@@ -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
- return CCClasses.CCLinearDimension;
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
- return this.resolve(async ([...rNodes]) => {
288
- const nodesToAdd = [];
289
- rNodes.forEach(node => {
290
- const globalTransformation = getGlobalTransformation(drawingId, node.ownerId, node.transformation) || node.transformation;
291
- nodesToAdd.push([node.productId, node.ownerId, globalTransformation, node.name]);
292
- });
293
- return ccAPI.assemblyBuilder.addNodes(drawingId, nodesToAdd);
294
- }, ...nodes);
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
- if (dim.dimParam.dimOrientation !== undefined && dim.dxfView !== undefined) {
300
- const dimParam = [
301
- rProductId,
302
- [
303
- dimensionType || 'CC_LinearDimenion',
304
- dim.dimParam.dimName || 'Dimension',
305
- dim.dimParam.dimLabel,
306
- dim.dimParam.dimValue || null,
307
- dim.dimParam.dimStartPos,
308
- dim.dimParam.dimEndPos,
309
- dim.dimParam.dimTextPos,
310
- dim.dimParam.dimTextAngle,
311
- dim.dimParam.dimOrientation,
312
- dim.dimParam.dimColor || 256,
313
- dim.dimParam.dimLayer || '1',
314
- ],
315
- dim.dxfView,
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
- return this.resolve(async ([...rDimensions]) => {
323
- const dimsToAdd = [];
324
- rDimensions.forEach(dim => {
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
- if (dim.dimParam.dimOrientation !== undefined && dim.dxfView !== undefined) {
327
- dimsToAdd.push([
328
- dim.productId,
329
- [
330
- dimensionType || 'CC_LinearDimenion',
331
- dim.dimParam.dimName || 'Dimension',
332
- dim.dimParam.dimLabel,
333
- dim.dimParam.dimValue || null,
334
- dim.dimParam.dimStartPos,
335
- dim.dimParam.dimEndPos,
336
- dim.dimParam.dimTextPos,
337
- dim.dimParam.dimTextAngle,
338
- dim.dimParam.dimOrientation,
339
- dim.dimParam.dimColor || 256,
340
- dim.dimParam.dimLayer || '1',
341
- ],
342
- dim.dxfView,
343
- ]);
344
- }
345
- });
346
- return ccAPI.drawing2D.addDimensions(drawingId, dimsToAdd);
347
- }, ...dimensions);
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 color = (viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.color) ? viewOptions.color : 256;
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
- const viewPositionParams = [];
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, [rMatePath1, rWcs1, mate1.flip, mate1.reoriented], [rMatePath2, rWcs2, mate2.flip, mate2.reoriented], xOffsetParam, yOffsetParam, zOffsetParam);
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, [rMatePath1, rWcs1, mate1.flip, mate1.reoriented], [rMatePath2, rWcs2, mate2.flip, mate2.reoriented], xOffsetParam, yOffsetParam, zOffsetParam);
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 e_1, _a;
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 = [constr.xOffset, typeof constr.xOffset === 'string'];
630
- const yOffsetParam = [constr.yOffset, typeof constr.yOffset === 'string'];
631
- const zOffsetParam = [constr.zOffset, typeof constr.zOffset === 'string'];
632
- constrToAdd.push([
633
- rConstrId,
634
- [rMatePath1, rWcs1, constr.mate1.flip, constr.mate1.reoriented],
635
- [rMatePath2, rWcs2, constr.mate2.flip, constr.mate2.reoriented],
636
- xOffsetParam,
637
- yOffsetParam,
638
- zOffsetParam,
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 (e_1_1) { e_1 = { error: e_1_1 }; }
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 (e_1) throw e_1.error; }
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, [rMatePath, rWcs1, mate1.flip, mate1.reoriented], xOffsetParam, yOffsetParam, zOffsetParam);
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, [rMatePath, rWcs1, mate1.flip, mate1.reoriented], xOffsetParam, yOffsetParam, zOffsetParam);
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 e_2, _a;
674
- const constrToAdd = [];
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 = [constr.xOffset, typeof constr.xOffset === 'string'];
681
- const yOffsetParam = [constr.yOffset, typeof constr.yOffset === 'string'];
682
- const zOffsetParam = [constr.zOffset, typeof constr.zOffset === 'string'];
683
- constrToAdd.push([
684
- rConstrId,
685
- [rMatePath, rWcs1, constr.mate1.flip, constr.mate1.reoriented],
686
- xOffsetParam,
687
- yOffsetParam,
688
- zOffsetParam,
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 (e_2_1) { e_2 = { error: e_2_1 }; }
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 (e_2) throw e_2.error; }
727
+ finally { if (e_4) throw e_4.error; }
698
728
  }
699
- await ccAPI.assemblyBuilder.updateFastenedOriginConstraints(drawingId, constrToAdd);
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 = isExpr ? DataType.REAL : getDataType(mem.value); // TODO: Aktuell nur Real Werte als Expression
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([mem.name, featureAPIParam, dataType]);
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 wARefs = rReferences;
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, wARefs, positionParam, directionParam, local);
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 wCSRefs = rReferences;
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, wCSRefs, coordinateSystem, offsetParam, rotationParam, inverted, local);
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 wPRefs = rReferences;
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, wPRefs, offsetParam, angleParam, positionParam, normalParam, local);
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 wPTRefs = rReferences;
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, wPTRefs, positionParam, local);
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 STrings
1139
+ const isExpr = typeof mem.value === 'string'; // TODO Expression unterscheiden von normalen Strings
1144
1140
  const featureAPIParam = {
1145
1141
  value: mem.value,
1146
- isExpr: isExpr,
1142
+ isExpr,
1147
1143
  };
1148
- membersToModify.push([mem.name, featureAPIParam]);
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 STrings
1161
- membersToModify.push([mem.name, [mem.value, isExpr]]);
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, 'of1', true);
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, 'of1');
358
+ return solidAPI.save(drawingId, 'ofb');
359
359
  });
360
360
  },
361
361
  scale: (target, pointOrFactor) => {
File without changes