Skip to main content
Known Participant
May 18, 2023
Question

how to get layerCount and layerName details

  • May 18, 2023
  • 1 reply
  • 364 views

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

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

A. Patterson
Inspiring
May 18, 2023

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