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: Query Variable+

Query Variable has been a game changer for more programmatic workflows that save me from needing to develop custom scripts when I can instead pass other existing features through a QV and get results that way. That being said, there are some more powerful querying techniques which haven't yet been added to the default Query Variable implementation that I'm taking some time to write into an extended toolset. For example: just about everything in the old Query Explorer feature could be used as a QV to enable more parametric workflows involving spatial, geometric, or directional filtering of your queries. My long term goal is to implement all of these Query Explorer features into the new Query Variable feature but I'm starting out small with a few easier lift features and will add more over time.
The first two features in my Query Variable+ implementation are the following:
Tangent(ish) Faces
This one is simple, the qTangentConnectedFaces() function in the standard library already has an overload which allows you to specify an angle tolerance for some flexibility in the definition of the word "tangent" so I just replaced the version in Query Variable with this angular tolerance version. This lets me flood select face groups from cursed not-mesh import geometry and use the selections to create patch faces and create new clean parametric surfaces without having a feature tree to work with.
This is not a mesh.
But with a little bit of curve approximation and resurfacing later it can become usable geometry again. Selecting groups of nearly tangent faces made this much easier to execute.
Matching Bodies
Query Variable comes with the ability to select matching edges or matching faces, why not matching bodies? Well the qMatching feature doesn't allow this selection type so that's why it's not allowed here, but there's a similar function called clusterBodies that does something close to this for cut list purposes. I leveraged this into a qMatchingBodies function that allows you to select a part and the function will return all parts in the studio that clusterBodies identifies as a geometric match for the input. (With some tolerance)
Useful for workflows where you're working with repetitive geometry that's not necessarily the result of a pattern, or if you've willfully ignored the "best practices" instructions of assembly modeling workflows and need to check that your parts actually are still copies of each other at the end of the tree.
Other features I'd like to implement into the list from Query Explorer:
- Geometry filters for face types
- Distance filters
- Direction filters
- Attribute filters for sheet metal and frames
- Cap entity filters
- …And more things I'm sure will be useful to someone at some point that I have yet to discover
Comments
YES! I'm glad you're taking this on. It needs to be a thing.
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com