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.
Simple Polyline Sketch Example on Selected Plane
thomas_allsup
Member, User Group Leader Posts: 4 ✭
I can't find a Featurescript example where the user picks the plane or face in the precondition area. All the examples I find use the "TOP" but I want to select one of the datums or an existing face to create my canned polyline logo. Help!
Tagged:
0
Comments
annotation { "Name" : "Plane", "Filter" : EntityType.FACE && GeometryType.PLANE, "MaxNumberOfPicks" : 1 } definition.plane is Query;Thanks for the insights (I love the videos by the way and I have watched almost all of them).
var face = evPlane(context, { "face" : definition.face }); // definition.face is a Query, not a plane var sketch1 = newSketchOnPlane(context, id + "sketch1", { "sketchPlane" : face }); skPolyline(sketch1, "polyline1", { "points" : [vector(0, 0) * inch, vector(1, 1) * inch, vector(2, 0) * inch, vector(0, 0) * inch] }); skSolve(sketch1); opExtrude(context, id + "extrude1", { "entities" : qCreatedBy(id + "sketch1", EntityType.FACE), "direction" : face.normal, "endBound" : BoundingType.BLIND, "endDepth" : 1 * inch });The right thing to do here is to use `newSketch` rather than `newSketchOnPlane`. The former takes a face query and the latter takes a mathematical definition of a plane. If you use the former, you will not need to call `evPlane`.
https://cad.onshape.com/FsDoc/library.html#newSketch-Context-Id-map
https://cad.onshape.com/FsDoc/library.html#newSketchOnPlane-Context-Id-map