Private Sub testAnnoClasses() 'sample input Dim intAnnoClassID As Integer intAnnoClassID = 0 '------------ Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pMap As IMap Set pMap = pMxDoc.FocusMap Dim pFeatureLayer As IFeatureLayer Set pFeatureLayer = pMap.Layer(0) Dim pAnnoClass As IAnnoClass Set pAnnoClass = pFeatureLayer.FeatureClass.Extension Dim pSymbolColl As ISymbolCollection2 Set pSymbolColl = pAnnoClass.SymbolCollection Dim pSymbolIdentifier As ISymbolIdentifier2 pSymbolColl.Reset Set pSymbolIdentifier = pSymbolColl.Next MsgBox pSymbolColl.Count For i = 0 To pSymbolColl.Count - 1 If pSymbolIdentifier.ID = intAnnoClassID Then MsgBox "i=" & i & " symbolID=" & pSymbolIdentifier.ID & "," & pSymbolIdentifier.Name Exit For End If Set pSymbolIdentifier = pSymbolColl.Next Next i End Sub
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.