Hot Door CORE Forum
scan and format using CADtools units and formats - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: Feature requests (http://hotdoorcore.com/forum/forumdisplay.php?fid=7)
+--- Thread: scan and format using CADtools units and formats (/showthread.php?tid=284)



scan and format using CADtools units and formats - Rick Johnson - 10-13-2021

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.


RE: scan and format using CADtools units and formats - garrett - 01-20-2022

I see what you're after here, but unfortunately we cannot put CADtools-specific logic at the hdi_core level, because a) CADtools itself is built atop hdi_core so this would be a pain to make happen, and b) for business reasons we do not want to distribute a lot of CADtools-specific support/features within hdi_core.


RE: scan and format using CADtools units and formats - Rick Johnson - 04-28-2022

Thanks, Garrett. I had hoped a lot of this could be possible just by reading document dictionaries, but I understand that so much more is going on within CADtools itself. As for B) I hope my request was clear that any CADtools-specific features would ONLY be available to other plugins if CADtools itself were present. For example, a CADtools user working in 3/8" scale could enter 15 inches and the CT class would return the scaled distance of 33.75 points. Those without CADtools would get back the non-scaled equivalent of 1,080 points. I want my users to buy CADtools, and I want to give CADtools users a more CADtools-like experience with my plugins. But I guess if it can't be so, so be it. Thanks for considering it.