Jump to content

LISP to Change Rotation Angle of Text back to 0 Degress


Bobzy20

Recommended Posts

Hi

 

I have some text in AutoCAD that are sitting at all different degrees, I would like to run a script to basically keep the text where it is but reset the rotation angle back to 0.

 

Does anybody know of such a thing that already exists?

 

Thanks

 

Bob

Link to comment
Share on other sites

Hi,

Try this.

(defun c:Test ( / int sel ent )
 (and (setq int -1 sel (ssget "_:L" '((0 . "*TEXT") (-4 . "/=") (50 . 0.0))))
      (while (setq ent (ssname sel (setq int (1+ int))))
        (entmod (append (entget ent) '((50 . 0.0))))
        )
      )
 (princ)
 )

Link to comment
Share on other sites

I manually set the rotation of the text to zero degrees, and this is what I got.

 

Is it really what you want? The text seems to be generated backwards and upside-down, but it is in the same place.

Text at zero degrees.PNG

Link to comment
Share on other sites

The text was part of an attribute block which I would have copied/rotated/aligned around the drawing, I would have flipped the text up side down and backwards using the Enhanced Attribute Editor to suit my needs.

 

When I import it into our bespoke graphical software, its throwing the text out. I think I will need to go back into the Enhanced Attribute Editor and uncheck the backwards & up side down options and then rotate the text to a normal rotation angle, its currently at an angle of 202 but if I go to a rotation angle of 22, it seems to work ok.

 

Sorry and thanks for your help on this

 

Bob

Link to comment
Share on other sites

I did see it thanks and it worked great. I need to spend some time on it and figure out what the issue is.

 

Thanks for your help.

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