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.

user-specific feature parameters?

mark_schroeder475mark_schroeder475 Member Posts: 5 EDU
I'm very new to FS. I've searched for an answer to this, though I may not know exactly where to look. Apologies if it's naive.

I have a feature developed for a small, informal group that generates g-code for some basic machining operations. (It's important for it to be straightforward and a generic CAM app is beyond the scope.) I would like some settings for the feature to be adjustable but only by specific people: tool numbers, feeds and speeds, offsets, that sort of thing. I'm imagining a conditional group that is read-only or invisible to other users. Or there could be other options. But they all depend on one thing: identifying the user. Is there a way in FS to determine the userId, or some other identifier? Does anyone have a suggestion for a good way to do this?

Comments

  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    All I can think of is making 2 features. 1 with what everyone should do, and 1 that's only shared with the right people.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    I guess another hack could be to make a string field that takes a password of some kind, which will make an editable field show up. It's a bit of a roundabout thing to set up, but possible.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    Couldn't get this one out of my head so I mocked it up and it works!

    https://cad.onshape.com/documents/4fef76ae984cf40f4c23e329/w/eed87c6077cf37eb60ec8120/e/8f13119660410e99e0c51ffa

    If you type the password in, the length field becomes editable. While it's typed in the feature turns red to remind you to remove the password so it doesn't stay editable. You'd want to store the password constant in another document that people don't have access to, so they can't just read it from the code. My password is the timeless "1234".

    Note, this is not an acceptable solution for anything actually secure, but it could be good enough to prevent accidental editing by people who shouldn't.
    Evan Reese
  • mark_schroeder475mark_schroeder475 Member Posts: 5 EDU
    That's an interesting idea. Thank you for working that out and providing an example!

    I don't actually understand yet how to set up a FS document that only some people can read. It occurs to me that I may not have that option.

    I suppose it might be possible to use one-way encryption. The algorithm might be there for everyone to see, but honestly I don't expect anyone in this group to put in that effort. As I mentioned, this doesn't have to be terribly secure, and is really just to prevent accidents (and if someone has to put in some effort to do it, then it's not an accident, and that can be addressed). Also, if someone is technically adept enough to reverse engineer it, and willing to put that much effort into being able to set a tool number, then I have other worries...

    It seems like this could be a useful capability to add, though, in an actually secure way.

    Another thought: Is it possible to have an app enable parameters in a feature? I'm guessing not, but I could definitely be wrong.

  • mark_schroeder475mark_schroeder475 Member Posts: 5 EDU
    Ah, I think I've figured out how to do it through an app. (Finally got the features/updates api thing working.)

    Though the password idea might ultimately be better, since it would allow someone to step in momentarily when asked rather than open up their own OS session.

    I appreciate the help.

  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    Cool! I've not played with the API, personally, so I don't know how to approach that.

    As for making some code that others don't have access to, you should be able to do it on any paid plan. Just make a whole separate document, and put your feature studio there. The Thread Creator feature is a good example of this. Most of the feature is somewhere else private so the code can't be seen: https://ovyl.onshape.com/documents/6b640a407d78066bd5e41c7a/v/845d049782179b9faee8b6e6/e/c953720c264ce001f1a82dc1
    Evan Reese
Sign In or Register to comment.