;; ! **************************************************************************** ;; ! C:ReLocate ;; ! **************************************************************************** ;; ! Function : Relocate a number of blocks from one location to new individually ;; ! specifed locations ;; ! Author : Rakesh Rao, (C) 2003, Four Dimension Technologies ;; ! Bangalore, India ;; ! Email : rakesh.rao@4d-technologies.com ;; ! Web www.4d-technologies.com ;; ! Updated : November 11, 2003 ;; ! **************************************************************************** (defun c:ReLocate( / ss ssl tmp ename entl cnt Insp newInsp ) (princ "\nSelect block objects:") (setq ss (ssget (list (cons 0 "INSERT")))) (if ss (progn (setq ssl (sslength ss) tmp (strcat " of " (itoa ssl)) cnt 0 ) (repeat ssl (setq ename (ssname ss cnt) cnt (1+ cnt) entl (entget ename) Insp (cdr (assoc 10 entl)) ) (initget 1) (setq newInsp (getpoint Insp (strcat "\nPick new insertion point, block " (itoa cnt) tmp ":"))) (if (> (distance Insp newInsp) 0.0) (command "._Move" ename "" Insp newInsp) ) ) )) (prin1) ) ;; ! *************************************************************************** ;; ! LI_item ;; ! *************************************************************************** ;; ! Function : Returns the first occurence of a DXF dotted pair from a list ;; ! Argument : 'n' - The DXF code to check ;; ! 'alist' - The List to check ;; ! Returns : The value of the DXF dotted pair, if it exists else returns nil ;; ! Update : December 26, 1998 (defun LI_item (n alist) (cdr (assoc n alist)) ) (princ "\nType 'ReLocate' to start.") (prin1)