How to have a Sketch as a parameter

nir_naron
nir_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

  • MichaelPascoe
    MichaelPascoe Member Posts: 2,959 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 - Photorealistic product rendering.
    CADSharp - Professional CAD + software consulting.

    ▚▞▚▞▚▞▚▞▚
  • nir_naron
    nir_naron Member Posts: 26 EDU
    MichaelPascoe Thanks! Yeah it turns out I only needed to remove the MaxNumberOfPicks filter