01-28-2021, 08:36 AM
(This post was last modified: 07-07-2021, 02:38 PM by Rick Johnson.)
Thanks, Garrett, that's very helpful.
Regarding the original problem above, I think I found the offending code. I felt that Adobe's sAIUser->IUStringToAIReal didn't interpret user units as well as I'd wanted, so I wrote my own "scan" and "format" functions and added them to strFormatting.cpp from the sample code. It reads a wide variety of units expressed in different ways and has the option to convert that value to something other than points. I suspect the problem was a misuse of sscanf (long scanResult = sscanf(str.c_str(), "%lf%[a-z]%lf", &n, s1, &n2);).
I'll post it here if others want to see it (forewarned of hidden issues) and you feel it's appropriate to do so.
Regarding the original problem above, I think I found the offending code. I felt that Adobe's sAIUser->IUStringToAIReal didn't interpret user units as well as I'd wanted, so I wrote my own "scan" and "format" functions and added them to strFormatting.cpp from the sample code. It reads a wide variety of units expressed in different ways and has the option to convert that value to something other than points. I suspect the problem was a misuse of sscanf (long scanResult = sscanf(str.c_str(), "%lf%[a-z]%lf", &n, s1, &n2);).
I'll post it here if others want to see it (forewarned of hidden issues) and you feel it's appropriate to do so.