(defun C:WireNoRight ( / ss pt1 ed ben ixx slen rtrn ee) (setq ss (ssget "_X" '((-4 . "")))) (if (/= ss nil) (progn (setq slen (sslength ss)) (setq ixx 0) (while (< ixx slen) ; get next INSERT entity from the selection set (setq ben (ssname ss ixx)) (setq ed (entget ben)) ; Make sure it is an Wire Number symbol. ; Should have attribute Wireno on it. (if (c:wd_getattrval ben "WIRENO") (progn ; yes, looks like an Wirenumber symbol ; Get attribute's data including entity name (setq rtrn (c:ace_getattr_data ben "WIRENO")) ; Entity name returned as 3rd item in list. ; Use it as a parameter in the "change justification" ; API call below. (c:ace_chgjst (caddr rtrn) "R") ) ) (setq ixx (1+ ixx)) ; increment index pointer ) (setq ss nil) ; release the selection set ) ) (princ) )