Home› General

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.

🚨 Custom Feature Alert 🚨 Query Pattern

EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO
edited January 17 in General

Get the feature here.

Query Pattern performs a feature pattern, but swaps out the input query every time it loops, allowing you to perform the same operations on very different faces, edges, bodies, etc. Here's how it works!

Evan Reese
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
«1

Comments

  • Konst_ShKonst_Sh Member Posts: 137 PRO

    Smart idea, Evan. You might also consider allowing array of query inputs as iteration input, so that it could consume multi-entity seed queries

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    Thanks, Konstantin! Do you mean so that you could, for example, have one seed for an edge and another for a face or something? What scenario do you have in mind?

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Konst_ShKonst_Sh Member Posts: 137 PRO

    For example if the seed would need to be a union of edges for fill surface feature and would want to poppulate it across array of edge loops that wouldn't be possible currently, because its iterating through individual entities

  • S1monS1mon Member Posts: 4,022 PRO

    Once again, @EvanReese adds amazing functionality that I'd love to see in the first party tools. There's a lot to digest here, but I'm looking forward to doing things that used to be more something that you needed Rhino+Grasshopper to do.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 781 PRO

    When I did the update to Query Variable Plus to add qEverything I thought about putting qNothing in there as bait to see what @EvanReese would do with setting a query variable to nothing. I pictured something like this.

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    Add qSomething and we'll see

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    @S1mon Yep! Try pairing it with face curves to split it to make a grid and iterate on that

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 781 PRO

    OOH, that'd be a slick way to get around some frames limitations too where complex junctions aren't supported out of the box. I gotta try that.

  • S1monS1mon Member Posts: 4,022 PRO

    @EvanReese I could see a version of attractor pattern that just creates a series of points or mate connectors for the centers of some feature which could then be patterned with query pattern.

    The Face curves idea is great for things that want to be in a grid like pattern on a surface, but to get the triangular pattern we’ll need something else.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • romeograhamromeograham Member, csevp Posts: 744 PRO

    @EvanReese - this is another great custom Feature and video. Your dual powers of developer and educator are so valuable to this community! Thanks again for your well-considered features.

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    I could too… These are experiments I've had that could certainly get wrapped into that feature. First though I want to update how the grid works so it's edge to edge and works on periodic surfaces.

    image.png image.png image.png
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    Thanks, Romeo!

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • romeograhamromeograham Member, csevp Posts: 744 PRO

    Not sure I understand how to use something other than a sketch to create faces. When I use a Split feature (Split > Face > use sketch), Query variable (faces created by the split) doesn't see all the resulting faces as individuals. It seems to show a single face.

    Is there a different way to get QV (or QV+) to see the split faces as individuals, so that Query Pattern can iterate over them?

    Maybe I have to create more intermediate geometry (like the mold example in the video) to create the geometry/selections to iterate on.

  • MichaelPascoeMichaelPascoe Member Posts: 2,800 PRO

    Really cool stuff here @EvanReese!

    .


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    â–šâ–žâ–šâ–žâ–šâ–žâ–šâ–žâ–š
    ________________________________________________________________________
  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    unintuitively enough using Split on a face doesn't "create faces". The original feature that made the face you split is the one that is considered The Creator. You could use "Tangent connected" or "Bounded faces" to get them probably.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • romeograhamromeograham Member, csevp Posts: 744 PRO

    Tangent Connected seemed to behave as I expected. Thanks!

  • RhettRobinsonRhettRobinson Member Posts: 195 ✭✭✭
    edited January 22

    @EvanReese I seem to be running up against a snag when there are multiple layers of query variables needed, in my case a selection of a body and the selection of faces for a mate connector as the center to scale around. Here is my quick example of how I would manually do it, but it is very repetitive and would be much worse with multiple bodies. Does this need to be split into multiple query patterns, or am I missing something obvious?https://cad.onshape.com/documents/f76af8bed77ad61345607d2a/v/206a302bc6051fdcdbe6c29b/e/2b6dd75d1ccb814edcaf6338?configuration=List_0ksegPyCGIORCG%3D_1&renderMode=0&tangentEdgeStyle=1&uiState=69715ad8812780a1a20f8f46

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    You'd need to find a way to reliably generate a QV from the input body that captures the face you need. Think hard about the criteria there (is it farthest in a direction? Always an extrude end cap? always the biggest? always adjacent to something else? etc). You could feed that into the multi-mate connector feature and pattern it all. I do a lot of that kind of thing in the second half of the video posted above.

    You could certainly pattern one Query Pattern feature inside another, but I've not tried it.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • RhettRobinsonRhettRobinson Member Posts: 195 ✭✭✭

    I have a Query Variable+ selection to select the end cap entities, so it appears I need to go back through your video and see what else you did there. I will admit that once you started the second half of the video a lot of what you were doing went over my head haha.

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    Yeah always a risk but I went there haha! Essentially you need to find a way to query the face for the scale MC as it relates to the input query and nothing else. In your case the input is the sketch face that creates the extrude and everything else. Here's an example.

    https://cad.onshape.com/documents/654daad06368d6696966fd46/w/40f1fd8817196e3d87f661e3/e/7b4ba41a5585441160393dc0

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • RhettRobinsonRhettRobinson Member Posts: 195 ✭✭✭

    Watching your video again makes more sense, I must have had a fried brain at the end of work yesterday. I realized digging into it that I didn't need to query a face after the body selection but could jump straight to the body. I think that extra layer was getting me twisted around. Thanks for the help, this is such a cool feature!

    image.png
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 781 PRO

    Apparently I should have watched the video tutorial for this feature sooner. @EvanReese just peppering in improvement requests for QV+ every couple of minutes. Most of them seem like pretty easy asks to implement in a future version.

    I have a request of my own for Query Pattern, would it be possible to change the input field for the seed QV name to a feature input so you can select the QV from the drop menu? That way when names are changed everything dynamically updates downstream. I recognize this opens the door to allowing selection of non-QV features for an input but I just implemented something similar to QV+ where you can target non-derive features for the new functionality, but it'll just return nothing.

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    lol that's on me. I could at least have let ya know. Oh well, better than muttering the requests to myself under my breath while I work.

    The feature input is interesting, but what would happen if someone picked a custom feature that made more than one QV? Maybe not an edge case worth caring about. I also thought about making it a normal query param, which would solve your issue, but that would open users up to adding all kinds of wrong things. Confusion ensues.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 781 PRO

    I started just adding pop up messages to my features that explain unexpected behavior when someone wants to edge case me. Although that does require me to expect the unexpected before hand. I do wish there was a way to sort by feature type for some inputs but a warning message with a heads up does the job alright as long as your users are paying attention.

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    Yep that's a very workable solution. I'll think on it more when I have time

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO
    edited February 16

    @RhettRobinson I finally got around to making that video from your example. I realized that the solution we had before was overcomplicated anyway. This one is very simple.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • RhettRobinsonRhettRobinson Member Posts: 195 ✭✭✭

    @EvanReese this is excellent, thanks for following up with this!

  • zoltan_nemeth973zoltan_nemeth973 Member Posts: 5 ✭

    I might have run into some limitations here. At least, I couldn't make Query Pattern work with Move Face. I have created a very simple example in which I do a Move Face on the cilindicar face of a disc, and then, I try to repeat the same operation on a series of discs with the Query Pattern feature:

    Screenshot 2026-02-18 162243.jpg

    Interestingly enough, if I try to achieve the same using the Linear Pattern-loop trickery you showcased in a previous video of yours, @EvanReese , it doesn't work with MoveFace either. See the "Test loop with Linear pattern"-folder: https://cad.onshape.com/documents/4a142ce31429dae12b75a3dc/w/6a2a2436caf0724cd2e8bba1/e/4d0d163eb0dbc691eee210ea

  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    That's odd. I'm not sure what's going on there. I see you've already looked at the Query Nth Element feature, and if you cycle through the index there it works, but the pattern doesn't do it. I also found that Thicken works with the exact same setup. It really does smell like we found some edge case that (understandably) wasn't imagined/prioritized in the standard code. It feels like it ought to work.

    Feb-18-2026 10-03-16.gif
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,845 PRO

    You've got it, man!

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
Sign In or Register to comment.