Copy link to clipboard
Copied
hi all,
i want to retrieve artboard details adobe sdk .. created plugin in xcode
the following code i used to retrieve the details.
ASInt32 artboardIndex = 0;
ai::ArtboardList artboardList;
result = sAIArtboardSuite->GetArtboardList(artboardList);
result = sAIArtboardSuite->GetActive(artboardList,artboardIndex);
ai::ArtboardProperties artboardProperties;
result = sAIArtboardSuite->GetArtboardProperties(artboardList, artboardIndex, artboardProperties);
AIRealRect artboardRect;
result = artboardProperties.GetPosition(artboardRect);
but im getting an error saying that
Undefined symbol: ai::ArtboardList::ArtboardList()
please anyone help me to resolve this
Thank you
Copy link to clipboard
Copied
Did you load the suite using AcquireSuite?
Copy link to clipboard
Copied
Yes @superpanic i have acquired suites
Copy link to clipboard
Copied
Sometimes you don't need to use a suite's functions, but need one or more of the definitions in it, in which case you can include it but not necessariy acquire it.
Copy link to clipboard
Copied
I did a search for "ArtboardList" in the SDK headers and found it is defined in "IAIArtboards.hpp" so you might try including that file.
Copy link to clipboard
Copied
hi @Rick E Johnson i have included "IAIArtboards.hpp" this file.. but still showing Undefined symbol: ai::ArtboardList::ArtboardList()
build failed
Copy link to clipboard
Copied
Bummer. Sorry that didn't work. I'm sure there are a lot of people on this forum who have done this and can help.
Another option is to use CORE from Hot Door (http://hotdoorcore.com), as I do. It's free, and a lot easier to use than the SDK, although you can add SDK suites for anything not included in CORE. It's essentially c++ wrappers that simplify access to several versions of the SDK and adds things like cross-platform UI similar to Adobe's ADM which was sadly discontinued with AI16.
I'd download CORE and open the Panel sample. Add #include "hdicoreArtboard.h" at the top of panelPlugin.cpp.
Look for the callback "__artboardChangedCB()" which contains this:
const uint32_t count = currDoc->artboardCount();
Now add a for loop and examine the artboards.
for (uint32_t i = 0 ; i < count ; i++){
std::unique_ptr<Artboard> thisArtboard = currDoc->artboardAtIndex(i);
// check whatever properties you want in the console window bottom-right in Xcode,
// then change the code to something meaningful
std::cout<<"Do something with the properties of thisArtboard"<<std::endl;
}
Copy link to clipboard
Copied
Following either (Xcode or VStudio) project for SnippetRunner, you'll find an entry to compile IAIArtboards.cpp which has the code for both ArtboardList and ArtboardProperties .
Copy link to clipboard
Copied
This is what I was about to post. You need to include the relevant CPP. If you ever get an `Undefined symbol` that means you are missing code, which is either a library or a .cpp file.