Author Topic: dictsearch to remove all xref Raster, DWF, PDF overlays  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6151
dictsearch to remove all xref Raster, DWF, PDF overlays
« on: July 03, 2011, 10:26:56 AM »
This thread made me wonder http://forums.augi.com/showthread.php?t=131322

The following statements are exploring and making some assumptions from little time researching:

So a xref is BlockTableRecord ............

A RasterImage(Dwf and Pdf are similar)

Basically you have a drawable entity for a raster image that is the actual object in model space.
You also have a raster definition that does all the work that tells the entity what do and handles the linking to source file.
So it is like the same relationship of a blockDefinition and a BlockReference(Insertion)

When you attach a raster, Pdf, Dwf a dictionary is added to the NamedObjectDictionary and a entry that is the definition is added for each image etc....

If you delete the  raster, dwf, or pdf entity it does not remove the dictionary entry.
If you use Detach then it removes entry.
Deleting the entries removes the definitions and linking etc....

In Lisp can you do the following?

---Delete all raster, pdf, dwf references(actual visible entity)
---Delete all entries in a dictionary in the NamedObjectDictionary which are from the following
    ---ACAD_DWFDEFINITIONS
    ---ACAD_IMAGE_DICT
    ---ACAD_PDFDEFINITIONS

Or you guys already got it figured out and he should have asked the question here instead of Aug so I would not of wasted the time wondering?----- and could have already done it in .NET






« Last Edit: September 15, 2011, 06:52:42 AM by Jeff H »

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: dictsearch to remove all xref Raster, DWF, PDF overlays
« Reply #1 on: July 03, 2011, 10:35:17 AM »
Or you guys already got it figured out and he should have asked the question here instead of Aug so I would not of wasted the time wondering?

:-D  most likely  :lol:

DjJazzyJeffTN

  • Guest
Re: dictsearch to remove all xref Raster, DWF, PDF overlays
« Reply #2 on: September 10, 2013, 09:27:28 AM »
Thank you so much. The link listed at the top gave me just what I needed.
----->http://forums.augi.com/showthread.php?t=131322

The Code that I grabbed from a user named marko_ribar is as follows:


"(defun c:detachall (/ adoc msp)
  (vl-load-com)
  (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
  (setq msp (vla-get-modelspace adoc))
  (vlax-for ent   msp
    (vl-catch-all-apply 'vla-detach (list ent))
    (if
      (or
   (= (vl-catch-all-error-p
        (vl-catch-all-apply 'vla-get-file (list ent))
      )
      nil
   )
   (= (vl-catch-all-error-p
        (vl-catch-all-apply 'vla-get-path (list ent))
      )
      nil
   )
   (= (vl-catch-all-error-p
        (vl-catch-all-apply 'vla-get-imagefile (list ent))
      )
      nil
   )
   (= (vla-get-objectname ent) "AcDbOle2Frame")
      )
       (vla-delete ent)
    )
  )
  (vl-cmdf "_.-xref" "D" "*")
  (vl-cmdf "_.-image" "D" "*")
  (if (ssget "_X" '((0 . "*UNDERLAY")))
    (vl-cmdf "_.externalreferences")
  )
  (princ)
)"

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: dictsearch to remove all xref Raster, DWF, PDF overlays
« Reply #3 on: September 10, 2013, 01:35:51 PM »