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.

GeometryType.SURFACE error

Guest_ZephaltoGuest_Zephalto Member Posts: 2 PRO

Hello,

I was trying to implement a function to select a gore created by a loft, and i wanted the user to select the different gores to add an offset surface. But when I add the GeometryType.OTHER_SURFACE, I have this error.

I heard about using qGeometry but I don't know how to use it and when.

If someone can help me, thank you.

Tagged:

Best Answer

  • GregBrownGregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 288
    Answer ✓

    You can make a query for the lofted walls:

    const qLoftedWalls = qGeometry(qOwnedByBody(definition.selectedBody, EntityType.FACE), GeometryType.OTHER_SURFACE);

    But this is not in the precondition of the feature… in my example the definition.selectedBody was just the query for a EntityType.BODY, but it could already be a query in your code.

Answers

  • GregBrownGregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 288
    Answer ✓

    You can make a query for the lofted walls:

    const qLoftedWalls = qGeometry(qOwnedByBody(definition.selectedBody, EntityType.FACE), GeometryType.OTHER_SURFACE);

    But this is not in the precondition of the feature… in my example the definition.selectedBody was just the query for a EntityType.BODY, but it could already be a query in your code.

Sign In or Register to comment.