ArcMap の TOC で選択したレイヤーのフィールド数をカウント

 2016/9/1 (木)    

Public Sub FieldCount()
    Dim pMxDocument As IMxDocument
    Set pMxDocument = ThisDocument
     
    Dim pFeatureLayer As IFeatureLayer
    Set pFeatureLayer = pMxDocument.SelectedLayer
     
    Dim pFeatureClass As IFeatureClass
    Set pFeatureClass = pFeatureLayer.FeatureClass
     
    MsgBox "選択レイヤのフィールド数 : " & pFeatureClass.Fields.FieldCount
    Debug.Print "選択レイヤのフィールド数 : ", pFeatureClass.Fields.FieldCount
     
End Sub

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.