Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/21/2021 in all areas

  1. Another: (defun _foo (i l / n r) (if (setq n (vl-position i l)) (progn (repeat (1+ n) (setq r (cons (car l) r)) (setq l (cdr l))) (reverse r)) l ) ) (_foo "cc" '("aa" "bb" "cc" "dd" "ee"))
    1 point
  2. What is it that needs changing/ Check out this link to the legendary LeeMac's Batch Find & Replace lisp. You don't even ned to open more than one drawing to use it. Done in a minute or two if it is text? http://www.lee-mac.com/bfind.html Thanks Lee!
    1 point
  3. used this macro that works well if all you want to do is add or remove items from a block. just change the A to an R ;;----------------------------------------------------------------------------;; ;; QUICKLY ADD OBJECTS TO BLOCK (defun C:A2B (/ SS SS1 SS2) (prompt "\nSelect Block") (setq SS (ssget '((0 . "INSERT")))) (foreach blk (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq SS1 (ssadd blk)) (sssetfirst nil SS1) (vl-cmdf "-REFEDIT" "O" "A" "N") (prompt "\nSelect Object to Add to Block") (if (setq SS2 (ssget)) (progn (vl-cmdf "_.Refset" "A" SS2 "") (vl-cmdf "_.Refclose" "S") ) (vl-cmdf "_.Refclose" "S") ) ) ) Wanted to select multiple blocks to cycle thought them like above. But to be able to use multiple commands inside the block to edit it. This is what i have come up with. works kinda backwards, and you have to type the command again once you are done edited the block to switch to the next one on the list. But seems to get the job done. ;;----------------------------------------------------------------------------;; ;; Edit Blocks (defun C:blkedit (/ SS) (if (/= (getvar 'refeditname) "") (vl-cmdf "_.Refclose" "S") ) (if (or (= SS1 nil) (= (sslength SS1) 0)) (progn (prompt "\nSelect Block") (setq SS1 (ssget '((0 . "INSERT")))) ) ) (if (and (/= SS1 nil) (> (sslength SS1) 0)) (progn (setq SS (ssadd (ssname SS1 0))) (sssetfirst nil SS) (vl-cmdf "-REFEDIT" "O" "A" "N") (ssdel (ssname SS1 0) SS1) ) ) (princ) )
    1 point
×
×
  • Create New...