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.
Creating an extrusion using dimensions of face parallel to sketch plane.
Edward_Harris
Member Posts: 7 PRO
Hello. I am trying to learn FS, and as a step in a larger project, I am trying to get my feature to create an extrusion with the same sketch dimensions as a face parallel to the sketch surface but I am at a loss as to how to best go about this. Do you have any suggestions?
So far I have managed to create a sketch plane where I want the extrusion to be placed, but I am unsure as to which function, query/evaluate, to use in order to get the dimensions of the parallel face and also how I would go about this in general. The main automation in this feature should lie in the identification of the sketch dimensions, the height of the subsequent extrusion is irrelevant at this time.
So far I have managed to create a sketch plane where I want the extrusion to be placed, but I am unsure as to which function, query/evaluate, to use in order to get the dimensions of the parallel face and also how I would go about this in general. The main automation in this feature should lie in the identification of the sketch dimensions, the height of the subsequent extrusion is irrelevant at this time.
FeatureScript 1803;
import(path : "onshape/std/geometry.fs", version : "1803.0");
annotation { "Feature Type Name" : "Podium Box" }
export const myBox = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Top Face", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
definition.Topface is Query;
annotation { "Name" : "Sketch Face", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
definition.SFace is Query;
}
{
//Figure some stuff out
var Faceedges = qEdgeVertex(definition.Topface, true);
//Create a drawing plane
var sketchPlane = evPlane(context, {
"face" : definition.SFace
});
debug(context, Faceedges);
debug(context, sketchPlane);
//Create a Sketch
var faceSketch = newSketchOnPlane(context, id + "sketchFaceplane", {
"sketchPlane" : sketchPlane
});
//Draw Stuff
skRectangle(faceSketch, "rectangle1", {
"firstCorner" : qBodyType(definition.Topface, EntityType.EDGE)* millimeter,
"secondCorner" : vector(50, 50) * millimeter
});
//Solve Sketch
skSolve(faceSketch);
// opExtractWires(context, id + "opExtractWires1", {
// "edges" : FaceEdges
//});
// debug(context, FaceEdges, DebugColor.BLUE);
// Define the function's action
});
I have been stuck for 3 days now, any help would be greatly appreciated.
Best regards
Edward
I have been stuck for 3 days now, any help would be greatly appreciated.
Best regards
Edward
Tagged:
0
Comments