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.

Using Form Feature with Featurescript

Hello Team,


I don't seem to be able to get the form featurescript to work. Any ideas what I am doing wrong???

I am importing a form part studio TEST_FORM::

 
    var pointSketch = newSketch(context, id + "points", {
            "sketchPlane" : qCreatedBy(makeId("Top"), EntityType.FACE)
        });
    skPoint(pointSketch, "point1", {
                "position" : vector(1, 2) * inch
            });
    skSolve(pointSketch);


    var formLocation = qSketchFilter(qCreatedBy(id + "sketch1", EntityType.VERTEX), SketchObject.YES);
    var targetFaces = qContainsPoint(qActiveSheetMetalFilter(qEverything(EntityType.FACE), ActiveSheetMetal.YES), vector(1 * inch, 2 * inch, 0 * millimeter));

    debug(context, targetFaces, DebugColor.RED);

    try
    {
        var form = sheetMetalFormed(context, id + "TEST_FORM", {
                "formPartStudio" : {
                        "buildFunction" : TEST_FORM::build,
                        "configuration" : {
                            "thickness" : 1 * millimeter },
                        "partQuery" : qEverything(EntityType.BODY),
                    } as PartStudioData,
                "locations" : formLocation,
                "flipDirection" : false,
                "targetFaces" : targetFaces
            });
        println(form);
    }
    catch (e)
    {
        println("Form Feature Failed");
    }
});
This returns the part with the location on it 
image.png

But throws no error, even though the form is not made

image.png

Comments

Sign In or Register to comment.