Jump to content

Recommended Posts

Posted

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))

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    6

  • ORgrown

    4

  • kpblc

    3

  • leos98

    3

Top Posters In This Topic

Posted

It works great!! However, I tryed doing the space to update all of the attributes but it seems to not work.

Posted
It works great!! However, I tryed doing the space to update all of the attributes but it seems to not work.

 

Will investigate... :P

Posted
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... :unsure:

 

Just a single space

Posted

I keep pressing space enter and it continues to ask me for a tag name

Posted
I keep pressing space enter and it continues to ask me for a tag name

 

I can't see how that would happen :huh:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...