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.

Abusing UIHints for Fun and Profit

juliaschatzjuliaschatz Member, Developers Posts: 8 EDU
I had some fun making an early April Fool's joke about adding microtransactions to my featurescripts. This uses UIHint.REMEMBER_PREVIOUS_VALUE, UIHint.ALWAYS_HIDDEN, and an editing logic function to keep track of how many times someone has used a script and encourages them to buy more uses when they run out. An example of this applied is here.

This isn't practical for this purpose for a few reasons: There's no way to access the internet to verify redemption codes (although large random numbers stored in a private document could work), and all REMEMBER_PREVIOUS_VALUE values are reset when the user changes the version of the script (updates it, for example).

I originally did this just as an experiment about transferring data that the user doesn't interact with between script runs, essentially turning any field marked REMEMBER_PREVIOUS_VALUE into a storage location for anything that can be serialized to a string. This could be used to store configuration information, copy data between part studios, or any number of things.

Hope this is a little bit interesting at least.
Tagged:

Comments

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    Onshape developers: We want deterministic behavior for feature regeneration so let's design a new safe language for that.
    Onshape users: We want microtransactions so let's see, what could we do for that >:)
  • EvanReeseEvanReese Member, Mentor Posts: 2,171 ✭✭✭✭✭
    This is hilarious!
    Evan Reese
Sign In or Register to comment.