Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Dear Patterson,
Is Any iilustrator SDK methods available to convert Points(pt) Unit in to Millimeter (mm) Units.
Please give your Suggestion.
Thank You Friend,
Nathan
Copy link to clipboard
Copied
The new API lets you get results in whatever the current ruler unit is set to. ai::AutoCoordinateSystem in AIAutoCoordinateSystem.h lets you do this, at least in one of the later SDKs.
Failing that, you could do what we do, namely hardcode the conversion constants:
const AIReal kPointsPerInch = 72.0;
const AIReal kPointsPerPica = 12.0;
const AIReal kInchesPerCentimeter = 0.393700787f;
const AIReal kPointsPerCentimeter = kInchesPerCentimeter * kPointsPerInch;
const AIReal kCentimetersPerMillimeters = 0.1f;
const AIReal kPointsPerMillimeters = kCentimetersPerMillimeters * kPointsPerCentimeter;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Re: getPathLength
Any chance you could provide correct syntax or usage for this function? (or link to documentation, can't find in docs in AI scripting folder)
Do I need to #Include any special suite or anything? (I'm a total newb to jsx although some experience with JS in other contexts)
Is this for straight paths or curved also? One segment length or many?
Thanks in advance for any advice
Alastair
Copy link to clipboard
Copied
JSX? If you're doing this via scripting, you may want to try the forum over here:
http://forums.adobe.com/community/illustrator/illustrator_scripting
This forum is for the C/C++ SDK
As for what GetPathLength() returns, it returns the length of path, not individual segments, and yes it works for both flat & curved (bezier) paths.
Copy link to clipboard
Copied
Thanks I realised after I posted this hit had come from SDK (even though I was searching Scripting folder!). Thanks.
In JS the pathObjectCalledThis.length property worked effortlessly, even on curves and multi-segment lines.
Copy link to clipboard
Copied