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.
Options
How can I determine the entity or geometry type of a selected entity?

Do I need to have a qGeometry for every possible type, or is there a way for it to just look at a query and tell me what it is?
0
Comments
check out:
evCurveDefinition
and
evSurfaceDefinition (context is Context, arg is map) returns map
Return a descriptive value for a face, or the first face if the query finds more than one. Return a
Cone
,Cylinder
,Plane
,Sphere
,Torus
, orBSplineSurface
as appropriate for the face, or an unspecified map value if the face is none of these with surfaceType filled of type SurfaceTypeI was hoping there was a function that simply tells you what kind of entity something is. I want the user to be able to click on a vertex, edge, arc, circle, or face, but the processing is different depending on which one it is.
@joshtargo Well, there is, it's qEntityType. But that gets you one of the following: Vertex, Edge, Face, or Body. If you want it to return the geometry type, you could do qGeometryType. If you want the body type then qBodyType. I recommend making a custom function to use all of them together to return a custom type from a custom enum. You can do the initial filtering with qEntityType, then from there use evCurveDefinition or evSurfaceDefinition to get specifics.
I imagine you could do it in 10 minutes 😎. Then save it to your FS library where you can import it and re-use it per project.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Do t I need to use the specific types I'm looking for as arguments for those functions? I wanted something that returns "vertex" or "arc"
If you want the query for specific entity types, you can do something like this:
For finding an arc it could be more like this:
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
its similar to what I ended up doing, I guess there is no built in function that returns an entity type, which seems strange.