Enum used as a parameter type must be exported?

Aaron_Hoover
Aaron_Hoover Member Posts: 35 EDU
I am trying to use the BoundingType enum in a Featurescript that I'm developing that includes an extrude. I keep getting the error "Enum used as a parameter type must be exported" when I try to use the BoundingType like so: 

annotation { "End Type" : "End Type" }
definition.endType is BoundingType; 

The BoundingType enum seems to be used without issue in the Featurescript mentioned in this post about extruding a profile. What am I missing?


Tagged:

Best Answer

Answers

  • Aaron_Hoover
    Aaron_Hoover Member Posts: 35 EDU
    Yep. That did it. I didn't realize I needed to preceded the import with "export." Thank you. 
  • MBartlett21
    MBartlett21 Member, OS Professional, Developers Posts: 2,064 ✭✭✭✭✭
    @Aaron_Hoover
    I would suggest just exporting the enum you need.
    export import(path : "onshape/std/boundingtype.gen.fs", version : "937.0");
    Some reasons can be found at https://forum.onshape.com/discussion/9583/multiple-declaration-warning
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,278 image
    I agree with Morgan -- adding the export to geometry.fs was the simplest solution, not the best one.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc