Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Obtaining axis for 'rotationAround' function

antlu65antlu65 Member Posts: 59 EDU
edited June 2022 in FeatureScript
Hi, newbie question, apologies if redundant.

Would like to use the 'rotationAround' function. How do I obtain the z axis (normal vector of the Top plane) for use as the 'line' parameter? I know I can obtain a Line with evLine(), but I'm not sure how to obtain a query that returns the z-axis.

EDIT: Ok, literally right after I posted this question, I typed the letter 'Z' and found the 'Z_AXIS' constant through the auto-complete menu. Lol.

Best Answer

  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Answer ✓
    haha sometimes it's like that. You mentioned evLine, which is a function to evaluate a query (like an edge you could pick) and return a line, which isn't what I think you needed. If you need an axis not on the origin, all you need is the line() function which takes a vector and direction. If you look at the documentation for Z_AXIS you'll see it's identical to using the line function. 
    line(vector(0, 0, 0) * meter, vector(0, 0, 1))

    Evan Reese

Answers

  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Answer ✓
    haha sometimes it's like that. You mentioned evLine, which is a function to evaluate a query (like an edge you could pick) and return a line, which isn't what I think you needed. If you need an axis not on the origin, all you need is the line() function which takes a vector and direction. If you look at the documentation for Z_AXIS you'll see it's identical to using the line function. 
    line(vector(0, 0, 0) * meter, vector(0, 0, 1))

    Evan Reese
  • antlu65antlu65 Member Posts: 59 EDU
    Thanks for the tip! I've seen some of your company's YT segments on OnShape (I think that's what encouraged me to start learning it in the first place). You guys do amazing work! =)
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    antlu65 said:
    Thanks for the tip! I've seen some of your company's YT segments on OnShape (I think that's what encouraged me to start learning it in the first place). You guys do amazing work! =)
    No way! Glad to hear it was helpful
    Evan Reese
Sign In or Register to comment.