ArcGIS Desktop のコマンド名・UID の取得

投稿日:2016/9/1 (木) 更新日:

Sub getCommandsUID()
    Dim pApplication As IApplication
    Set pApplication = Application
     
    Dim pDocument As IDocument
    Set pDocument = ThisDocument
     
    Dim pCommandBars As ICommandBars
    Set pCommandBars = pDocument.CommandBars
     
    Dim pCommandItem As ICommandItem
    Set pCommandItem = pApplication.CurrentTool             'カレント ツールの取得
'    Set pCommandItem = pCommandBars.Find("PanZoom_ZoomIn") 'コマンドの名称から取得
     
    Dim pCommand As ICommand
    Set pCommand = pCommandItem.Command
     
    Debug.Print "'" & pCommand.Caption, pCommandItem.Name, pCommandItem.ID 'GUID (CLSID / ProgID)
 
End Sub

関連記事

-プログラミング, ArcGIS
-, ,

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.