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.
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
But throws no error, even though the form is not made
0
Comments
The code as you posted it has some errors with the formLocation. The sketch id is incorrect and formLocation is an empty query.
I think the location parameter also need to be on a sheet metal face, just based on the sheet metal form feature.
Custom FeatureScript and Onshape Integrated Applications
Ah… !