Bug details

Adobe Illustrator Scripting VERY slow - C#

Hello,

i'm developting a small library to access PathObjects in Illustrator (works fine for CS2, CS5, CC2015) - but i have performance problems with CC2019. I am using VS2017.

Code looks like:

Type AIType = Type.GetTypeFromProgID(AIAppName);

dynamic illuApp = Activator.CreateInstance(AIType);

if (illuApp == null)

{

return;

}

if (illuApp.Documents.Count < 1)

{

return;

}

System.Array lll = illuApp.ActiveDocument.selection;

if (lll != null)

{

for (int i = 0; i < lll.Length; i++)

{

dynamic path = lll.GetValue(i);

if (path != null)

{

var lll2 = path.PathPoints;

Application.DoEvents();

int iSelCount = lll2.Count;

if (iSelCount >= 4)

{

string sss = path.typename;

float dH = (float)(path.Height / dScale);

float dW = (float)(path.Width / dScale);

float dL = (float)(path.Left / dScale);

float dT = (float)Math.Abs(path.Top / dScale);

dynamic obCol = path.FillColor;

sss = obCol.typename;

Color col = Color.Black;

if (sss.Contains("CMYK"))

{

var r = (int)(255 * (1 - obCol.Cyan / 100) * (1 - obCol.Black / 100));

var g = (int)(255 * (1 - obCol.Magenta / 100) * (1 - obCol.Black / 100));

var b = (int)(255 * (1 - obCol.Yellow / 100) * (1 - obCol.Black / 100));

col = Color.FromArgb(r, g, b);

}

else if (sss.Contains("RGB"))

{

int r = (int)(obCol.Red);

int g = (int)(obCol.Green);

int b = (int)(obCol.Blue);

col = Color.FromArgb(r, g, b);

}

Data.Add(NewInfo (dL, dT, dW, dH, col);

}

}

}

}

On CS2, CS5 or CC2015, processing 1000 selected rectangles need a couple of seconds, but on CC2018 & CC2019 it needs MINUTES.

I use exactly the same code - is there something i am missing?

Mainly accessing "path.PathPoints" (needs ~ 15 msec.) and "path.FillColor" (needs ~ 20 msec.) are time consuming.

Thanks in advance for any hint! My customers are thinking about uninstalling CC2019 and going back to older versions.

Leopold

1 vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)

We’ll send you updates on this idea

Leopold Minikus shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base