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

how to get layerCount and layerName details

Participant ,
May 18, 2023 May 18, 2023

Copy link to clipboard

Copied

hi all,

layerdetails.cpp

AIErr retrieveLayerDetails() {

  AIErr result = kNoErr;

ai::int32 documentLayerCount;

AILayerHandle layerHandle;

   result = sAILayer->CountLayers(&documentLayerCount);

    std::string documentLayerCountChar = std::to_string(documentLayerCount);   

 

ai::UnicodeString eachLayerTitle("");

    

    result = sAILayer->GetLayerTitle(layerHandle, eachLayerTitle);

std::string documentEachLayerName = eachLayerTitle.as_UTF8();

  return error;

}

 

the above code i used to retrieve the layercount and layer name details so i'll get proper layer count and layer name from the document.

i have created a panel using c++ to display the details of layer.
so i want to again retrieve the layer details when i edit the layer name,  when i click on the refresh button 


(IBAction)refreshSelectedTab:(NSButton *)sender {

    @try

    {

        refreshPanel();

    }

    @catch(NSException *err)

    {

        NSLog(@"Err:%@",err.description);

    }

}

the above code i used to refresh the panel after clicking it on refresh button.


file name:plugin.cpp

void refreshPanel()

{

  retrieveLayerDetails();//so here i called same function to retrieve the layercount and layer name

}

 

after clicking on the refresh button i called retrieveLayerDetails(); same function to retrieve the layer name and layer cout ..when i call retrieveLayerDetails(); from objevtive-c the layer count and layer name is not get retrieving .

so any please kindly help me to solve this problem

Thank you

TOPICS
SDK

Views

245

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 ,
May 18, 2023 May 18, 2023

Copy link to clipboard

Copied

LATEST

This sounds even more likely to be the context problem I described in your other thread. Give that a try for this as well.

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