qCreatedBy(sketch_id, EntityType.EDGE) returns more edges than I drew

jiahao_lee103
jiahao_lee103 Member Posts: 14 EDU
edited December 2024 in Community Support

I drew a sketch with 11 edges, but qCreatedBy(sketch_id, EntityType.EDGE) returned 24 edges, and I parsed these edges and found that some of them were overlapping (all parameters were the same, except for deterministicId). Why is this happening? What are these "copied edges" used for?

Best Answer

  • lana
    lana Onshape Employees Posts: 782 image
    Answer ✓

    Since you are talking about edges I'll assume you've used qCreatedBy(sketch_id, EntityType.EDGE). Sketch creates wire bodies corresponding to sketch curves, but also sheet bodies imprinted on plane (only if there are closed regions). You can use qCreatedBy(sketch_id, EntityType.EDGE)→qBodyType(BodyType.WIRE) to get only wire edges.

Answers

  • lana
    lana Onshape Employees Posts: 782 image
    Answer ✓

    Since you are talking about edges I'll assume you've used qCreatedBy(sketch_id, EntityType.EDGE). Sketch creates wire bodies corresponding to sketch curves, but also sheet bodies imprinted on plane (only if there are closed regions). You can use qCreatedBy(sketch_id, EntityType.EDGE)→qBodyType(BodyType.WIRE) to get only wire edges.

  • joshtargo
    joshtargo Member Posts: 695 EDU

    does the arrow behave the same as a UNIX "|" pipe command? Essentially it says take the output of the previous thing and use it as the input of the next thing?

  • lana
    lana Onshape Employees Posts: 782 image

    "use it as the first argument of the next function" Look for → here