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.
Abusing UIHints for Fun and Profit
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.