Can anyone please advise on the best method of producing an addin which supports any unit input via the UI, e.g. A user could enter 2000mm or 2m or 12" or 1', such that the code can interpret the input and convert to a value in internal units for use by the addin outside the context of the parameter.
So far I've thought about letting users specify ValueStrings in a text box, but things like the api's convert to double only appear to work on parameters, not strings. I don't have a suitable 'spare' parameter to use for the conversion, I'd need to create a temp shared parameters file, create a parameter of the appropriate type, bind it to something, use it for the conversion and then dispose of it. This seems way over the top and makes me feel like in missing something obvious. I've also explored things like unitutils but I think I still need a parameter to feed the valuestring into in order to get the value and unittype.
Any suggestions?