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.
Can't Sketch on Plane Created with opPlane
matthew_mueller295
Member Posts: 6 EDU
Hello,
I am trying to create a new plane using opPlane, then create new sketch features on it. The plane shows up, but not the sketch. The body of the FS code is below. Thanks!
I am trying to create a new plane using opPlane, then create new sketch features on it. The plane shows up, but not the sketch. The body of the FS code is below. Thanks!
var plane1 = opPlane(context, id + "plane1", {
"plane" : plane(vector(0, 0, 2) * inch, vector(0, 0, 1), vector(1, 0, 0)),
"width" : 6 * inch,
"height" : 6 * inch
});
var sketch1 = newSketch(context, id + "sketch1", {
"sketchPlane" : qCreatedBy(makeId("plane1"), EntityType.FACE)
});
// Create sketch entities here
skText(sketch1, "text1", {
"text" : "Hello",
"fontName" : "OpenSans-Regular.ttf",
"firstCorner" : vector(0, 0) * inch,
"secondCorner" : vector(1, 1) * inch
});
skSolve(sketch1);
Tagged:
0
Comments
"sketchPlane" : qCreatedBy(makeId("plane1"), EntityType.FACE)
Try replacing the
makeId("plane1")
with
id + "plane1"
Additionally, it might be useful to know that if you do not need this plane to actually show up in your part studio, or if you are just going to delete it later, you could use newSketchOnPlane directly instead of newSketch.
https://cad.onshape.com/FsDoc/library.html#newSketchOnPlane-Context-Id-map
Then your code would just look like: