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.

Query filter MeshGeometry.YES not working

EvanReeseEvanReese Member, Mentor Posts: 2,307 ✭✭✭✭✭

I want to filter a query param for only mesh vertices. Here's what I have:

annotation { "Name" : "Mesh verticies", "Filter" : EntityType.VERTEX && AllowMeshGeometry.YES && MeshGeometry.YES } definition.points is Query;

But it's highlighting MeshGeometry.YES with the message "Unhandled enum type MeshGeometry". I get this even if it's the only filter enum I use.

Looking a the documentation for UI queries here it seems like it should work since MeshGeometry is on the list. What am I missing?

Evan Reese
Independent Onshape Consultant | Industrial Designer

Best Answers

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,201 PRO
    edited February 19 Answer ✓

    You could try this:

    annotation { "Name" : "Bodies", "Filter" : EntityType.VERTEX && AllowMeshGeometry.YES && !BodyType.POINT }
    definition.entity is Query;
    

    Oh wait, never mind. I was just checking against the origin..

    Looks like it isn't supported by annotations yet, or maybe unhandled? All of the other ones specify that they can be used in annotations.
    https://cad.onshape.com/documents/12312312345abcabcabcdeff/v/6d1c0e255e851eaf6831cf72/e/9fde5dffaf8d4e4c99aaa22c

    Perhaps it's only to be used with:

    qMeshGeometryFilter(queryToFilter, MeshGeometry.YES)
    

    You could always use some edit logic to get rid of non mesh points as they are clicked.


    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,307 ✭✭✭✭✭

    Thanks Michael. I'm not sure what "unhandled" actually means. I considered the Editing Logic solution, but I hoped to avoid it. I'll probably just leave it as is for now.

    Evan Reese
    Independent Onshape Consultant | Industrial Designer
  • EvanReeseEvanReese Member, Mentor Posts: 2,307 ✭✭✭✭✭

    @ilya_baran I hope I'm not bothering you with unimportant things, but the list of possible filters for Query Params in the documentation here does include MeshGeometry so at some point it should be made to work, or removed from the list.

    Evan Reese
    Independent Onshape Consultant | Industrial Designer
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,230
    Answer ✓

    I'll fix the doc — thanks for pointing out.

    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • EvanReeseEvanReese Member, Mentor Posts: 2,307 ✭✭✭✭✭

    Just following up here for posterity. After looking at the Constrained Surface code in the standard library, it seems like we can filter out non-mesh geometry with !AllowMeshGeometry.NO which is what I was going for.

    Evan Reese
    Independent Onshape Consultant | Industrial Designer
  • MichaelPascoeMichaelPascoe Member Posts: 2,201 PRO

    Shouldn't !AllowMeshGeometry.NO be the same thing as AllowMeshGeometry.YES or am I missing something?


    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,307 ✭✭✭✭✭
    edited March 25

    It feels like a double negative, but it seems like AllowMeshGeometry.YES will is "all bodies, including mesh ones" and AllowMeshGeometry.NO is "all bodies excluding mesh ones" while !AllowMeshGeometry.NO seems to be "only mesh bodies". There's a venn diagram in there somewhere.

    Evan Reese
    Independent Onshape Consultant | Industrial Designer
  • MichaelPascoeMichaelPascoe Member Posts: 2,201 PRO
    edited March 25

    I guess this means that AllowMeshGeometry.NO isn't the opposite of AllowMeshGeometry.YES… 😩


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
Sign In or Register to comment.