Skip to main content
oleksijp79466572
Inspiring
April 5, 2019
Answered

Weird behavior of the Pathfinder suite. What am I doing wrong?

  • April 5, 2019
  • 1 reply
  • 569 views

EDIT:  Right after I posted the question, I realized that I have to pop a context that I have pushed previously. And that is what caused Illustrator weird behavior .

In the beginning I have A and B paths. I am trying to make these united.

Then I run this code:

AIArtHandle newArtGroup;

sAIArt->NewArt(kGroupArt, kPlaceAboveAll, nil, &newArtGroup);

sAIArt->SetArtName(newArtGroup, ai::UnicodeString("Union"));

std::vector<AIArtHandle> artToReorder;

// comparing routine to fill a vector with art for applying an unite effect

for (int i = 0; i < artToReorder.size(); i++)

{

     sAIArt->ReorderArt(artToReorder, kPlaceInsideOnTop, newArtGroup);

}

AIPathfinderData pathfinderData;

pathfinderData.fAlertInfoID = 0;

pathfinderData.fSelectedArt = &newArtGroup;

pathfinderData.fSelectedArtCount = 1;

// assigning option and params of pathfinderData

error = sAIPathfinder->DoUniteEffect(&pathfinderData, &filtMsg);

Also I have tried to put just the begin of the vector in pathfinderData.fSelectedArt, and set pathfinderData.fSelectedArtCount to appropriate count. The result was almost the same:

First of all, why does the circle keep its outline here?
But when I slightly change the view, it's gone:

Then I add a rectangle on the scene (look at the layers: the path has been broken up):

The effect is gone. I have to change the view to update this:

After that I can't create new primitives. Because each of them just replace <rectangle> and I have to change the view to see this (in the layer panel it becomes apparent immediately).

What am I missing?

This topic has been closed for replies.
Correct answer oleksijp79466572

Right after I posted the question, I realized that I have to pop a context that I have pushed previously.

1 reply

oleksijp79466572
oleksijp79466572AuthorCorrect answer
Inspiring
April 5, 2019

Right after I posted the question, I realized that I have to pop a context that I have pushed previously.