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.
Problem Extruding using FeatureScript
mario_acosta255
Member Posts: 9 EDU
Good afternoon,
I am trying to learn Featurescript and I am having problems extruding when writing the code. I already went through multiple YouTube videos and other examples, though they are older versions!
I want the Function to ask me what sketches I want to extrude, and then extrude them.
My code looks like the following:
I am trying to learn Featurescript and I am having problems extruding when writing the code. I already went through multiple YouTube videos and other examples, though they are older versions!
I want the Function to ask me what sketches I want to extrude, and then extrude them.
My code looks like the following:
FeatureScript 2221;
import(path : "onshape/std/common.fs", version : "2221.0");
annotation { "Feature Type Name" : "SketchYInserter" }
export const SketchYInserter = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
// Define the parameters of the feature typea
annotation { "Name" : "Location", "Filter" : EntityType.EDGE }
definition.myQuery is Query;
}
{
// Define the function's action
opExtrude(context, id + "extrude1", {
"entities" : definition.myQuery,
// "entities" : entities,
// "direction" : evOwnerSketchPlane(context, {"entity" : entities}).normal,
"endBound" : BoundingType.BLIND,
"endDepth" : 1 * inch
});
});
0
Best Answer
-
NeilCooke Moderator, Onshape Employees Posts: 5,688For a start, you can only extrude a face (unless you want to extrude a surface) plus it looks like direction is commented out.Senior Director, Technical Services, EMEAI0
Answers