Index プロパティ(ActiveX)

メニュー、ツールバー項目、ファイル従属リストのエントリのインデックスを指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.Index
object

タイプ: FileDependencyPopupMenuItemToolbarItem

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: はい

Type: 整数型; FileDependency オブジェクトの長整数を除く

メニュー項目またはツールバー項目の位置(インデックスの最初の位置は 0 (ゼロ))。ファイル従属リストでのインデックス。

注意

追加の注意はありません。

例 - FileDependency

VBA:

Sub Example_IndexFDL()
    ' This example reads information from a File Dependency List
    ' Open a drawing from the sample Sheet Sets that contains xrefs, such as
    ' \Sample\Sheet Sets\Architectural\A-01.dwg
    
    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency
    
    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.count & ".")
        
    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_IndexFDL()
    ;; This example reads information from a File Dependency List
    ;; Open a drawing from the sample Sheet Sets that contains xrefs, such as
    ;; .\\Sample\\Sheet Sets\\Architectural\\A-01.dwg
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
        
    (setq objFDLCol (vla-get-FileDependencies doc))
    (alert (strcat "The number of entries in the File Dependency List is " (itoa (vla-get-Count objFDLCol)) "."))

    (setq strTemp "")
    (vlax-for each-objFDL objFDLCol
        (setq strTemp (strcat "Affects graphics?: " (if (= (vla-get-AffectsGraphics each-objFDL) :vlax-true) "True" "False")))
        (setq strTemp (strcat strTemp
			                           "\nFeature: " (vla-get-Feature each-objFDL)
			                           "\nFileName: " (vla-get-FileName each-objFDL)
			                           "\nFileSize: " (itoa (vla-get-FileSize each-objFDL))
			                           "\nFingerprint GUID: " (vla-get-FingerprintGuid each-objFDL)
			                           "\nFoundPath: " (vla-get-FoundPath each-objFDL)
			                           "\nFullFileName: " (vla-get-FullFileName each-objFDL)
			                           "\nIndex: " (itoa (vla-get-Index each-objFDL))
			                           "\nModified?: " (if (= (vla-get-IsModified each-objFDL) :vlax-true) "True" "False")
			                           "\nReferenceCount: " (itoa (vla-get-ReferenceCount each-objFDL))
			                           "\nTimeStamp: " (itoa (vla-get-TimeStamp each-objFDL))
			                           "\nVersion GUID: " (vla-get-VersionGuid each-objFDL)
	                     )
	       )
        (alert strTemp)
    )
)

例 - PopupMenuItem

VBA:

Sub Example_Index()
    ' This example iterates through the first menu in the menu bar
    ' and displays the index for each menu item.
    
    Dim menuItem As AcadPopupMenuItem
    Dim menuIndex As String
    menuIndex = ""
    
    For Each menuItem In ThisDrawing.Application.MenuBar.Item(0)
        menuIndex = menuIndex & menuItem.TagString & " has the index: " & menuItem.index & vbCrLf
    Next menuItem
    MsgBox menuIndex
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Index()
    ;; This example iterates through the first menu in the menu bar
    ;; and displays the index for each menu item.
    (setq acadObj (vlax-get-acad-object))

    (setq menuIndex "")    
    (vlax-for menuItem (vla-Item (vla-get-MenuBar acadObj) 0)
        (setq menuIndex (strcat menuIndex (vla-get-TagString menuItem) " has the index: " (itoa (vla-get-Index menuItem)) "\n"))
    )
    (alert menuIndex)
)