Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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
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!
Tagged:
9

Comments
Smart idea, Evan. You might also consider allowing array of query inputs as iteration input, so that it could consume multi-entity seed queries
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?
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
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
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
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.
Derek Van Allen | Engineering Consultant | MeddlerAdd qSomething and we'll see
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
@S1mon Yep! Try pairing it with face curves to split it to make a grid and iterate on that
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
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.
Derek Van Allen | Engineering Consultant | Meddler@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
@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.
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.
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
Thanks, Romeo!
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
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.
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 🔴
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.
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
Tangent Connected seemed to behave as I expected. Thanks!
@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
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.
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
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.
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
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
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!