opSplitFace - Invalid Input

emory_krall
emory_krall Member Posts: 15 PRO
I hoping someone can explain to me why this script is failing:


Ultimately this is to be part of a more complicated script. I wrote this simple script to troubleshoot and apparently I don't understand what opSplitFace is expecting for "faceTargets" and "bodyTools". I've tried to specify the input faces a few different ways but haven't had any success yet.





Best Answer

Answers

  • emory_krall
    emory_krall Member Posts: 15 PRO
    This did work, although documentation for opExtractSurface was difficult to find. If anyone comes across this discussion in a search for help here is the code that worked:

     opExtractSurface(context, id + "extract", {"faces" : splittingFace});
     opSplitFace(context, id + "splitFace1", {
                    "faceTargets" : targetFace,
                    "bodyTools" : qCreatedBy(id + "extract", EntityType.BODY)
            });

  • Jake_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    edited September 2019
    Thanks for pointing out that `opExtractSurface` is hidden from documentation.  We will fix this up soon.
    Jake Rosenfeld - Modeling Team
  • Jake_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    @emory_krall

    Instead of extracting you can actually use the "faceTools" field into opSplitFace rather than the "bodyTools" field.  I'll have to go update that documentation too...
    Jake Rosenfeld - Modeling Team