Sub Reload_Example()
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 sFullPathName As String: sFullPathName = "c:\map.dwg"
' Add the external reference to the block
Set xrefInserted = ThisDrawing.ModelSpace. _
AttachExternalReference(sFullPathName, "XREF_MAP", _
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
Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved. |