FeatureScript Mirror Merge Scope?

dylan_mckillip
dylan_mckillip Member Posts: 7 ✭✭
Hello,
    I am attempting to mirror a 3D body about a plane and when I do it creates a whole new part. Is there a way in the definition to specify a merge scope? Or select add instead of new like the UI.

sample code below:
enclose(context, id+"enclose2", {
                    "entities": qUnion([qCreatedBy(d8planeId+"0", EntityType.BODY), midplaneQuery])
            });
            
            mirror(context, id + "mirror1", {
                "patternType" : MirrorType.PART,
                "entities" : qCreatedBy(id +"enclose2", EntityType.BODY),
                "mirrorPlane" : qParallelPlanes(qBodyType(qEverything(EntityType.FACE), BodyType.SHEET), plane(vector(0, 0, 0) * centimeter, vector(0, 0, 1), vector(1, 0, 0))),
                
            //IS THERE SOME DEFINITION LIKE "mergeScope" THAT I CAN ADD HERE?
            });
Thanks in advance!

Answers

  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,116 image
    You must do it as a separate operation using opBoolean. 
    Senior Director, Technical Services, EMEA
  • dylan_mckillip
    dylan_mckillip Member Posts: 7 ✭✭
    I solved it. You need to add 
     "operationType": NewBodyOperationType.ADD,
    To the Mirror definition