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.

Descriptions for constants?

EvanReeseEvanReese Member, Mentor Posts: 2,188 ✭✭✭✭✭
I'm trying to add a description to a constant so that when I mouse over the constant places it's used, I'll see the explanation. I'm looking for the exact same behavior as you see when you mouse over one of the standard library constants like millimeter. Degree is done this way in the standard library:

/** A constant equal to 1 degree. */
annotation { "Name" : "Degree", "Abbreviation" : "deg" }
export const degree = 0.0174532925199432957692 * radian;

I've tried it like this, but it doesn't seem to do it. What am I missing?

/**This is my description*/
const myConstant = 1*inch;
Evan Reese

Comments

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,715
    I'm guessing you have to export it.
    Senior Director, Technical Services, EMEAI
  • EvanReeseEvanReese Member, Mentor Posts: 2,188 ✭✭✭✭✭
    That's a good bet. I was hoping to make the description at least available within the scope of the function I'm working on, but I can't export a const from a function (I don't think). Not a huge deal, but would help reduce me having to scroll around a bunch looking for my comments.
    Evan Reese
Sign In or Register to comment.