1 Reply Latest reply: Apr 4, 2012 4:05 AM by btemp RSS

    [AICS4] Selecting art and making mask does not work together.

    INeedSol Community Member

      Hi All,

       

      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?

       

      Code snippet

      ////Start

       

      AILayerHandle lh = NULL;

      sAILayer->GetFirstLayer(&lh);

       

      AIArtSet set =NULL;

      sAIArtSet->NewArtSet(&set);

      sAIArtSet->LayerArtSet(lh, set);

       

      // 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);

       

      ////End

       

      Please help.

       

      Thanks.