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.

SELECTING FROM THE FEATURE TREE

papawopapawo Member, Developers Posts: 206 PRO
Is it possible to select a derived feature in the feature tree without user selecting it?
Tagged:

Best Answer

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 497
    Accepted Answer
    Generally, FS features are not aware of feature history, only the geometry those features created, so the technical answer is no. Geometric queries and evaluations are much more robust to different user workflows, and much more transparent to the end user.

    If you don't intend for your feature to be used in a Part Studio with irrelevant geometry, you can simply query for all geometry that said feature will have created, e.g.
    const existingParts = qBodyType(qEverything(EntityType.BODY), BodyType.SOLID);
    const existingSurfaces = qBodyType(qConstructionFilter(qEverything(EntityType.BODY), ConstructionObject.NO), BodyType.SHEET); // Includes sketches but not default planes
    

Answers

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 497
    Accepted Answer
    Generally, FS features are not aware of feature history, only the geometry those features created, so the technical answer is no. Geometric queries and evaluations are much more robust to different user workflows, and much more transparent to the end user.

    If you don't intend for your feature to be used in a Part Studio with irrelevant geometry, you can simply query for all geometry that said feature will have created, e.g.
    const existingParts = qBodyType(qEverything(EntityType.BODY), BodyType.SOLID);
    const existingSurfaces = qBodyType(qConstructionFilter(qEverything(EntityType.BODY), ConstructionObject.NO), BodyType.SHEET); // Includes sketches but not default planes
    

  • papawopapawo Member, Developers Posts: 206 PRO
    Thanks Kevin.
Sign In or Register to comment.