See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: Quick rotate and / or move-rotate

  1. #1
    Member
    Join Date
    2015-05
    Posts
    3
    Login to Give a bone
    0

    Default Quick rotate and / or move-rotate

    Hi,

    I am after a couple command if anyone knows of one please, to:

    1) Quick rotate text - in other words, simply click the text and click somewhere in space to rotate it. It will always automatically use it's insert point as the base point. and:

    2) Quick move and rotate - similarly, select text, place somwhere, then click in space for it's orientation. Always using insert point as base point. IE without having to move/enter/select/enter/base point/destination/rotate/enter/base/rotation.

    If anyone can help, that would certainly be great!

    Thanks

    Rroger_D

  2. #2
    Member
    Join Date
    2015-08
    Location
    North Dakota
    Posts
    4
    Login to Give a bone
    0

    Default Re: Quick rotate and / or move-rotate

    Hi Rroger_D

    One thing I recommend is making your text annotative, that way you can set the text to auto adjust its rotation based on the orientation of your layout. I use this feature a lot when I have text displaying through multiple viewports and want them to appear readable on every viewport regardless of how the model space is rotated through the viewport. You can simply check a box in the text style window and all your text will auto rotate to match your layout/viewport.

    Autorotate Anno Text.JPG

    Another option that is built into AutoCAD is to type the rotation angle into the properties window and the text will rotate about its basepoint.

    Text Rotation.JPG

    There is also a tool in the Express Tools Ribbon called Modify Text that will allow you to rotate the text to match the orientation of a line you draw:

    Modify Text.JPG

    These are the main options that come with AutoCAD, if you are still seeking a tool to do this even faster you can install plugins or lisp commands that will streamline the task even more.

    Hope this helps with your question.

  3. #3
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    1

    Default Re: Quick rotate and / or move-rotate

    As requested, here are some quickly written LISP routines....

    Quote Originally Posted by Rroger_D View Post
    1) Quick rotate text - in other words, simply click the text and click somewhere in space to rotate it. It will always automatically use it's insert point as the base point. and:
    Quick Rotate Text:

    Code:
    (vl-load-com)
    
    (defun c:QuickRotateText (/ *error* ss v pt ang acDoc)
    
      (defun *error* (msg)
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (while
        (and
          (setq ss (ssget ":S:E:L" '((0 . "MTEXT,TEXT"))))
          (setq v (vlax-ename->vla-object (ssname ss 0)))
          (setq ang
                 (acet-ss-drag-rotate
                   ss
                   (trans
                     (setq pt
                            (vlax-get
                              v
                              (cond
                                ((= "AcDbMText" (vla-get-objectname v))
                                 'insertionpoint
                                )
                                (T 'textalignmentpoint)
                              )
                            )
                     )
                     0
                     1
                   )
                   T
                 )
          )
          (or acDoc
              (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
          )
        )
         (vla-startundomark acDoc)
         (vla-rotate v (vlax-3d-point pt) ang)
         (vla-endundomark acDoc)
      )
    
      (*error* nil)
    )


    Quote Originally Posted by Rroger_D View Post
    2) Quick move and rotate - similarly, select text, place somwhere, then click in space for it's orientation. Always using insert point as base point. IE without having to move/enter/select/enter/base point/destination/rotate/enter/base/rotation.
    Quick Move And Rotate Text:

    Code:
    (vl-load-com)
    
    (defun c:QuickMoveRotateText (/ *error*  ss v pt1 pt2 acDoc ang)
    
      (defun *error* (msg)
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (while
        (and
          (setq ss (ssget ":S:E:L" '((0 . "MTEXT,TEXT"))))
          (setq v (vlax-ename->vla-object (ssname ss 0)))
          (setq pt2
                 (acet-ss-drag-move
                   ss
                   (trans
                     (setq pt1
                            (vlax-get
                              v
                              (cond
                                ((= "AcDbMText" (vla-get-objectname v))
                                 'insertionpoint
                                )
                                (T 'textalignmentpoint)
                              )
                            )
                     )
                     0
                     1
                   )
                   "\nSpecify second point: "
                   T
                 )
          )
          (or acDoc
              (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
          )
        )
        (vla-startundomark acDoc)
        (vlax-invoke v 'move pt1 pt2)
        (if (setq ang (acet-ss-drag-rotate ss (trans pt2 0 1) T))
          (vla-rotate v (vlax-3d-point pt2) ang)
        )
        (vla-endundomark acDoc)
      )
    
      (*error* nil)
    )


    For completeness, here's another....

    Quick Copy And Rotate Text:

    Code:
    (vl-load-com)
    
    (defun c:QuickCopyRotateText (/  *error* ss v pt1 pt2 acDoc oText ang)
    
      (defun *error* (msg)
        (if oText (vla-delete oText))
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (while
        (and
          (setq ss (ssget ":S:E:L" '((0 . "MTEXT,TEXT"))))
          (setq v (vlax-ename->vla-object (ssname ss 0)))
          (setq pt2
                 (acet-ss-drag-move
                   ss
                   (trans
                     (setq pt1
                            (vlax-get
                              v
                              (cond
                                ((= "AcDbMText" (vla-get-objectname v))
                                 'insertionpoint
                                )
                                (T 'textalignmentpoint)
                              )
                            )
                     )
                     0
                     1
                   )
                   "\nSpecify second point: "
                   T
                 )
          )
          (or acDoc
              (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
          )
        )
        (vla-startundomark acDoc)
        (vlax-invoke (setq oText (vla-copy v)) 'move pt1 pt2)
        (setq ss nil ss (ssadd (vlax-vla-object->ename oText)))
        (if (setq ang (acet-ss-drag-rotate ss (trans pt2 0 1) T))
          (progn
            (vla-rotate oText (vlax-3d-point pt2) ang)
            (vla-endundomark acDoc)
          )
          (vla-delete oText)
        )
        (setq oText nil)
      )
    
      (*error* nil)
    )


    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Cannot see Objects as I move or rotate them
    By chrisr in forum AutoCAD General
    Replies: 15
    Last Post: 2010-07-19, 12:49 PM
  2. Copy/Move/Rotate
    By joshua.harter in forum ACA General
    Replies: 1
    Last Post: 2010-01-28, 08:58 PM
  3. Rotate then move in a dynamic block
    By Jonathan Pitt in forum AutoCAD General
    Replies: 6
    Last Post: 2009-06-30, 11:28 AM
  4. rotate then move
    By chad.beussink in forum AutoLISP
    Replies: 4
    Last Post: 2008-08-22, 01:23 PM
  5. Can not see Objects as I Move them or Rotate them
    By hugvi76 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-01-19, 10:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •