Jump to content

Lisp To Remove All External References By Force


Recommended Posts

Posted

I have a dwg file that contains several external references that I can't detect. It seems like some elements, blocks, etc. copied from another drawing, and that original drawing was the one containing these external references. So, it seems like they are like ghost external references or something, and I can't get rid of them. Thanks in advance.

Posted (edited)

Make sure all layers are on, thawed, and unlocked.

run audit then purge.

See if you have any nested blocks that have a reference in them.

Still there ? might just be easier to start a new drawing and copy things over. with the help of steal

 

Edited by mhupp
  • Like 2
Posted

If it was just one drawing I would do the usual purge, audits and so on and like mhupp just copy to a new drawing and replace the bad one, you can also wblock the drawing which is a common solution. Creating a LISP for just one drawing is a bit of overkill unless someone has something already written.

 

Remember to select the objects mouse top left to bottom right and not the other way else you might still get these rogue objects.

 

If not you can look into the blocks you want to keep, there might be one of them that references these 'ghost' elements, - could try delete the block, purge and insert a new version

 

 

... but for a one off drawing writing and checking a LISP routine sounds like a lot of work

  • Like 1
  • Agree 1
Posted
4 hours ago, Elektrik said:

I have a dwg file that contains several external references that I can't detect. It seems like some elements, blocks, etc. copied from another drawing, and that original drawing was the one containing these external references. So, it seems like they are like ghost external references or something, and I can't get rid of them. Thanks in advance.

Post your file.

  • Like 2
Posted (edited)

case0. Run PURGE, AUDIT

 

case1. Clean up DGN rubbish (paste to command line include "( )" )

(dictremove (namedobjdict) "acad_dgnlinestylecomp")

if anwer is "nil", your drawing is clean

 

case2. use delproxy 

https://forums.autodesk.com/t5/autocad-forum/proxy-objects-acad-p-id-how-do-you-purge-them/td-p/2582872

 

case3. use delblank (maybe purge do this)
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-delete-a-block-if-attributes-are-blank/td-p/2524433

 

case4. DWG->DXF->DWG converting by save as

or by command DXFOUT, DXFIN

 

case5. DWG version downgrade by save as then save as latest version

 

case6. select contents to preserve then use WBLOCK command.

 

case7. Detach all XREF : -XREF > D > * 

 

case8. It doesn't matter if the drawing is changed

select all - qse (quickselect) - set filter to all block - explode  

 

loop this until no more blocks are selected

then redo this routine from case0

Edited by exceed
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...