Skip to main content
Participant
May 17, 2025
Question

How to get the Bounds of Art and get the current active document in illustrator 2019 cc SDK.

  • May 17, 2025
  • 2 replies
  • 239 views

I am new to plugin development for illustrator 2019 CC SDK. I got matching through

sAIMatchingArt->GetMatchingArt(&pathSpec, 1, &matching, &artCount); and traversed it to get Art.

I made a type check on the Art: sAIArt->GetArtType(art, type) != kNoErr, indicating that this is an invalid Art. So I cannot get the Bounds of this Art.

 

At the same time, when I want to get the current active document, the returned result is "doc" error. AIDocumentHandle activeDoc = nullptr;
ASErr err = sAIDocument->GetDocument(&activeDoc);
The result of err is "doc", which means I cannot get the current active document.

    2 replies

    Jans ChanAuthor
    Participant
    May 20, 2025

    In fact, I am missing AppContext to call the context of objects in the selected area.
    For example, the following code:

    AppContext appContext(fPluginRef);
    std::vector<AIRealRect> boundsList = GetSelectedArtBounds();

     

    The result of basicArtList is the bounds of the art object I need.

    kglad
    Community Expert
    Community Expert
    May 17, 2025

    in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

    p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



    <"moved from using the community">
    Jans ChanAuthor
    Participant
    May 17, 2025

    thank

    kglad
    Community Expert
    Community Expert
    May 17, 2025

    (you're welcome)