HI All,
I've search and tried every piece of code I could find on here to detach XRefs but none of them have worked for me. When I run the code below it does not find any Xrefs to detach. There are no frozen or locked layers.
Dim oBlock As AcadBlock
For Each oBlock In ThisDrawing.Blocks
If oBlock.IsXRef Then
oBlock.Detach
End If
Next
Attached is a drawing with the Xrefs that I cannot detach.
Any help would be greatly appreciated!
FYI AutoCAD 2013, Win 7
Solved! Go to Solution.
Solved by meck. Go to Solution.
Solved by Alfred.NESWADBA. Go to Solution.
Hi,
your drawings showes referenced images, but not referenced drawings, so not really XRef's.
You can use this code >>>here<<< to remove image-references from a drawing.
Good luck, - alfred -
Thanks!
I was getting an error on the line "oSset.SelectOnScreen dxfCode, dxfValue". As it turns out I didn't need that part of the code. The final code looks like this...
Sub DeleteImages()
Dim oEnt As AcadEntity
Dim oDict As AcadDictionary
Set oDict = ThisDrawing.Dictionaries("ACAD_IMAGE_DICT")
If oDict.Count > 0 Then
Dim oImageDef As Object
For Each oImageDef In oDict
oImageDef.Delete
Next
End If
Set oDict = Nothing
End Sub