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.
Help... do you know what wrong it is?
joseph_ho608
Member Posts: 4 ✭
0

Comments
Yes, what's wrong is that you used ChatGPT 😁
Use the code snippets menu at the top. Also check out the learning reasources here:
https://learn.onshape.com/learn/course/featurescript-fundamentals
Not ChatGPT but Gemini, hehe😅
I have fixed some and tried to spot out the rest but failed.
Ha, AI is not great at FS. This is valid code:
FeatureScript 2737; import(path : "onshape/std/common.fs", version : "2737.0"); annotation { "Feature Type Name" : "Offroad Wheel 1:12" } export const offroadwheel = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Wheel Diameter"} isLength(definition.diameter, { (millimeter) : [0, 60, 1000] } as LengthBoundSpec); annotation { "Name" : "Wheel Width", "Default" : 30 * millimeter } isLength(definition.width, LENGTH_BOUNDS); annotation { "Name" : "Number of Holes", "Default" : 6 } isInteger(definition.holes, POSITIVE_COUNT_BOUNDS); } { const diam = definition.diameter; const width = definition.width; const holes = definition.holes; var wheelsketch = newSketch(context, id + "wheelSketch", { "sketchPlane" : qCreatedBy(makeId("Top"), EntityType.FACE) }); skLineSegment(wheelsketch, "line1", { "start" : vector(0, 0) * millimeter, "end" : vector(0 * millimeter, width) }); skArc(wheelsketch, "arc1", { "start" : vector(0 * millimeter, width), "mid" : vector(diam, width), "end" : vector(diam, 0 * millimeter) }); skSolve(wheelsketch); });