Unload method example
Sub Unload_Example()
Dim oXref As AcadExternalReference
Dim PtOrg(0 To 2) As Double: PtOrg(0) = 20: PtOrg(0) = 20: PtOrg(2) = 0
Dim sFullPath As String: sFullPath = "D:/a/Blocks2D/Meubels/BEPL06_dubbel.dwg"
Set oXref = ThisDrawing.ModelSpace.AttachExternalReference(sFullPath, "BlockNameForXref", PtOrg, 1, 1, 1, 0, False)
ZoomAll
Dim sBuf As String
sBuf = "The external reference with path: " & vbCrLf
sBuf = sBuf & sFullPath & vbCrLf
sBuf = sBuf & "has been attached as " & oXref.Name
MsgBox sBuf
ThisDrawing.Blocks.Item(oXref.Name).Unload
MsgBox "The external reference has been unloaded."
ThisDrawing.Blocks.Item(oXref.Name).Detach
MsgBox "The external reference has been detached."
End Sub
© Bricsys NV. All rights reserved. |