NarkDuffy 10 Posted February 23 (edited) Good day to you all. I have hundreds of blocks. I do not know where they came from - down loading blocks or drawings I suspect. I need to thin out the ones I will never use but can't find out how. They make it very difficult to find what I want. I haver not used this forum before and am excited to be starting. All the best Mark Edited February 23 by NarkDuffy Quote Share this post Link to post Share on other sites
SLW210 122 Posted February 23 If they are not used in the drawing, -PURGE them. If used in the drawing, you will need to delete them, then -PURGE them. Quote Share this post Link to post Share on other sites
CyberAngel 59 Posted February 23 SLW is correct. Watch out for nested blocks, that is, blocks inside of other blocks. You may also find anonymous blocks, whose names start with an asterisk. If there are blocks that you use on a regular basis, consider adding them to your template(s). That way you don't have to bring them in every time. 1 Quote Share this post Link to post Share on other sites
BIGAL 526 Posted February 24 The purge will remove unused blocks but maybe you want one of them, so the only alternative may be to do insert all blocks so you can look at them, there is a few examples around to do a grid of bocks. The other thing is its pretty easy to just create a text file of all the block names. So could do a script style of -purge Blocks Name, note the "-" you can also do wildcard so could do ac* etc A quicky copy and paste to command line (vlax-for blk (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object))) (princ "\n") (princ (vla-get-name blk)) ) Like Cyberangel we had a tree that consisted of 5 blocks the branches were repeated as nested blocks, exploded and saved final result 1 block, removed 4. Quote Share this post Link to post Share on other sites
jonathann3891 12 Posted Friday at 02:34 PM I recently wrote this to allow me to select a block that I want completely deleted and purged from a drawing. Maybe it will be useful to you. (defun c:DAPB (/ bname ucmdecho ss) (vl-load-com) (setq ucmdecho (getvar 'cmdecho)) ;get user cmdecho setting (setvar 'cmdecho 0) ;turn off cmdecho (setq bname (vla-get-effectivename (vlax-ename->vla-object (car (entsel "\n Select block: "))))) ;get block name (setq ss (ssget "X" (list '(0 . "INSERT")(cons 2 bname)))) ;get all blocks in drawing (if (= (acet-ui-message "This will delete and purge this block for this drawing! Ok to proceed?" "Delete & Purge" 1) 2)(exit)) (command "erase" ss "" "-purge" "B" bname "N" "regenall") (setvar 'cmdecho ucmdecho) ;restore user cmdecho setting (princ) ) Quote Share this post Link to post Share on other sites
BIGAL 526 Posted Saturday at 12:05 AM narkduffy your turn now Jonathon has provided a good routine that could be easily be changed for multiple blocks, so you need to provide info about how to choose what to delete, name or pick ? Quote Share this post Link to post Share on other sites