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.

How to have a Sketch as a parameter

nir_naronnir_naron Member Posts: 26 EDU
I’m not sure I’m getting the terminology correctly, but when I’m saying parameter I’m referring to the light-blue input boxes that are in the feature-menu that pops up when creating a new feature.

Say, in a Part Studio, I creat a new Extrude feature. I can either manually select entities to extrude (with my cursor), or I can click a sketch in the feature-tree, and the sketch’s faces get extruded. 

How can I set up a new parameter, in my own feature (using FeatureScript), to accept an entire sketch?

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO
    edited May 2024

    Hey @nir_naron, welcome to FeatureScript! To allow for the faces of an entire sketch to be selected, you can use this as a parameter:
    annotation { "Name" : "Entities", "Filter" :  EntityType.FACE }
    definition.entities is Query;


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • nir_naronnir_naron Member Posts: 26 EDU
    MichaelPascoe Thanks! Yeah it turns out I only needed to remove the MaxNumberOfPicks filter
Sign In or Register to comment.