Lee Mac Posted June 3, 2009 Posted June 3, 2009 Hi Leos, I have made this new code so that the Tag-prompt is not case-sensitive. Also, press space at the tag prompt to update all Tags in the selected block. (defun c:atrot (/ blSet attLst errCount tmp) (vl-load-com) (or atrot:tag (setq atrot:tag (chr 32))) (setq tmp (strcase (getstring t (strcat "\nSpecify Tag to be Rotated <" (if (eq (chr 32) atrot:tag) "*all*" atrot:tag) ">: ")))) (or (eq "" tmp) (setq atrot:tag tmp)) (princ "<<< Select blocks to rotate attributes >>>") (setq errCount 0) (if (setq blSet (ssget '((0 . "INSERT") (66 . 1)))) (progn (setq blSet (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex blSet))))) (foreach itm blSet (setq attLst (vlax-safearray->list (vlax-variant-value (vla-GetAttributes itm)))) (foreach att attLst (and (eq (if (eq (chr 32) atrot:tag) (strcase (vla-get-TagString att)) atrot:tag) (strcase (vla-get-TagString att))) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Rotation (list att 0.0))) (setq errCount (1+ ErrCount))))))) (princ ">>> Nothing selected! <<<")) (if (/= 0 errCount) (princ (strcat "\n>>> " (itoa errCount) " attributes or blocks were on locked layer! <<< "))) (princ)) Quote
leos98 Posted June 3, 2009 Posted June 3, 2009 It works great!! However, I tryed doing the space to update all of the attributes but it seems to not work. Quote
Lee Mac Posted June 3, 2009 Posted June 3, 2009 It works great!! However, I tryed doing the space to update all of the attributes but it seems to not work. Will investigate... Quote
Lee Mac Posted June 3, 2009 Posted June 3, 2009 It works great!! However, I tryed doing the space to update all of the attributes but it seems to not work. The space seems to work for me... Just a single space Quote
leos98 Posted June 3, 2009 Posted June 3, 2009 I keep pressing space enter and it continues to ask me for a tag name Quote
Lee Mac Posted June 3, 2009 Posted June 3, 2009 I keep pressing space enter and it continues to ask me for a tag name I can't see how that would happen Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.