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.

Are sketch operations like "offset" or "split" available in featurescript?

ron_morelandron_moreland Member Posts: 79 ✭✭
Are sketch operations like "offset" or "split" available in featurescript?
Tagged:

Best Answers

Answers

  • ron_morelandron_moreland Member Posts: 79 ✭✭
    Answer ✓
    I believe the featurescript "source" is available. Can I use that as a guide? Where can I find it?
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    You can work around this limitation by offsetting surface geometry or faces instead. In my End Flange feature, I orginally wanted to create the flange by converting the end face into a sketch and then offsetting the outer edges. Turns out that isn't a simple prospect in FS. So I instead just extruded off a face, found the outer faces of the extrude, and used moveFace to offset those faces. Writing that FS was a good lesson in effectively using queries.

    Using surface/solid bodies as construction tools sounds messy, but as long as you opDelete the bodies when you're done, no harm no foul.
  • ron_morelandron_moreland Member Posts: 79 ✭✭
    Yes, I'm changing my approach and looking to do something similar. I'll look at "End Flange"
    There are a lot of very good tools. I have to look at what's there and wish for what isn't.

    Thanks.
  • ron_morelandron_moreland Member Posts: 79 ✭✭
    Mahir,
    I used Flange.fs as a starting place and my script works decently well, thanks for the work you put in. I have a question about your script. When you look for faces to move you did this:

                //Find the set of outer boundary faces to be moved/offset by
                //finding the largest bounding box of faces adjacent to cutter start face
    Can you explain this? Why not use just the faces adjacent to the start cap? or all the faces except the start cap?
  • mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    edited January 2018
    @ron_moreland,
     
    Because just querying for adjacent faces might give me the inner boundary instead of the outer boundary. The purpose of the FS was to create a flange that was an offset of the outer edge of the selected face, leaving the inner edge the same. If I wanted to offset all the faces, then this step wouldn't be necessary. For example, if I selected the end of a hollow tube, I wanted to make sure I was using the surface corresponding to the outer diameter, not the inner diameter.

    In a future iteration of the FS, I'm thinking of letting the user individually select the inner and outer offset. In doing that, I would still need to separate out the inner and outer boundary, so this bounding box check will stay regardless.
  • ron_morelandron_moreland Member Posts: 79 ✭✭
    Got it! I my case just moving the adjacent faces would work since the shape I work with has only outer faces.
Sign In or Register to comment.