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.

opExtrude opposite direction

john_mcclaryjohn_mcclary Member, Developers Posts: 2,033 PRO
edited April 28 in FeatureScript
How can you set the opposite direction of opExtrude for a blind cut?

opExtrude(context, id + "extrude", {
                        "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),
                        "direction" : slotPointPlane.normal,
                        "endBound" : BoundingType.BLIND,
                        "endDepth" : distance
                    });

i see there is an opposite direction in extrude() but that just fails completely when i change opExtrude to extrude

Best Answers

  • john_mcclaryjohn_mcclary Posts: 2,033 PRO
    Accepted Answer
    @MBartlett21 jumped into my script and fixed it up, Thanks

    Now that it is complete: anyone who wants to use it, here you go
    https://cad.onshape.com/documents/5afccd5ef566ebe0825bd897/w/395df9e1dbce13694707fcc6/e/6d242fc93553ab288e2447ae

    It lets you create a slot similar to SW's hole wizard
    You select points (or mate implicit mate connectors)
    Then set the diameter
    Then the length (center to center)
    Then a direction (in this case they are following the diagonal line)

    I've been using it for a long time now, works great. Now that it is complete I've made it public.


Answers

  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,033 PRO
    edited April 28
    Thanks @kevin_o_toole_1 that worked

    yea, that was the first thing I tried, and I must have had a typo, because it would just turn fail and turn the feature red... so i've been chasing my tail looking for an alternative way....

    I get the same problem when I tried to use isStartBoundOpposite..

    That's one end bound down... now i need to get symmetric, up to face, up to vertex, through all (in only one direction, not both directions)... 
  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,033 PRO
    edited April 28
    That got me heading down the right track, now all that remains to  be fixed is symmetric and up to vertex.

    What am I doing wrong?

    else if (definition.endType == EndType.UP_TO_VERTEX)        {            opExtrude(context, id + "extrude", {                        "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),                        "direction" : slotPointPlane.normal,                        "endBoundEntity" : qNthElement(definition.upToVertex, 0)                    });        }

    else if (definition.endType == EndType.SYMMETRIC)        {            opExtrude(context, id + "extrude", {                        "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),                        "direction" : slotPointPlane.normal,                        "endBound" : BoundingType.BLIND,                        "startBound" : BoundingType.BLIND,                        "endDepth" : distance                    });        }

    Edit:
    That didn't format correctly, here is an image of what It looks like in the post editor:

  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,033 PRO
    Oh I see I was missing "startDepth" for Symmetric... that's working now

    All I need is up to vertex and I'm good
  • MBartlett21MBartlett21 Member Posts: 1,624 EDU
    @john_mcclary
    What are you making?
    MB - I make FeatureScripts: view FS (My FS's have "Official" beside them)
  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,033 PRO
    @MBartlett21 I'm finishing up an older script. Bolt Slot

    I'll share it with you if you want to look at it.
    All thats left is up to vertex end condition
  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,033 PRO
    Accepted Answer
    @MBartlett21 jumped into my script and fixed it up, Thanks

    Now that it is complete: anyone who wants to use it, here you go
    https://cad.onshape.com/documents/5afccd5ef566ebe0825bd897/w/395df9e1dbce13694707fcc6/e/6d242fc93553ab288e2447ae

    It lets you create a slot similar to SW's hole wizard
    You select points (or mate implicit mate connectors)
    Then set the diameter
    Then the length (center to center)
    Then a direction (in this case they are following the diagonal line)

    I've been using it for a long time now, works great. Now that it is complete I've made it public.


Sign In or Register to comment.