Either or selection of edge or face in featurescript

CAD_SSP
CAD_SSP Member Posts: 45 ✭✭
Sure I am missing something really obvious here but I cant see how to allow selection of either a face or an edge in featurescript.

Best Answer

  • CAD_SSP
    CAD_SSP Member Posts: 45 ✭✭
    edited December 2017 Answer ✓
    Found it thanks to the OnShape features being open source...

    It is as simple as OR in JavaScript - you add brackets and 2 pipes such as:
    <div>annotation { "Name" : "Measure From", "Filter" : (EntityType.EDGE || EntityType.FACE), "MaxNumberOfPicks" : 1 }
    </div>
    For full details of other options check out the fillet feature in the source documentation.


Answers

  • owen_sparks
    owen_sparks Member, Developers Posts: 2,660 PRO
    Are you talking from the initial user's inputs?

    I might be wrong but I believe you can say filter type face and edge, selection qty 1

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • CAD_SSP
    CAD_SSP Member Posts: 45 ✭✭
    edited December 2017 Answer ✓
    Found it thanks to the OnShape features being open source...

    It is as simple as OR in JavaScript - you add brackets and 2 pipes such as:
    <div>annotation { "Name" : "Measure From", "Filter" : (EntityType.EDGE || EntityType.FACE), "MaxNumberOfPicks" : 1 }
    </div>
    For full details of other options check out the fillet feature in the source documentation.