It may be not what you want to hear but the best workaround is to have unique layer names.
Otherwise you have to loop thoroug all the layers in the document and collect matching names. That is often slow, sometimes very slow.
It may be not what you want to hear but the best workaround is to have unique layer names.
Otherwise you have to loop thoroug all the layers in the document and collect matching names. That is often slow, sometimes very slow.