CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

UpdateEntry Method (ActiveX)

2023-1-2 22:45| 发布者: admin| 查看: 181| 评论: 0|来自: AutoCAD

摘要: 擦除并重新创建“文件依赖关系列表”中标识的条目。(已过时)

擦除并重新创建“文件依赖关系列表”中标识的条目。(已过时)

支持的平台:仅窗口

签名

工 务 局:

object.UpdateEntry Index
对象

类型:文件依赖关系

此方法适用的对象。

指数

访问:仅输入

类型:

文件依赖项列表中的条目索引。

返回值(RetVal)

无返回值。

言论

没有额外的评论。

发布信息

释放:AutoCAD 2000 至 AutoCAD 2017

例子

工 务 局:

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)) "."))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 19:18

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部