You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects General forum

How use ILayerDescriptor   vincent Lahaye Jun 21, 2006
Re: How use ILayerDescriptor   Gopisetti Parvathesam Jun 23, 2006
Re: How use ILayerDescriptor   vincent Lahaye Jun 26, 2006
Re: How use ILayerDescriptor   Kirk Kuykendall Jun 26, 2006
Re: How use ILayerDescriptor   Chris Morgan Jul 03, 2006
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject How use ILayerDescriptor 
Author vincent Lahaye 
Date Jun 21, 2006 
Message Hi,

I need to get unique ID from a layer. I don't want the LayerId from TOC (index 0 on top ...).

I read about ILayerDescriptor.id, but I don't know how to use this object.

Goal: I want to be able to get a specific layer with an internal value or other. I don't want use the layer's name, because user can change the name and, I don't want use index from TOC because the position of the layer in the TOC can change too.

Can you help me?

Thank you

Vincent 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How use ILayerDescriptor 
Author Gopisetti Parvathesam 
Date Jun 23, 2006 
Message Check the below links.

http://forums.esri.com/Thread.asp?c=93&f=993&t=164493&mc=4#msgid482887

http://forums.esri.com/Thread.asp?c=93&f=1730&t=161500&mc=2#msgid472802

Hope this helps you. 
  Regards,
G Parvathesam.
Sr Systems Analyst
Weston Solutions
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How use ILayerDescriptor 
Author vincent Lahaye 
Date Jun 26, 2006 
Message Thank you for reply Gopisetti,

but it's not really what I need. I can't use the layer name because user can modify this name, and I can't use datasource name because it'possible to have 2 or 3 layers with same datasource name with differents legend. If layer change position, I need to know which layer I have and with which legend. It's the reason why i'm looking for an internal layer ID other of Arcmap's index (0 on topmost).

If someone knows something about this, I'm listening!.

If it's not possible, I would know too.

Thank you. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How use ILayerDescriptor 
Author Kirk Kuykendall 
Date Jun 26, 2006 
Message Did you try using a layer extension?

At 9.1 you should be able to put some sort of tag in a propertyset, then add it via ILayerExtensions.Add. The propertyset will then travel with the layer whereever it goes, even if saved to a .lyr file. 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
http://www.ambergis.com
Now Answering questions at:
http://gis.stackexchange.com/


 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How use ILayerDescriptor 
Author Chris Morgan 
Date Jul 03, 2006 
Message Hi,

I asked about this a while ago (a few years ago?).
Basically there is no way to identify a layer in the TOC other than its current index (taking grouped layers into account) and name, which can both be changed by the user.
I have ended up hooking all the IActiveViewEvents
methods to check when items are reordered, added, deleted, renamed etc to re-enumerate the TOC and update my local index of the layers I am tracking.
This is not ideal, but it was the best I could come up with.

cheers,

Chris
 
  ----------------------------------------
Chris Morgan
Lynx Information Systems Ltd
London, UK
www.lynxinfo.co.uk
----------------------------------------