关于重新加载外部参照 (VBA/ActiveX)
如果在处理附着了外部参照的主机绘图时修改了外部参照绘图,则可以使用该方法更新该外部参照绘图。Reload 重新加载时,选定的外部参照图形将在宿主图形中更新。此外,如果已卸载外部参照,则可以随时选择重新加载该外部参照绘图。 重新加载外部参照定义本示例附加外部参照,然后重新加载外部参照。此示例使用在示例目录中找到的 3D House.dwg 文件。如果没有此映像,或者它位于其他目录中,请为变量插入有效的路径和文件名。PathName Sub Ch10_ReloadingExternalReference() 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 to the block Set xrefInserted = ThisDrawing.ModelSpace. _ AttachExternalReference(PathName, "XREF_IMAGE", _ insertionPnt, 1, 1, 1, 0, False) ZoomAll MsgBox "The external reference is attached." ' Reload the external reference definition ThisDrawing.Blocks.Item(xrefInserted.name).Reload MsgBox "The external reference is reloaded." Exit Sub ERRORHANDLER: MsgBox Err.Description End Sub 相关概念 |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 12:57
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.