关于卸载外部参照 (VBA/ActiveX)
若要卸载外部参照,请使用以下方法。Unload 卸载当前图形中未使用的参照文件时,由于不必读取和显示不必要的图形几何图形或符号表信息,因此 AutoCAD 性能得到增强。在重新加载外部参照之前,外部参照几何和任何嵌套外部参照的几何图形不会显示在当前图形中。 卸载外部参照定义此示例附加外部参照,然后卸载外部参照。此示例使用在示例目录中找到的 3D House.dwg 文件。如果没有此映像,或者它位于其他目录中,请为变量插入有效的路径和文件名。PathName Sub Ch10_UnloadingExternalReference() On Error GoTo ERRORHANDLER ' Define external reference to be inserted Dim xrefHome As AcadBlock Dim xrefInserted As AcadExternalReference Dim insertionPnt(0 To 2) As Double Dim PathName As String insertionPnt(0) = 1 insertionPnt(1) = 1 insertionPnt(2) = 0 PathName = "c:/Program Files/Autodesk/AutoCAD release/3D House.dwg" ' Add the external reference Set xrefInserted = ThisDrawing.ModelSpace. _ AttachExternalReference(PathName, "XREF_IMAGE", _ insertionPnt, 1, 1, 1, 0, False) ZoomAll MsgBox "The external reference is attached." ' Unload the external reference definition ThisDrawing.Blocks.Item(xrefInserted.name).Unload MsgBox "The external reference is unloaded." Exit Sub ERRORHANDLER: MsgBox Err.Description End Sub |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 11:58
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.