GeometryType.SURFACE error

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.

image.png
Tagged:

Best Answer

  • GregBrown
    GregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 412 image
    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

  • GregBrown
    GregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 412 image
    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.