See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Rotate multiline text to viewport orientation

  1. #1
    All AUGI, all the time
    Join Date
    2009-11
    Location
    Raleigh, NC
    Posts
    944
    Login to Give a bone
    0

    Default Rotate multiline text to viewport orientation

    How do I get multiline text to rotate to viewport orientation?

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    Try: https://www.cadtutor.net/forum/topic...comment-557172
    or https://forums.augi.com/showthread.p...=1#post1332928

    My macro for "Mtext 0 width"
    Code:
    ^C^C_mtext;\r;(/ (* 180 (- (getvar "viewtwist"))) pi);w;0
    creates it Horizontal in TWisted Viewports.

  3. #3
    All AUGI, all the time
    Join Date
    2009-11
    Location
    Raleigh, NC
    Posts
    944
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    Tom,

    Does Macro mean it could be created as a command?

    I entered this as a new Macro (command in CUI), and its telling me I dont have permission to. It looks as though its trying to write to a sub directory I don't have. Is there a way to change that to something current on my C: drive?
    Last edited by tim_newsome; 2019-12-03 at 02:46 PM.

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    Quote Originally Posted by tim_newsome View Post
    Tom,

    Does Macro mean it could be created as a command?

    I entered this as a new Macro (command in CUI), and its telling me I don't have permission to. It looks as though its trying to write to a sub directory I don't have. Is there a way to change that to something current on my C: drive?
    You have to first add it as a command in the CUI then add it either to a Ribbon Panel or a Toolbar. It's not a command you can enter from the Command line:

    It uses lisp so it would have to be modified to work with a LT version.

    I don't have a LT version to check, but this macro using DIESEL works for me:
    Code:
    ^C^C_mtext;\r;$M=$(/,$(*,$(-,0,$(getvar,viewtwist)),180),3.14159265359);w;0
    It should work in a LT version. Had to enter 3.14159265359, PI wouldn't work.
    Last edited by Tom Beauford; 2019-12-03 at 05:55 PM. Reason: Added LT version option

  5. #5
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    I hop into the viewport, set the UCS to View, select the multiline text and give it a rotation of 0 in the properties window. The rotation is relative to the viewport.

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    Quote Originally Posted by MMccall View Post
    I hop into the viewport, set the UCS to View, select the multiline text and give it a rotation of 0 in the properties window. The rotation is relative to the viewport.
    Ideal for many users, certainly what I'd use if I could! Could cause serious issues for those of us doing Civil, Survey, Map, or other work fixed to World or specific coordinate systems.

  7. #7
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    I'm in civil and I've been doing it that way for 14 yrs. Obviously never insert anything into model space through the viewport that needs the correct coordinated system after its been set to View. (like insert points, north arrows, xrefs) Do those things in the real Model space as it remains as it was with the UCS set to world.

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

    Default Re: Rotate multiline text to viewport orientation

    Quote Originally Posted by MMccall View Post
    I'm in civil and I've been doing it that way for 14 yrs. Obviously never insert anything into model space through the viewport that needs the correct coordinated system after its been set to View. (like insert points, north arrows, xrefs) Do those things in the real Model space as it remains as it was with the UCS set to world.
    I too work in Civil, though all of my drawings are in World UCS in Model and through Viewports; I simply 'twist' my Viewports as needed for that sheet (using a LISP that uses DVIEW + SNAPANG), so it doesn't matter what tab is active, I can always insert or copy + paste between drawings and all of my new annotations, etc are aligned with the sheet.
    "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

  9. #9
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Rotate multiline text to viewport orientation

    Quote Originally Posted by BlackBox View Post
    I too work in Civil, though all of my drawings are in World UCS in Model and through Viewports; I simply 'twist' my Viewports as needed for that sheet (using a LISP that uses DVIEW + SNAPANG), so it doesn't matter what tab is active, I can always insert or copy + paste between drawings and all of my new annotations, etc are aligned with the sheet.
    While probably not as elegant as your lisp I've been using this macro for many years:
    Code:
    ^C^C_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ))
    With the attached image ViewTwist.png which I was able to create easily with your code.
    Attached Images Attached Images
    Last edited by Tom Beauford; 2019-12-06 at 11:45 AM.

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

    Default Re: Rotate multiline text to viewport orientation

    Quote Originally Posted by Tom Beauford View Post
    While probably not as elegant as your lisp I've been using this macro for many years:

    Code:
    ^C^C_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ))
    Here's an old post from 2013; I've only made some minor enhancements to since:

    Quote Originally Posted by BlackBox View Post
    Quote Originally Posted by siliff21 View Post
    ... would you mind sharing
    Not at all; here's mine... Take from this what you like:

    Code:
    (vl-load-com)
    ;;;--------------------------------------------------------------------;
    ;;; Twist dview function:
    (defun c:TW () (c:TWIST))
    (defun c:TWIST (/ *error* RTD cmdecho osmode pt1 pt2 acDoc ang)
      (prompt "\rTWIST")
    
      (defun *error* (msg)
        (and cmdecho (setvar 'cmdecho cmdecho))
        (and osmode (setvar 'osmode osmode))
        (if acDoc
          (vla-endundomark acDoc)
        )
        (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)
      )
    
      (defun RTD (ang) (/ (* ang 180.0) pi))
    
      (if (and (setq cmdecho (getvar 'cmdecho))
               (setvar 'cmdecho 0)
               (setq osmode (getvar 'osmode))
               (setvar 'osmode 512)
               (setq pt1 (getpoint "\nSpecify start point (left): "))
               (not (initget 32))
               (setq pt2 (getpoint pt1 "\nSpecify end point (right): "))
          )
        (progn
          (vla-startundomark
            (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
          )
          (command "._dview"
                   "l"
                   ""
                   "PO"
                   "@0,0,0"
                   "@0,0,1"
                   ""
                   "._dview"
                   "l"
                   ""
                   "tw"
                   (- 360 (RTD (setq ang (angle pt1 pt2))))
                   ""
          )
          (setvar 'snapang ang)
        )
      )
      (*error* nil)
    )
    ;;;--------------------------------------------------------------------;
    ;;; Untwist dview function:
    (defun c:UTW () (c:UNTWIST))
    (defun c:UNTWIST (/ *error* cmdecho acDoc)
      (prompt "\rUNTWIST")
    
      (defun *error* (msg)
        (if acDoc
          (vla-endundomark acDoc)
        )
        (and cmdecho (setvar 'cmdecho cmdecho))
        (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)
      )
    
      (if (and (setq cmdecho (getvar 'cmdecho))
               (setvar 'cmdecho 0)
          )
        (progn
          (vla-startundomark
            (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
          )
          (command "._dview" "l" "" "tw" 0 "" "._UCS" "W")
          (setvar 'snapang 0)
        )
      )
      (*error* nil)
    )
    [Edit]
    Quote Originally Posted by Tom Beauford View Post
    With the attached image ViewTwist.png which I was able to create easily with your code.
    You mean the PNGOUTT (aka PNGOUT Transparent) app from a while back?

    That's awesome!

    [/Edit]

    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

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 2017-08-09, 01:04 PM
  2. Change multiline style of multiline object
    By Wish List System in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2011-12-14, 10:09 AM
  3. Text will not rotate according to sheet orientation
    By bcreehan in forum Revit Architecture - General
    Replies: 3
    Last Post: 2009-12-21, 10:48 PM
  4. Rotate the viewport, rotate the MS content
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2006-07-12, 12:38 PM
  5. Single line Text or Multiline Text
    By Spenner in forum AutoCAD General
    Replies: 29
    Last Post: 2006-06-02, 11:21 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
  •