UpdateEntry メソッド(ActiveX)

ファイル従属リスト内の指定された項目を削除して再作成します。

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

構文と要素

VBA:

object.UpdateEntry Index
object

タイプ: FileDependencies

このメソッドが適用されるオブジェクト。

Index

アクセス: 入力のみ

タイプ: 長整数型

ファイル従属リスト内の項目のインデックス。

戻り値(RetVal)

戻り値はありません。

注意

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

VBA:

Sub Example_UpdateEntry()
    ' This example adds an entry to the File Dependency List, returns its Index, updates
    ' the entry, and then removes the entry.

    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 FDLIndex As Long
    FDLIndex = objFDLCol.CreateEntry("acad:xref", "c:\referenced.dwg", True, True)
    MsgBox "The number of entries in the File Dependency List is " & objFDLCol.Count & "."
    
    Dim IndexNumber As Long
    IndexNumber = objFDLCol.IndexOf("acad:xref", "c:\referenced.dwg")
    Dim IndexString As String
    IndexString = CStr(IndexNumber)
    MsgBox "The index of the new entry is " & IndexString & "."
    
    objFDLCol.UpdateEntry FDLIndex
    
    objFDLCol.RemoveEntry FDLIndex, True
    MsgBox "The number of entries in the File Dependency List is " & objFDLCol.Count & "."
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_UpdateEntry()
    ;; This example adds an entry to the File Dependency List, returns its Index, updates
    ;; the entry, and then removes the entry.
    (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 FDLIndex (vla-CreateEntry objFDLCol "acad:xref" (findfile ".\\Sample\\Sheet Sets\\Architectural\\Res\\Wall Base.dwg") :vlax-true :vlax-true))
    (alert (strcat "The number of entries in the File Dependency List is " (itoa (vla-get-Count objFDLCol)) "."))
    
    (setq IndexNumber (vla-IndexOf objFDLCol "acad:xref" (findfile ".\\Sample\\Sheet Sets\\Architectural\\Res\\Wall Base.dwg")))
    (setq IndexString (itoa IndexNumber))
    (alert (strcat "The index of the new entry is " IndexString "."))
    
    (vla-UpdateEntry objFDLCol FDLIndex)
    
    (vla-RemoveEntry objFDLCol FDLIndex :vlax-true)
    (alert (strcat "The number of entries in the File Dependency List is " (itoa (vla-get-Count objFDLCol)) "."))
)