Find out Layer(id)?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Find out Layer(id)?

Post by rylleman »

I have the name of a layer (child of a switch-layer) but how do I find out it's id?
I can get the layer-id for a selected layer easy enough but how do I get it for other layers?
Would the easiest thing be to get the number of layers in the switch, then move between them and see if the current layer's name matches the one I'm looking for and when it does get the id of that layer and finally select the original layer again?
Or is there any function to get the id of a named layer?
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

It seems that the interface to get the layer's ID is not implemented for the layer it self. It is implemented for Group Layer class type only or for the MohoDoc class if you want to access a root layer.
So the only way is the one you suggested.
-G
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Suspected that was the case but hoped for something simpler.
Thanks anyway Genete!
Post Reply