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.

@opDraft: Map does not contain field 'queryType'

brian_guanbrian_guan Member Posts: 10
I am trying to use opDraft in feature script but I am getting a weird error:

 @opDraft: Map does not contain field 'queryType'

I don't see anywhere in the documentation what this queryType is in opDraft, so I took a guess a supplied something but the error remains.

Here's the code snippet:

export const XZ_PLANE = plane(vector(0, 0, 0) * meter, vector(0, 1, 0));

annotation { "Feature Type Name" : "BadDraft" }
export const BadDraft = defineFeature(
    function(ctx is Context, id is Id, args is map)
    precondition {
    } {
        fCuboid(ctx, id + "cube4draft", {
                "corner1" : vector(0, 0, 0)*inch,
                "corner2" : vector(10, 1, 2)*inch
        var _qFace = qIntersectsPlane(
            qParallelPlanes(qCreatedBy(id + "cube4draft", EntityType.FACE), XZ_PLANE, false),
        opDraft(ctx, id + "draftRib", {
                "neutralPlane" : XY_PLANE,
                "pullVec" : XY_PLANE.normal,
                "draftFaces" : _qFace,
                "angle" : 30 * degree,
                "queryType": QueryType.TRANSIENT

I have created an example public doc to show the problem, can someone enlighten me please?



  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 963
    This is an unfortunately poor error message on our part.  I believe the problem is that neutralPlane expects a query, but you are passing a plane.  (and it's looking for queryType in the passed in plane and not finding it).  If you pass a qCreatedBy(newId() + "Top", EntityType.FACE) for the neutralPlane, I think it should work.  No need to include queryType in the opDraft definition.  The opDraft documentation has the definition types listed.  Hope this helps.
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
  • brian_guanbrian_guan Member Posts: 10
    Thank you, that helped.  Now my draft is working...
Sign In or Register to comment.