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.

New FeatureScript: Pocket Holes

eisen_montalvoeisen_montalvo Member Posts: 3
Hi everybody,

I would like to share my first FeatureScript: Pocket Holes. The feature is very straight forward:
  1. Choose entry face
  2. Choose exit face
  3. Select vertices where the pocket holes will be created
  4. Select thickness of part that will have the pocket holes

You can find the FeatureScript here: https://cad.onshape.com/documents/5c9f5a0c9e9568a64f8fce0f/w/5f5fb2a214796377ad0d8f98/e/6290b4d3ef8ef9df035b121a  

Future improvements:
  1. Calculate thickness automatically from the part
  2. Add option to add mate connectors for screws

Let me know if you have any other ideas.

Comments

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,631
    Thanks @eisen_montalvo for posting your custom feature - here is my unfinished attempt: 
    https://cad.onshape.com/documents/06fec7e8ca6ea0debc1b30cc/w/d458179d8dece090228faee2/e/7e02268cde3b2bc764d68f52

    I was focused more on selection rather than correct hole sizing, but you will see that with a single edge selection it will work out which face is which and the thickness of the part and place a number of pocket holes. Please feel free to merge the two codes together to make a super custom pocket hole feature!

    Senior Director, Technical Services, EMEAI
  • bobtbobt Onshape Employees Posts: 7
    Checkout std/cylinerCast.fs. This is the utility function used in our hole drilling. It has facilities to measure the starting point for the back side drilling. If you and questions, feel free to ask.
  • eisen_montalvoeisen_montalvo Member Posts: 3
    Thank you @NeilCooke for sharing your code and showing me a different way of thinking and solving problems in FeatureScript.

    I went ahead and merged some of your code, added the mate connectors, and simplified the interface. Now 
    there are only three options: 
    1. Edge
    2. Application type (90 degrees or straight)
    3. Option to add the mate connector.
    The thickness and the location of the pocket holes are calculated automatically using the suggested distances from Kreg. I'm pretty sure the code can be optimized quite a bit. But for now, it does the job. I will optimize the script another day.

    Thank you @bobt for sharing the code. I need to dedicate some time to go through it. When I have questions, I will sure to ask.
  • lane_slabuaghlane_slabuagh Member Posts: 1
    @eisen_montalvo - how do I access your code?

    When I click it, it says the following:  "Failed to load document for workspace. Resource does not exist, or you do not have permission to access it."
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,206
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • eisen_montalvoeisen_montalvo Member Posts: 3
    edited July 2016
    I'm sorry Lane, I forgot to update the link after making some changes that Onshape requested. Thank you Ilya for replying with the correct link.
  • dave_odledave_odle Member Posts: 4
    edited July 2017
    THIS DOESN'T WORK ON SHORT PARTS UNDER 4 INCHES.
    IT LOCATES THE POCKET HOLES TOO FAR APART.
    ALSO IS THERE A WAY TO HAVE AN INPUT FOR THE NUMBER OF HOLES WE NEED ON A EDGE
    ALSO A DISTANCE WE CAN SET FROM THE OUTSIDE EDGE IN

  • brett_suttonbrett_sutton Member Posts: 42 ✭✭✭
    Agree with dave_odle, needs an option to control the distance between holes, inset from a second edge selection and finally a 'count' to control the no. of holes to cut starting from the inset edge.
    These three options (together with your current 'auto mode') would make this feature script perfect.

    Well done on the initial script though!
Sign In or Register to comment.