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.
transform rotate around axis
adamohern
Member, OS Professional Posts: 216 PRO
opTransform(context, id + "transform1", { "bodies" : qCreatedBy(id + ("profileSketch")), "transform" : transform({ "transformType" : TransformType.ROTATION, "angle" : definition.axialRotation * degree, "transformAxis" : ??? }) });
I want to rotate a sketch around its z axis. I was hoping that the above would get me there. For the purposes of this thread, let's assume I was correct in my approach.
Note that "transformAxis" wants a Query. I don't have a transform axis. It would be trivial to create a Line using the sketch plane's origin and normal, but I don't think I can query that (can I?). A workaround is to create a sketch on a perpendicular plane, add a line to it, then query that line. This seems like a lot of runaround for something so simple. Is there a better way?
0
Comments
Note that if you asked for definition.axialRotation in the precondition using isAngle, you shouldn't multiply by degree (because it's already an angle).
Oh dear. What did I miss? I just double-checked and didn't find any examples in the source or reference. Where are they?