Jump to content

LISP to Change Rotation Angle of Text back to 0 Degress


Recommended Posts

Posted

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

Posted

Have you tried filter then properties and just set text angle to 0.0

Posted

Thanks, I haven't but I will try it and get back to you.

 

 

Bob

Posted

I have attached the DWG file with the text, as I wasn't sure how to do what you suggested.

Test.dwg

Posted

Are you wanting to rotate all the objects? Your initial question only mentions text.

Posted

I want to reset the rotation value to 0 but keep everything in the same place.

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

The fix may be in a block you can have align text to layout this will say text set to 0 will do just that and not go upside down.

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