;;;Elise Moss ;;;Moss Designs ;;;www.mossdesigns.com ;;;this routine will align objects, including text in the x or y direction (defun c:ali() (setq ent (car(entsel "\n Select entity to align to: "))) (initget 1 "H V h v") (setq alignpt (getkword "\nAlign to Horizontal/Vertical value? ")) ; get alignpt (setq el (entget ent)) (if (= alignpt "H"); then align to the x value (setq newpt (cadr(assoc 10 el))) ) (if (= alignpt "V"); then align to the y value (setq newpt (caddr(assoc 10 el))) ) ; select the object to align to the source objext (prompt "\N Select the entities to align to the selected object: ") (setq ss (ssget)) ; get a count of the items selected (setq sscount (sslength ss)) (setq item 0) ; initialize the counter (while (< item sscount) (setq entch (ssname ss item)) (setq elnew (entget entch)); get list (setq inspt (assoc 10 elnew)) (setq xval (cadr inspt)) ; get the xpt (setq yval (caddr inspt)) ; get y value (setq zval (nth 3 inspt)); get z value ; rebuild the new pt (if ( = alignpt "H") (progn (setq newvalue (list newpt yval zval)) (setq elnew (subst (cons 10 newvalue) (assoc 10 elnew) elnew)) ); end progn ); end if (if ( = alignpt "V") (progn (setq newpoint (list xval newpt zval)) (setq elnew (subst (cons 10 newpoint) (assoc 10 elnew) elnew)) ); end progn ); end if (entmod elnew) (setq item (+ item 1)) );end while );end degun (princ "\nType 'ali' to align entities")