Breaking a loops

darren_13
darren_13 Member, Developers Posts: 120 PRO
Hi, just a quickie. I want to break a loop when 'debug: Query resolves to nothing' how do I do this? the query isn't empty it just resolves to nothing.

The scenario is when iterating through selected faces until there are no more.

Kind regards,
Darren Lynch

Comments

  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,279 image
    Here's a test that compares the result of evaluating a query against an empty array: evaluateQuery(context, query) == []
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • darren_13
    darren_13 Member, Developers Posts: 120 PRO
    Worked a treat, thanks @ilya_baran