pmadhwal7 Posted March 9, 2022 Posted March 9, 2022 Hi, All in my dwg their is ole object are overlapped in multiple layouts and I want to remove them in one command because of my dwg file are very heavy, any one have any ide reading this please help Quote
mhupp Posted March 9, 2022 Posted March 9, 2022 (edited) This will hide them. Regen to bring them back. (defun C:ALL-OLE (/ SS) (if (setq SS (ssget "_X" '((0 . "OLE2FRAME")))) (foreach obj (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (redraw obj 2) ;(entdel obj) ;if you just want to delete them ) ) ) Edited March 10, 2022 by mhupp code updated 3 Quote
pmadhwal7 Posted March 10, 2022 Author Posted March 10, 2022 19 hours ago, mhupp said: This will hide them. Regen to bring them back. (defun C:ALL-OLE () (if (setq SS(ssget "_x" '((0 . "OLE2FRAME"))) (foreach obj (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (redraw obj 2) ;(entdel obj) ;if you just want to delete them ) ) ) Hi thanks for replay after uploading this i error comes Command: ; error: malformed list on input Quote
BIGAL Posted March 11, 2022 Posted March 11, 2022 (edited) I think like you Mhupp I use Notepad ++ now so for simple code easy to check, if its hundreds of lines I resort to my 1980's check brackets lisp, handy when debugging someone else's code. For a bit of nostalgia ; By Alan H ; circa 1980's (defun c:chkbrk (/ opf bkt chekdfile rdctl wkfile currentln wln ltr ncln) (setvar "cmdecho" 0) (prompt "\nlook at end of line") ;(setq chekdfile (getstring "enter name of file :")) (SETQ chekdfile (getfiled "Enter file name:" " " "LSP" 4)) (setq opf (open chekdfile "r")) (setq bkt 0) (setq blkl 0) (setq rdctl 1) (setq wkfile (open "c:\temp\wow.lsp" "w")) ; change out directory to suit (setq currentln "a") (while (/= blkl 6) (setq currentln (read-line opf)) (if (= currentln nil)(setq currentln "")) (if (= currentln "")(setq blkl (+ 1 blkl))(setq blkl 1)) (setq wln currentln) (while (/= wln "") (setq ltr (substr wln 1 1)) (setq wln (substr wln 2)) (cond ((= (ascii ltr) 34) (if (= rdctl 0)(setq rdctl 1)(setq rdctl 0))) ((and (= ltr "(")(= rdctl 1))(setq bkt (+ bkt 1))) ((and (= ltr ")")(= rdctl 1))(setq bkt (- bkt 1))) ((and (= ltr ";")(= rdctl 1))(setq wln "")) ;(t (prompt ltr)) ) ) (setq ncln (strcat currentln ";" (itoa bkt) (princ (itoa bkt)) (if (= rdctl 0) "string open" ""))) (if (/= currentln "")(write-line ncln wkfile)) ) (close wkfile) (close opf) (prompt (strcat "open brakets= " (itoa bkt) ".")) ) (command "chkbrk") (princ) Edited March 11, 2022 by BIGAL 1 Quote
mhupp Posted March 11, 2022 Posted March 11, 2022 Yeah I thought this is a simple lisp cant screw this up. deleted one too many ) when modifying an old ssget with "_X" that had multiple filters. Quote
pmadhwal7 Posted March 12, 2022 Author Posted March 12, 2022 On 3/10/2022 at 10:15 PM, mhupp said: sorry was missing a ")" i want to remove duplicate OLE, lsp that you provided are hiding OLE Quote
TerryDotson Posted March 12, 2022 Posted March 12, 2022 I would use a crayon before I would use OLE. For spreadsheets use a linked table. For images use a linked rasterimage object. Quote
ronjonp Posted March 12, 2022 Posted March 12, 2022 6 minutes ago, TerryDotson said: I would use a crayon before I would use OLE. For spreadsheets use a linked table. For images use a linked rasterimage object. Agreed. 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.