external references - how do i remove an unloaded xref? Purge won't let me

external references - how do i remove an unloaded xref? Purge won't let me

atribo141141
Enthusiast Enthusiast
8,952 Views
19 Replies
Message 1 of 20

external references - how do i remove an unloaded xref? Purge won't let me

atribo141141
Enthusiast
Enthusiast

I have an unloaded external reference I wish to remove from the drawing file.  I have been successful with detaching or unloading xrefs followed by purging in some order that has worked for me previously.  This one though won't let me purge it.  What am i overlooking?

 

Also in the same discussion, is there a way to count the number and/or types of xrefs in a drawing file?

Thank you in advance.

0 Likes
Accepted solutions (1)
8,953 Views
19 Replies
Replies (19)
Message 2 of 20

Joltremari
Observer
Observer

<Xref> right click it <Detach> should work. Could you be more specific about the issue.

Message 3 of 20

atribo141141
Enthusiast
Enthusiast

I have tried that, yes.  The details are that I created an xref for use in the drawing file.  When I changed the name of that xref, that xref became unreferenced or similar and has a red mark next to it now.  I have tried to right click menu to remove as well as the drop down menu.  I have been able to get them out before by doing a similar process of detaching/unloading/purging to get it removed from the xref menu, but this one I cannot remove.

0 Likes
Message 4 of 20

pendean
Community Legend
Community Legend
Is it an XREF inside another XREF by chance? Those 'child' xrefs need to be removed by opening the 'parent' XREF to detach, you can't do it from the topmost file.
Message 5 of 20

atribo141141
Enthusiast
Enthusiast

Hmm.  This could be the case.  If when I created this file, I copied it from another project which had xrefs contained, perhaps this would result in this way.  I can avoid this going forward and see if I encounter again.  Thank you both for your help.

0 Likes
Message 6 of 20

CGriffin
Enthusiast
Enthusiast

When you open the External Reference Manager dialog box, click one of the icons on the upper RH corner for tree view to see if one is nested in another.

Message 7 of 20

atribo141141
Enthusiast
Enthusiast

I have looked at the tree view and it appears it is not inside of another.  I've screenshot the issue and will see if the attachment comes thru.  Maybe you will see something I don't.  Thank you for your help.

0 Likes
Message 8 of 20

CGriffin
Enthusiast
Enthusiast

I've had some that were stubborn for no good reason... 😉

 

Can you RELOAD it & then DETACH it?

Message 9 of 20

atribo141141
Enthusiast
Enthusiast

I have definitely tried.  I just now tried to select a new path, and loaded another xref in its place to see if that would then allow me to control it and remove it.  No luck.  I will create my file differently next project to avoid this sequence.  Thank you all for your help.

0 Likes
Message 10 of 20

pendean
Community Legend
Community Legend
Message 11 of 20

dbroad
Mentor
Mentor

You probably nested it into another block definition.  

First, you should reload it so you can see where it is.  If you no longer have the xref, you can point the path to another file so at least you can see it.  Delete the internal block references and then you should be able to detach.

Architect, Registered NC, VA, SC, & GA.
Message 12 of 20

atribo141141
Enthusiast
Enthusiast

I have tried that just now.  I selected a new path for the file so I could at least see it and work with it in some way.  The new path I used led to a file with no internal block references so there was no change in the result.  Thank you for your help.

0 Likes
Message 13 of 20

dbroad
Mentor
Mentor

Good.  My point though, was that your xref may have been accidentally nested into an internal block definition.  This can happen when you copyclip and then pastespecial as a block.  Doing that makes it impossible to detach the xref until the container block references are deleted AND then the internal block definition purged from the drawing.  It doesn't matter about the internal references of the undetachable xref.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 14 of 20

CGriffin
Enthusiast
Enthusiast

Ironically... I had this very issue today.

 

I received a drawing from a vendor that had 12 xrefs and 10 would detach--2 were "stuck".

 

After I detached the 10, I saved my file and then systematically erased small sections of the file and then purged. Doing this (and not saving) let me figure out roughly where in the drawing the referenced file is stuck. In my case, I had one portion of the drawing I wanted to keep, so I ended up deleting everything else. Purged. Stubborn xrefs gone.

0 Likes
Message 15 of 20

andkal
Collaborator
Collaborator

To detach unloaded xrefs you can try this short lisp routine from this thread:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/detach-unloaded-xrefs-routine/td-p/8...


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes
Message 16 of 20

_anonandon
Advocate
Advocate

does this link still work??

0 Likes
Message 17 of 20

CGBenner
Community Manager
Community Manager

@_anonandon 

Which link are you referring to?  There are several shared throughout the life of this thread?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes
Message 18 of 20

andkal
Collaborator
Collaborator
Accepted solution
;Mishler, Jeff 
(defun c:remove-unloaded-xrefs ()
(vlax-for block (vla-get-blocks
    (vla-get-activedocument
    (vlax-get-acad-object)))
    (if (and (= :vlax-true (vla-get-isxref block))
                 (= 0 (vla-get-count block))
          );and
         (vla-detach block)
    );if
);vlax for
);defun

• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Message 19 of 20

_anonandon
Advocate
Advocate

thanks, hopefully that was the one i was referring to!! I'll check when my machine unfreezes

Message 20 of 20

CGBenner
Community Manager
Community Manager

@_anonandon Did the information provided answer your question? If so, please use Accept Solution so that others may find this in the future. Thank you very much!

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes