Jump to content

2004 AutoCAD Block Help Needed


criscoduck09

Recommended Posts

Just creating a simple block with text attribute. I want to be able to define the block and make sure that when the block is inserted and rotated (if needed) that the associated text does not rotate with the block, I want it to retain the 0 degree alignment.

 

Possible in 04?

 

Thanks folks

Link to comment
Share on other sites

I'm not sure how many blocks you are inserting and rotating but couldn't you use -ATTEDIT to rotate the attribute back to the original position?

Link to comment
Share on other sites

Yes I can use ATTEDIT and rotate to 0, then grip it back to a central location on the block. The benefit of creating a block library in a template though is lost when I have to do this on each inserted block.

 

Thanks guys.

Link to comment
Share on other sites

I sure have yes... however my CFO doesnt like the idea.

 

We have versions in the office from 2004 up to 2009. I need to make something that will work across all versions.

Link to comment
Share on other sites

Here's one from the depths of the archives that will rotate attributes after insertion. Author unknown (at least to me).

(defun c:atrot(/ blSet attLst errCount oldAng)
(vl-load-com)
 (if(not atrot:rAng)(setq atrot:rAng 0))
 (setq oldAng atrot:rAng
       atrot:rAng
    (getangle
      (strcat "\n§§§ Specify rotation angle <"(angtos atrot:rAng)">: ")))
 (if(not atrot:rAng)(setq atrot:rAng oldAng))
 (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
     (if(vl-catch-all-error-p
          (vl-catch-all-apply
            'vla-put-Rotation(list att atrot:rAng)))
       (setq errCount(1+ ErrCount))
         ); end if
     ); end foreach
   ); end foreach
     ); end progn
   (princ ">>> Nothing selected! <<<")
   ); end if
 (if(/= 0 errCount)
   (princ
     (strcat "\n>>> "
   (itoa errCount)
         " attributes or blocks were on locked layer! <<< "))
         ); end if
 (princ)
 ); end of c:atrot

Link to comment
Share on other sites

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