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.

create sketch feature script

CoreyCorey Member Posts: 12 EDU

I have a feature script that creates a new sketch and a set of geometries at a selected point of an existing sketch or feature. I would like to be able to add the sketch geometry to a current and active sketch. I could import a DFX, but this would be a static set of lines and objects. My current feature script dynamically creates the features via the wizard options. Using the DFX option, I would need to create all the options.

My feature script is here and alows the user to pick what motor they will be using and how many holes to add for the motor mount along with adding to the bose diameter if desired.

https://cad.onshape.com/documents/560724c751b793055299f037/w/aa4ce9a3e6bfa89de52eca63/e/f8181e56363c4c8cac6a01ec

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,827 PRO

    FeatureScript can't add to an existing sketch. FS could copy a sketch or sketch entities. You could do this with the API, but that would be a lot of work. I suspect whatever you are trying to do in the end is possible with FeatureScript. What is your end goal?

    On a similar note, here are two resources I highly recommend if you are getting into FeatureScript:

    FeatureScript Fundamentals by Onshape

    FeatureScript Video Tutorials by CADSharp

    .


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.