在文件依赖关系列表中创建新条目。(已过时) 支持的平台:仅窗口 签名工 务 局: object.CreateEntry Feature, FullFileName, AffectsGraphics, noIncrement
返回值(RetVal)无返回值。 言论此方法采用指示功能说明的字符串。该字符串与文件依赖项列表 (FDL) 条目一起存储,并标识创建此条目的应用程序或功能,例如 Acad::xref。不会对功能字符串执行唯一的应用程序名称检查。此方法还采用一个参数来指示存储在 FDL 中的文件的名称,并且可以包含存储的路径(如果有)。 如果未包含路径,AutoCAD 将在当前目录和 AutoCAD 支持文件搜索路径中搜索文件,并将找到的文件与条目一起存储。如果找不到文件或无法打开该文件,则不会创建任何条目并返回 0。如果找到该文件,则其时间/日期和文件大小将与条目一起存储,并为条目分配唯一索引并返回。 可以使用此方法通过将noIncrement设置为 来重新创建一组条目。这可以防止当条目已在 FDL 中时引用计数的增加。如果将noIncrement设置为 ,则可以多次添加同一条目。在这种情况下,条目的引用计数将递增,以记录该条目在FDL中引用的次数。永远不会创建重复记录。TrueFalse 例子工 务 局: Sub Example_CreateEntry() ' 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_CreateEntry() ;; 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)) ".")) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:35
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.