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.
@opPattern: INVALID_INPUT
nir_naron
Member Posts: 26 EDU
Trying to duplicate a user-selected line. No idea why these two Featurescripts attached below aren't working. Out of ideas. @NeilCooke HELP!
Also, side questions:1) What's the best way to have the pattern be perpendicular to the line? Currently they're in the same direction. I was hoping to be able to go <evvLine.direction.normal> though it seems like that's not the way.2) How do I get <selctedLine>'s start-point and end-point? The start-point is <evvLine.origin> but I'm not sure about the end-point.Thanks!FeatureScript 2345; import(path : "onshape/std/common.fs", version : "2345.0"); annotation { "Feature Type Name" : "Pattern Line"} export const patternLine = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Select Line:", "Filter" : EntityType.EDGE, "MaxNumberOfPicks" : 1 } definition.selectedLine is Query; } { const selectedLine = definition.selectedLine; debug(context, selectedLine); const evvLine = evEdgeTangentLine(context, { "edge" : selectedLine, "parameter" : 0 }); debug(context, evvLine); opPattern(context, id + "pattern1", { "entities" : selectedLine, "transforms" : [transform(evvLine.direction*inch)], "instanceNames" : ["Copy1"] }); }); // annotation { "Feature Type Name" : "Pattern Line Wierdly" } // export const patternLineWierdly = defineFeature(function(context is Context, id is Id, definition is map) // precondition // { // annotation { "Name" : "Select Line:", "Filter" : EntityType.EDGE, "MaxNumberOfPicks" : 1 } // definition.selectedLine is Query; // } // { // const selectedLine = definition.selectedLine; // debug(context, selectedLine); // const evvLine = evEdgeTangentLine(context, { // "edge" : selectedLine, // "parameter" : 0 // }); // opExtractWires(context, id + "opExtractWires1", { // "edges" : selectedLine // }); // debug(context, qCreatedBy(id + "opExtractWires1", EntityType.EDGE)); // opPattern(context, id + "pattern1", { // "entities" : qCreatedBy(id + "opExtractWires1", EntityType.EDGE), // "transforms" : [transform(evvLine.direction*inch)], // "instanceNames" : ["Copy1"] // }); // });
Tagged:
0