Report Inappropriate Content
Top Print
This Forum is closed for replies.
|
| Subject |
Referencing Layers |
| Author |
Jonathan Bird |
| Date |
Aug 17, 2009 |
| Message |
Hello,
Is there a way to reference a group name of layers rather than a specific layer? If the group was always to be 3rd down the TOC could I reference 'layer' 3 even though it's not a single layer?
What I have at present is the code below and the screenshot on the left of the attachment. What I will need to reference, or work around, is referenceing a selection in one of the layers under 'blank schemeing' on the right screen shot of the attachment.
Many thanks in advance for any help.
Jon |
| |
Private Sub UIButtonControl1_Click()
Dim pEditor As IEditor
Dim pID As New UID
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pActiveView As IActiveView
Dim pFeatureLayer As IFeatureLayer
Dim pDataset As IDataset
Dim LayerCount As Integer
Dim pFeatureSelection As IFeatureSelection
Dim pQueryFilter As IQueryFilter
Dim i As Integer
Dim player As ILayer
Set pMxDoc = Application.Document
Set pMap = pMxDoc.FocusMap
pID = "esriCore.Editor"
Set pEditor = Application.FindExtensionByCLSID(pID)
Set pActiveView = pMap
For i = 0 To pMap.LayerCount
If pMap.Layer(i).Name = "Blank Scheming" Then
Set player = pMap.Layer(i)
Exit For
End If
Next i
|
| |
layer selection.doc (opens in new window)
|