Annotation filters - what should I expect to work?

traveler_hauptman
traveler_hauptman Member, OS Professional, Mentor, Developers Posts: 423 PRO
So, to grab wires in a sketch, shouldn't the following work?
annotation { "Name" : "Sketch Edges", "Filter" : EntityType.EDGE && BodyType.WIRE   }
If I'm filtering from everything, why does this not work?
annotation { "Name" : "Sketch Edges", "Filter" : BodyType.SOLID}

Tagged:

Comments

  • Evan
    Evan Onshape Employees Posts: 68 image
    Thanks for the feedback.  You are correct. This filter:
    annotation { "Name" : "Sketch Edges", "Filter" : EntityType.EDGE && BodyType.WIRE }
    should include sketch edges.  (It would also include helices, which are wire bodies.)  I've logged this as an issue.

    You could use a more specific filter that just includes sketch edges:
    annotation { "Name" : "Sketch Edges", "Filter" : EntityType.EDGE && SketchObject.YES }

    With regards to this filter:
    annotation { "Name" : "Sketch Edges", "Filter" : BodyType.SOLID }
    I would expect that to allow selection of any entity (face, edge, vertex) that belongs to a solid body (i.e., a part). What are you expecting in this case?
  • traveler_hauptman
    traveler_hauptman Member, OS Professional, Mentor, Developers Posts: 423 PRO
    Regarding
    annotation { "Name" : "Sketch Edges", "Filter" : BodyType.SOLID <span>}</span>
    I was expecting something different (select only parts) but I'm still learning what entities and bodies are and how your query system works..

  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,279 image
    For that, you would need to do EntityType.BODY && BodyType.SOLID
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc