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: 3,890 PRO
edited April 2019 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,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "endDepth" : distance<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });

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 Member, Developers Posts: 3,890 PRO
    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: 3,890 PRO
    edited April 2019
    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: 3,890 PRO
    edited April 2019
    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?
    <br><div><strike>else if (definition.endType == EndType.UP_TO_VERTEX)</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; {</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opExtrude(context, id + "extrude", {</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "direction" : slotPointPlane.normal,</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "endBoundEntity" : qNthElement(definition.upToVertex, 0)</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br></strike><div><strike>else if (definition.endType == EndType.SYMMETRIC)</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; {</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opExtrude(context, id + "extrude", {</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "direction" : slotPointPlane.normal,</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "endBound" : BoundingType.BLIND,</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "startBound" : BoundingType.BLIND,</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "endDepth" : distance</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</strike></div><div><strike>&nbsp; &nbsp; &nbsp; &nbsp; }</strike></div></div>
    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: 3,890 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, OS Professional, Developers Posts: 2,034 EDU
    @john_mcclary
    What are you making?
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 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: 3,890 PRO
    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.