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.

Sheet metal flange using featurescript

guillauem_dguillauem_d Member Posts: 17

Hi everyone! 😁

I'm working on creating a very basic flange on a square flat sheet metal part using FeatureScript. My goal is to eventually generate a 90° flange by selecting the edge of the sheet.

I managed to achieve it by copy-pasting the entire code from the official standard library, but I’d like to know how to simply call the function export const sheetMetalFlange = defineSheetMetalFeature(function(context is Context, id is Id, definition is map) in my own project without having to duplicate all the code.

Any guidance on how to do this would be greatly appreciated! 😀"

Comments

  • Caden_ArmstrongCaden_Armstrong Member Posts: 194 PRO

    You don't need to copy all the code, you can just import it:

    import(path : "onshape/std/sheetMetalFlange.fs", version : "2506.0");


    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
  • guillauem_dguillauem_d Member Posts: 17

    Thank you for your answer, Caden! 😊 I was aware of the import method and had tried it, but I still couldn’t manage to get my preconditions working properly.

    Eventually, I found that using export import when importing the code resolved the errors and fixed the issue!

    Thanks again for pointing me in the right direction! 👍

Sign In or Register to comment.