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.

Creating Sheet Metal Object via Feature Script

eca_elioaceca_elioac Member Posts: 4
image.png

Hi All,

When I create a sheet Metal object via feature script. In the sheet Metal Context window, It shows "Unknown" instead of the usual "Sheet metal model 1"…

How do we control this behavior in featurescript?

Thanks in advance!!!

Comments

  • Caden_ArmstrongCaden_Armstrong Member Posts: 308 PRO

    Sheet metal is pretty difficult to work with in FeatureScript. My recommendation is to not use the underlying sheet metal functionality, but rather to just call the existing sheet metal features with your featurescript. Calling the Onshape written features as sub features is going to produce more consistent results, won't break as easily, and will be faster/easier to develop with.

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


    FeatureScript 2752;
    export import(path : "onshape/std/common.fs", version : "2752.0");
    export import(path : "onshape/std/sheetMetalStart.fs", version : "2752.0");

    annotation { "Feature Type Name" : "Sm Thicken", "Feature Type Description" : "Wrapper for sheetMetalStart (THICKEN)" }
    export const mySmThicken = defineFeature(function(context is Context, id is Id, definition is map)
    precondition
    {
    annotation { "Name" : "Sketch/Face to Thicken", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
    definition.mySketchToThicken is Query;
    }
    {
    var myDef = {
    "process" : SMProcessType.THICKEN,
    "regions" : definition.mySketchToThicken,
    "thickness" : 0.0516 * inch,
    "radius" : 0.1 * inch,
    "bends" : qNothing()
    };

        callSubfeatureAndProcessStatus(id, sheetMetalStart, context, id + 'sMstart', myDef);
    });

    Hi Caden,
    I constructed the script above just as you suggested but I'm still running into the same issue.. I'm getting "Unknown" in the Sheet metal context window instead of the normal "Sheet metal model 1"

  • lanalana Onshape Employees Posts: 737

    That piece of UI is specific to the standard sheetMetalStart feature. I don't think you can coax it to work with your feature. Sorry.

Sign In or Register to comment.