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.

Why can't I extrude new into an existing piece?

donna_nodadonna_noda Member Posts: 2
I'm planning to create an auto webbing Featurescript, but I first need to extrude a sketch region into the part to be webbed to the same thickness. I figured extruding the sketch region as a new part up to face of the other side of the part would work, since that's what I'd do if I were to CAD this by hand. However, I am given the following error: "Failed to extrude selections, check input". What am I doing wrong here?


Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,310
    Try flipping the direction normal - an up to face bound will fail if the extrude is going in the wrong direction
    Senior Director, Technical Services, EMEAI
  • donna_nodadonna_noda Member Posts: 2
    I added "isStartBoundOpposite" : true (and tried false as well), but it still returns the same error message. Is there another way to flip the direction of the extrude?
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,310
    edited January 2018
    I don’t think that will make any difference. Just multiply your “direction” by -1.

    Also you don't need "startBoundEntity".
    Senior Director, Technical Services, EMEAI
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    You also don't need "bodyType".  The "NewBodyOperationType" input is usually taken in as "operationType" (not "bodyType"), but it is only used with Onshape Features (extrude(...), sweep(...), loft(....), etc), not the low level operations (opExtrude(...), opSweep(...), opLoft(...), etc).  These low level operations will always return new bodies, and you must boolean those bodies into the desired geometry by hand.  If you want this to happen automatically, you can use the 'extrude(...)' call with 'operationType' and 'mergeScope' specified.

    If this continues to not function the way you expect, please post a link to your document here and we can take a poke around to see what's going on.

    I think the best way to guarantee that your direction if robust would be to do the following:
    const skPlane = evOwnerSketchPlane(context, { "entity" : definition.webbingArea });
    const endFacePoint = evFaceTangentPlane(context, { "face" : definition.endFace, "parameter" : [0.5, 0.5] }).origin;
    
    var direction = skPlane.normal;
    var skPlaneToEndFace = endFace.origin - skPlane.origin;
    if (dot(direction, skPlaneToEndFace) < 0)
    {
        direction = -1 * direction;
    }<br>
    This should make sure that your direction is facing towards the end face.
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.