rcb007 Posted January 7, 2021 Posted January 7, 2021 I was looking around the web and found this code that takes PDFs and deletes them from the drawing. The code seemed like it would be easy to change the function from delete to possible change the external reference path to none. Just not having any luck figuring it out. I did not know if there might be a way it could adapt to it or not. (vl-load-com) ; detach pdf underlay ;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-detach-all-pdfs/td-p/8852704 (defun c:delpdf (/ ss tbl dict) (if (setq ss (ssget "_X" '((0 . "PDFUNDERLAY")))) (progn (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq tbl (tblsearch "layer" (cdr (assoc '8 (entget ename))))) (if (not (= (logand (cdr (assoc '70 tbl)) 4) 4)) ; skip locked layers (entdel ename) ) ); foreach (setq dict (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object)))) ;; (vlax-map-collection (vla-item dict "ACAD_PDFDEFINITIONS") 'vla-delete) (vlax-map-collection (vla-item dict "ACAD_PDFDEFINITIONS") 'vla-remove) (vlax-release-object dict) ); progn ); if (princ)) Thanks for any pointers! Quote
Recommended Posts
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.