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

How to create CS5 arrow

New Here ,
Aug 27, 2012 Aug 27, 2012

Please teach me the creation method of the arrow added newly by CS5.

It is two that I do not understand.

How should AIPatternHandle of an arrow be acquired? I found AIBeautifulStrokesSuite::SetArrowheadOptions. However, there is no telling where beginSymbol and endSymbol should be acquired from.

Another is the creation method with an arrow of PathArt. I tried AIBeautifulStrokesSuite::GenerateArt. However, the divided arrow has been created in this API.

TOPICS
SDK
1.1K
Translate
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
Adobe
Guide ,
Sep 04, 2012 Sep 04, 2012

Well, the first part is easy to explain: beginSymbol & endSymbol are symbols You can acquire them using the AISymbolSuite (AISymbol.h), either by name or by index (from the master symbol list).

The second part I don't fully understand. Can you elaborate? I can't what you're trying to create exactly.

Translate
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
New Here ,
Sep 04, 2012 Sep 04, 2012

Thank you for your reply.

I misunderstood the 2nd problem.

A setup of the arrow was completed by the following methods.

    AIDictionaryRef paramDict = NULL;

    AIStrokeStyle strokeStyle;

    AIBoolean hasBrush;

    AIReal scaleFactor;

    AIBoolean canAccept;

    err = sAIBeautifulStrokes->GetArtStrokeParams(hArt, paramDict, &strokeStyle, &hasBrush, &scaleFactor, &canAccept);

          AIPatternHandle beginSymbol= NULL, endSymbol= NULL;

    AIReal beginScale = 1.0, endScale = 1.0;

    ArrowTipAlignment alignment;

    AIBoolean mixedBeginArrows = FALSE, mixedEndArrows = FALSE;

    err = sAIBeautifulStrokes->GetArrowheadOptions(

        paramDict, &beginSymbol, &endSymbol,

                    &beginScale, &endScale, &alignment,

        &mixedBeginArrows, &mixedEndArrows);

    if (beginSymbol && !endSymbol) {

        err = sAIBeautifulStrokes->SetArrowheadOptions(

            paramDict, &beginSymbol, &beginSymbol,

                        beginScale, beginScale, alignment);

    } else if (!beginSymbol && endSymbol) {

        err = sAIBeautifulStrokes->SetArrowheadOptions(

            paramDict, &endSymbol, &endSymbol,

                        endScale, endScale, alignment);

    }

    err = sAIDictionary->Release(paramDict);

However, the 1st problem is not solved.

I tried the following ways.

    ai::int32 count;

    ASBoolean includeUnlisted;

    ai::UnicodeString name;

    AIPatternHandle symbolPattern;

    //includeUnlisted = true

    includeUnlisted = true;

    err = sAISymbol->CountSymbolPatterns(&count, includeUnlisted);

    TRACE(L"includeUnlisted = true:%d\n", count);

    for (ai::int32 i = 0; i < count; ++i) {

        AIPatternHandle symbolPattern;

        err = sAISymbol->GetNthSymbolPattern(i, &symbolPattern, includeUnlisted);

        err = sAIPattern->GetPatternName(symbolPattern, name);

        TRACE("%s\n", name.as_Platform().c_str());

    }

    //includeUnlisted = false

    includeUnlisted = false;

    err = sAISymbol->CountSymbolPatterns(&count, includeUnlisted);

    TRACE(L"includeUnlisted = false:%d\n", count);

    for (ai::int32 i = 0; i < count; ++i) {

              err = sAISymbol->GetNthSymbolPattern(i, &symbolPattern, includeUnlisted);

        err = sAIPattern->GetPatternName(symbolPattern, name);

        TRACE("%s\n", name.as_Platform().c_str());

    }

    //document

    AIDocumentHandle document = NULL;

    sAIDocument->GetDocument(&document);

    err = sAISymbol->CountSymbolPatternsFromDocument(&count, document);

    TRACE(L"document:%d\n", count);

    for (ai::int32 i = 0; i < count; ++i) {

        err = sAISymbol->GetNthSymbolPatternFromDocument(i, &symbolPattern, document);

        err = sAIPattern->GetPatternName(symbolPattern, name);

        TRACE("%s\n", name.as_Platform().c_str());

    }

The value of "count" is always 6.

And the six are in a symbol palette.

How can I get a symbol from the master symbol list?

Translate
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
Guide ,
Sep 05, 2012 Sep 05, 2012
LATEST

I'm not sure why the problem is, so bear with me. There are six symbols -- if there are six symbols in the master symbol list, that's correct. You look like you have the correct code to retrieve a handle, so you're good.

Actually, maybe I do get it. Are you asking where the arrowhead symbols are? Because they're not actually in the document -- that takes a bit of effort to get (something I only recently learned out to do) so if that's the problem I can help there.

Translate
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