Jump to content

Rotate relative to current UCS


Recommended Posts

Posted

Is it possible to rotate an object to thecurrent UCS. I use UCS object quite a bit and want to align text to the mycurrent UCS without having to align it to an object. i.e. to select the text andsimply rotate it around the justify point to a set angle relative to the current view. Hopethat makes sense.

Posted

Something like this?

;;; Rotate Text to Current UCS routine (26-X-2012)
(defun c:RTCU( / ssetText assocText )
(prompt "\nSelect text entity to match with current UCS rotation (plan only):")
(if (setq ssetText (ssget "_:S" '((0 . "TEXT"))))
 (entmod (setq assocText (entget (ssname ssetText 0))
               assocText (subst (cons '50 (atan (cadr (getvar "UCSXDIR"))
                                                (car  (getvar "UCSXDIR"))))
                                (assoc 50 assocText)
                                assocText)))
)
(princ)
)

Posted

Thank you. Exactly like that.

Posted

Glad to hear that. The code must be adusted for non planar (XoY) labels.

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