• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get & Set a path brush with the C++ SDK. How to use AIBeautifulStrokes.

New Here ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

Hi everybody,

 

I am struggling on what I thought it was a simple task. I need to be able to pick a brush and apply it to a stroke. In the particular case I need to be a repeated pattern. I am in the dark at the moment. I have managed to do it from the GUI but I am not able to get almost anything working.

Summarizing I need to:

- create a pattern from group of paths (the same I would do in the GUI as showed in the images below)

Gennaro5EA5_0-1622648134793.png        Gennaro5EA5_1-1622648214769.png

- apply this pattern brush to a path

- (optional) save this brush into a brush file

 

I think AIBeautifulStrokes is the key to get this done but I cannot make it work. I have tried something like this to create a pattern brush with a polygon drawn previously, and set it to a path named "art":

error = sAIPattern->NewPattern(&sPatternHandle);
error = sAIPattern->SetPatternArt(sPatternHandle, polygon);
ai::UnicodeString newName;
error = sAIPattern->NewPatternName(newName);
error = sAIPattern->SetPatternName(sPatternHandle, newName);

error = sAIBeautifulStrokes->CreateParamsDict(NULL, advStrokeParams);
error = sAIBeautifulStrokes->SetArtPaint(advStrokeParams, polygon);

error = sAIBeautifulStrokes->GetArtStrokeParams(art, paramDict, &strokeStyle,& hasBrush, &scaleFactor, &canAccept);
error = sAIBeautifulStrokes->SetArtPatternPaint(paramDict, polygon, polygon, polygon, NULL, NULL, kAddSpace, 1, kAutoCentered, kAutoCentered);

 

It doesn't work. Also, if I set it from the GUI and I do GetArtPatternPaint, I get that all the AIPatternHandle are NULL.

Please can you help me? it is getting frustrating and I cannot find anywhere examples nor explanations.

Thanks in advance,

G.

TOPICS
Draw and design , SDK

Views

115

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Adobe