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 a sketch in a new coordinate system and rotating it
Tigran_Petrosyan
Member Posts: 2 PRO
Hi guys!
I am going to create a custom feature which would make an engraving logo on a flat round surface with parametric radius.
For that purpose I need:
1. Create a coordinate system.
2. Create a plane based on that coordinate system.
3. Create a sketch.
4. Rotate it.
But my code doesn't work and breaks when I assign a variable plane to a sketch:
// Coordinate system
var coordinateSystem1 = coordSystem(
vector(0, 0, 0) * millimeter, // origin
vector(1, 0, 0), // X axis
vector(0, 1, 0) // Y axis
);
// Plane based on the coordinate system
var plane1 = plane(coordinateSystem1);
// Create sketch
var sketch1 = newSketch(context, id + "sketch1", {
"sketchPlane" : plane1 < ——— Breaks here
});
// Example geometry
skCircle(sketch1, "circle1", {
"center" : vector(0, 0) * millimeter,
"radius" : 10 * millimeter
});
// Solve sketch
skSolve(sketch1);
Why is that?
Comments
Use newSketchOnPlane - newSketch is asking for a query