Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
FS enums in a common shared script
graham_lock
Member Posts: 148 PRO
Hi all,
I have an enum which is used to define a UI parameter type, which I also want to use within another script.
If I define the enum outside of the script where it is used to define a parameter type I get an error telling me it must be exported.
Is there a way around this? Do I need to define it in the script where it is used as a parameter type and then import that script into the other scripts rather than use a common file?
Test document here:
https://cad.onshape.com/documents/69bc4ff93f0403841e6c9441/w/c2315c99b371ce207df18903/e/8d32865f14c600cf8061293e
Thank you.
I have an enum which is used to define a UI parameter type, which I also want to use within another script.
If I define the enum outside of the script where it is used to define a parameter type I get an error telling me it must be exported.
Is there a way around this? Do I need to define it in the script where it is used as a parameter type and then import that script into the other scripts rather than use a common file?
Test document here:
https://cad.onshape.com/documents/69bc4ff93f0403841e6c9441/w/c2315c99b371ce207df18903/e/8d32865f14c600cf8061293e
Thank you.
0
Best Answer
-
Caden_Armstrong Member Posts: 180 PROYou need to export the imported enum
export import(path : "e09210f831642af152bb6093", version : "c60edfc009b13c4a4a38fe25");
in the fs where you are using it.www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications0
Answers
in the fs where you are using it.
Custom FeatureScript and Onshape Integrated Applications