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,776 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

Comments

  • Konst_ShKonst_Sh Member Posts: 120 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,776 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: 120 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: 3,886 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 Specialist | Open For Work

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 602 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,776 PRO

    Add qSomething and we'll see

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,776 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: 602 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: 3,886 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 Specialist | Open For Work

  • romeograhamromeograham Member, csevp Posts: 737 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,776 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,776 PRO

    Thanks, Romeo!

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • romeograhamromeograham Member, csevp Posts: 737 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,754 PRO

    Really cool stuff here @EvanReese!

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • EvanReeseEvanReese Member, Mentor Posts: 2,776 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: 737 PRO

    Tangent Connected seemed to behave as I expected. Thanks!

  • RhettRobinsonRhettRobinson Member Posts: 179 ✭✭✭
    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,776 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: 179 ✭✭✭

    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,776 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: 179 ✭✭✭

    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
Sign In or Register to comment.