Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

FeatureScript Mirror Merge Scope?

dylan_mckillipdylan_mckillip Member Posts: 7 EDU
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

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,305
    You must do it as a separate operation using opBoolean. 
    Senior Director, Technical Services, EMEAI
  • dylan_mckillipdylan_mckillip Member Posts: 7 EDU
    I solved it. You need to add 
     "operationType": NewBodyOperationType.ADD,
    To the Mirror definition
Sign In or Register to comment.