10-13-2021, 08:05 AM
To make plugins that are BEST WITH CADTOOLS and can advertise it, it would be great to have a class that parses variables considering current CADtools settings.
FORMAT: Pass a double value as points, returns std::string.
- If CADtools is installed, it returns string scaled to current CADtools scale, using current CADtools units, CT precision and comma separator.
- If CADtools is not installed, scales from points to current user units, formats string using user's local comma separator, using precision passed as an optional argument
SCAN: pass a string, returns double.
- If CADtools is installed, it interprets the value based on current CADtools comma separator, scales the value based on current CADtools scale, converts it from current CADtools units to points.
- If CADtools is not installed, it interprets the value based on AI's current comma separator appropriate for users in, for example, US, UK, Russia, or Japan. Next looks for unit specified in string (e.g., "in" or "mm") and converts that to points. If no units are specified, converts from current AI user units to points.
This would be very helpful for plugins creating art to fit with CADtools art.
Another optional boolean argument could specify whether to just use AI's local user units for instances where users specify, for example, a desired line weight, rather than a scaled distance to manipulate art. I could, of course, just use sAIUser->IUAIRealToStringUnits and sAIUser->IUStringUnitsToAIReal, but my experience with them is unreliable.
FORMAT: Pass a double value as points, returns std::string.
- If CADtools is installed, it returns string scaled to current CADtools scale, using current CADtools units, CT precision and comma separator.
- If CADtools is not installed, scales from points to current user units, formats string using user's local comma separator, using precision passed as an optional argument
SCAN: pass a string, returns double.
- If CADtools is installed, it interprets the value based on current CADtools comma separator, scales the value based on current CADtools scale, converts it from current CADtools units to points.
- If CADtools is not installed, it interprets the value based on AI's current comma separator appropriate for users in, for example, US, UK, Russia, or Japan. Next looks for unit specified in string (e.g., "in" or "mm") and converts that to points. If no units are specified, converts from current AI user units to points.
This would be very helpful for plugins creating art to fit with CADtools art.
Another optional boolean argument could specify whether to just use AI's local user units for instances where users specify, for example, a desired line weight, rather than a scaled distance to manipulate art. I could, of course, just use sAIUser->IUAIRealToStringUnits and sAIUser->IUStringUnitsToAIReal, but my experience with them is unreliable.