Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Enum used as a parameter type must be exported?

Aaron_HooverAaron_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_HooverAaron_Hoover Member Posts: 35 EDU
    Yep. That did it. I didn't realize I needed to preceded the import with "export." Thank you. 
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,039 ✭✭✭✭✭
    @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_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,210
    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
Sign In or Register to comment.