Purge Unused Raster Image Reference

Purge Unused Raster Image Reference

GeryKnee
Advocate Advocate
5,140 Views
21 Replies
Message 1 of 22

Purge Unused Raster Image Reference

GeryKnee
Advocate
Advocate

Hello to everyone.

I come back to my previous "purge all unused AcDbRasterImageDef entities" Post.

Problem ::

 I atach an image for example "C:\Users\Gery\Desktop\ACAD\[Problem]\Purge Unused Raster Image Reference\MyRemovedJpgXRef.jpg"

 I save the drawing document.

 I Quit Autocad

 I Restart Autocad by opening the previous document

 I delete the imade reference. The document now does'n include the image xref object.

 I save the drawing document.

 I Quit Autocad

 I Restart Autocad by opening the previous document

 I export document as DXF format text

 I open the exported DXF 

 Opening DXF using notepad

 I see those lines :::

..............
AcDbDictionary
281
1
3
MyRemovedJpgXRef
350
264
0
................
AcDbRasterImageDef
90
0
1
C:\Users\Gery\Desktop\ACAD\[Problem]\Purge Unused Raster Image Reference\MyRemovedJpgXRef.jpg
10
253.0
20
165.0
11
.................

 That is causing many problems with document. Those problems I described in my first post.

 Is there a solution to purge eny LIBRARY REFERENCE to a DELETED XREF REFERENCE as can be purged unsused BLOCK REFERNCED ?????

Thanks,

Gery

 

0 Likes
Accepted solutions (2)
5,141 Views
21 Replies
Replies (21)
Message 21 of 22

Lott99
Enthusiast
Enthusiast

@trevor.bird.au Sweet, thank you. It works great. I appreciate you doing it so quickly. Now I can learn more about LISP too when I go through and see what all was modified.

0 Likes
Message 22 of 22

trevor.bird.au
Advocate
Advocate

All good, thanks.

 

I just made the following change to the program:

...
( (not ImageFile_fqn)
  ;; Image references exist but image file cannot be found.
  (entdel imageref_ename)
);(not ImageFile_fqn)
...

I originally had (entdel imagedef_ename) but it should be (entdel imageref_ename), although the image reference is deleted either way, but this change is for correctness of the code.

 

Thanks.

 

Regards,

Trevor Bird

 

0 Likes