Trouble with extrude

3966_cad
3966_cad Member Posts: 10 EDU
I am using extrude instead of opExtrude, but it keeps saying that the EXTRUDE_FAILED. 
 extrude(context, id + "extrude2", {
                "entities" : qSketchRegion(id + "sketch2"),
                "oppositeDirection" : true,
                "endBound" : BoundingType.UP_TO_BODY,
                "operationType" : NewBodyOperationType.REMOVE,
                "endBoundEntityBody" : qCreatedBy(id + "sketch2", EntityType.BODY)
        });
If anyone can help, it would be much appreciated. 
Here is the link.

Comments

  • kevin_o_toole_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    edited July 2017
    Two things I can see:

    On extrude1, I believe in "endDepth" : definition.length * inch, you should remove * inch, since definition.length already has length units.

    On extrude2, you seem to be extruding a sketch up to bodies from that same sketch, so the extrude depth is 0 everywhere. I'm not sure what your intention is but I assume that's not it?