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

Get selected art object

New Here ,
Nov 25, 2008 Nov 25, 2008

Copy link to clipboard

Copied

I am trying to get the user selected art object properties, I tried written the code below and realised this get all the objects in the layer and store all of them in the AIArtHandle instead of what I selected. I only want to print out the one user selected, how??? any help???

AIMatchingArtSuite *aiArtMatch;
sBasic->AcquireSuite( kAIMatchingArtSuite, kAIMatchingArtSuiteVersion, (const void**)&aiArtMatch );
AIArtHandle **artStore = NULL;
long artCount = 0;
aiArtMatch->GetSelectedArt(&artStore, &artCount);

AIArtHandle my_artHandle = (*artStore)[0];
TOPICS
SDK

Views

1.1K

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
Adobe
Guide ,
Nov 25, 2008 Nov 25, 2008

Copy link to clipboard

Copied

I believe the problem you're having is that selection 'climbs upwards'. That is, if you select some art you also select it's parent, and its parent's parent, etc.

So even if you just select a single path, you're also selecting the group that represents the layer. As such, you might be able to just ask the art if it's a layer group using AIArtSuite::IsArtLayerGroup() and ignore it if it is. I believe the rest will be an accurate depiction of what's selected, be it on art or many.

Oh, and if the art you've selected is a compound path, that call will also include all the sub-component paths. If you don't want them, you can also ask each art in your set if it's part of a compound path by using AIArtSuite::GetArtUserAttr() with kArtPartOfCompound; I believe you can ignore anything that has that, though I'm not sure how it responds when you pass it the container kCompoundPathArt.

Hope that helps!

Votes

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
New Here ,
Nov 26, 2008 Nov 26, 2008

Copy link to clipboard

Copied

Yes, you are correct, and your proposed solution work well, thanks.

Votes

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
Engaged ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

LATEST

Can you send me the exact code for get selected art object.

Regards

Kundan

Votes

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