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.

Query Finder (A new way to automate Onshape!) 🆕

MichaelPascoeMichaelPascoe Member Posts: 2,302 PRO
edited May 20 in FeatureScript

.

CadsharpSpin.gif CADSharp is introducing a new way to automate Onshape!
Actually, this isn't new, but it has never really been easily available for all users. (no coding required)
.

Query Finder
Save and use selections across features and even across part studios.
Use this functionality to automate your downstream selection process.

.

OppositeDirection.png Query Finder compatible features (More features to be added to this list!)
(Note for developers)Feel free to put the query finder in your own custom features. See (this example) of how to do it.

.

How to use the Query Finder:

(Step 1) Use the SetQuery.png Set query attribute feature to make a selection that you want to save for later.
This will create a variable with the name of your attribute which you can use downstream.

Note: Query Finder doesn't require you to set an attribute, you can change the QF search type to the following types of searches.

Supported search types include:

  • Everything: Searches the entire part studio.
  • Attribute: Searches only entities with the specified attribute attached to them. Easily set with the Set query attribute feature.
  • Feature: Searches selected features in the tree for specified entities.
  • Property: Searches only entities with the specified property and property value.
  • Identity: Searches entities that have had their identity set.
  • Transient ID: Searches for a specific transient id.

(Step 2) Click on the OppositeDirection.png Query Finder button to enable the query finder.

(Step 3) Input the selection variable that you created earlier in the tree. You could also type this attribute name manually like this: "toColor"

Query Finder Example.gif

.


Learn more about the Gospel of Christ  ( Here )

CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴

Comments

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 39 PRO

    In a similar vein to this I've been experimenting with modifications to some of the standard features to allow the user to select a previous feature as an input instead of strictly limiting things to geometry types. The amount of downstream rebuild power you get with a simple qCreatedBy() passing things between features is such a game changer that I think it should be supported across the entire function library

  • Caden_ArmstrongCaden_Armstrong Member Posts: 271 PRO

    Technically that is supported with standard features - its just not easily accessible.
    I've been working on a video essay on the subject, I can send it your way when its ready.

    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
  • MichaelPascoeMichaelPascoe Member Posts: 2,302 PRO
    edited May 20

    @Derek_Van_Allen_BD Nice, I agree. Hint's the query finder. I assume something like this will eventually be built into features, but why wait around to start automating, we have FeatureScript!

    The query finder also supports selecting entities via by the Feature they were created by, you don't have to use attributes and selections. Just change the search type to Feature.

    How to select entities via Feature:

    Query finder search type.gif

    .

    @Caden_Armstrong Sounds like a useful essay. I'd be interested in watching that as well. Onshape never fails to surprise me with neat functionality.

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • MichaelPascoeMichaelPascoe Member Posts: 2,302 PRO
    edited May 20

    Edit: I updated the original post to include this info now. But here it is anyways.

    In case any devs want to add the query finder to their own custom features:

    (Developer instructions) How to add the query finder to a custom feature:
    https://cad.onshape.com/documents/d3034e548950632e0b3bbbee/w/b6fafc29d9ca02da4231b2eb/e/3e136833ee73462…

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 39 PRO

    You're gonna blow my mind. Is there a shorthand explanation or will I have to wait for the video to find out?

  • S1monS1mon Member Posts: 3,311 PRO

    @MichaelPascoe

    I looked at the Logic Driven Feature and I don't see any documentation other than a link to the CADSharp site which doesn't seem to say anything about it. I can kinda tell what it's doing in the sample part studio, but I can't really understand why I would need it.

    I've played with Kevin O'toole's Query Explorer while trying to build my own custom feature, but it seems like your Query Finder goes well beyond that.

    I suspect I'm not the only one who could benefit from a more detailed walk through of how these all fit together and what problems they're trying to solve.

  • MichaelPascoeMichaelPascoe Member Posts: 2,302 PRO
    edited May 21

    .

    Ty for the feedback @S1mon, I should probably do a workflow video guide.
    Some of those have not officially been released yet, hints the lack of documentation.

    Logic Driven Feature is a feature that allows you to control its suppression with multiple configurations or via logical statements. It is many features packed into one, simply so you don't have to add 20 features to your toolbar. With this feature, you choose "Extrude" for example, and you now have an extrude with the option to use the query finder as well as suppress by logic.

    Query Explorer is a different concept. It is a way to figure out how to find queries without having to code it each time. Once you find the query you like, return to the code and implement it.

    Query Finder on the other hand, is less about exploring types of queries, and more about retrieving a query you have already set by the Set Query Attribute feature. It does still allow you to do some searching, but it's main purpose is not to explore but to retrieve a selection.

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
Sign In or Register to comment.