accept any planar profile: faces, sketch regions, sketch objects containing regions

adamohern
adamohern Member, OS Professional Posts: 216 PRO
annotation { "Name" : "Profiles", "Filter" : (EntityType.FACE && SketchObject.YES) || SketchObject.YES }
definition.sketches is Query;
My feature extrudes planar stock to a fixed thickness. It can accept any closed planar profile for extrusion. I would like to allow planar faces, sketch regions, and sketch objects (picked from the feature list) so long as they contain closed regions.

How can I do that? The above works for sketches, but allows open sketches (bad), and doesn't allow faces (lame).

Comments

  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,279 image
    edited May 2016
    Simply
    "Filter" : GeometryType.PLANE && ConstructionObject.NO

    Should work.  The second part is to disallow selecting construction planes.

    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • adamohern
    adamohern Member, OS Professional Posts: 216 PRO
    Beautiful!
  • adamohern
    adamohern Member, OS Professional Posts: 216 PRO
    Oh, this doesn't accept sketch objects selected from the feature tree. Is there a way to include those as well?
  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,279 image
    Sorry, not if you want to restrict only to sketches with closed regions.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc