I want to make a clipping mask of some particular arts but problem occurs when I select these arts using sAIArt->SetArtUserAttr(), then make mask usnig action manager.
When I made a selection of the arts i wanted to clip through code and clipped them manually, it worked.
Also when I made a selection of the arts I wanted to clip manually and clipped them through code, it worked.
But when I do both the tasks through code I does not work.
I think the document is not being updated when making clipping mask code is being executed.
When I used sAILayer->SelectArtOnLayer it worked but then every art on that layer is clipped, which is not what I want.
What can I do in this scenario?
AILayerHandle lh = NULL;
AIArtSet set =NULL;
// Select first art
AIArtHandle mArt = NULL;
sAIArtSet->IndexArtSet(set, 1, &mArt);
sAIArt->SetArtUserAttr(mArt, kArtSelected, kArtSelected);
// Select third art
sAIArtSet->IndexArtSet(set, 3, &art);
sAIArt->SetArtUserAttr(art, kArtSelected, kArtSelected);
// Make clipping mask
sAIActionManager->PlayActionEvent(kAIMakeMaskFromSelectionAction, kDialogOff ,NULL);
There's some functions in the AIGroupSuite that I think are what you're looking for to make clipping masks. The way you're selecting art should work, but you should probably make sure you deselect everything first.