+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Senior Member Cadologist's Avatar
    Computer Details
    Cadologist's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Hewlett-Packard Z400 Workstation
    Motherboard:
    POS Fisherprice Beta Nukemaster v2.6
    CPU:
    Intel Xeon CPU W3520 @ 2.67Ghz
    RAM:
    12 GB
    Graphics:
    Nvidia Quadro FX 1800
    Primary Storage:
    Three Hamsters, Alumimum Wheel
    Monitor:
    Dual Monitors (24" LG LCD)
    Discipline
    Multi-disciplinary
    Cadologist's Discipline Details
    Occupation
    Regional Technical CAD Lead
    Discipline
    Multi-disciplinary
    Using
    Civil 3D 2011
    Join Date
    Oct 2009
    Location
    Canada
    Posts
    128

    Default Flip Multiple Texts 180 Degrees

    Registered forum members do not see this ad.

    I am trying to track down a lisp routine that will flip text 180 degrees. For background information, I have a drawing with a ton of MTEXT items in it, all at different angles (for subdivision lot layout elevation and data). I need to add 180 degrees to the angle of each MTEXT to 'flip' it the other direction for viewing purposes.

    I have looked online and all the information I could find on various sites would change ALL the text to the same angle or were not comprehensive for multiple entities, would only work for one piece of MTEXT.

    I would also like to do it this way, with some form of LISP routine rather then say creating a new textstyle that sets the orientation opposite or whatever. Anyway, I've looked quite a bit for this and can't come up with anything. Also, the one that is included in the Express Tools (ie: rotate text) required a specific angle. Currently I am rotating them manually and individually via the INSERT snap and the typical Rotate command (PITA)!

    To summarize, I am trying to find a LISP that will add 180 degrees to multiple Text or MTEXT entities and rotate them via their insert point.

    Has anyone come across something like this in their travels?

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Quick one:

    Code:
    (defun c:FlipTxt (/ i ss e eLst)
    
      (if (setq i -1 ss (ssget "_:L" '((0 . "TEXT,MTEXT"))))
        (while (setq e (ssname ss (setq i (1+ i))))
          (setq eLst (entget e))
          (entmod (subst (cons 50 (+ pi (cdr (assoc 50 eLst))))
                         (assoc 50 eLst) eLst))))
    
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Senior Member Cadologist's Avatar
    Computer Details
    Cadologist's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Hewlett-Packard Z400 Workstation
    Motherboard:
    POS Fisherprice Beta Nukemaster v2.6
    CPU:
    Intel Xeon CPU W3520 @ 2.67Ghz
    RAM:
    12 GB
    Graphics:
    Nvidia Quadro FX 1800
    Primary Storage:
    Three Hamsters, Alumimum Wheel
    Monitor:
    Dual Monitors (24" LG LCD)
    Discipline
    Multi-disciplinary
    Cadologist's Discipline Details
    Occupation
    Regional Technical CAD Lead
    Discipline
    Multi-disciplinary
    Using
    Civil 3D 2011
    Join Date
    Oct 2009
    Location
    Canada
    Posts
    128

    Default

    Works perfectly, thanks a bunch!! That is exactly what I was looking for.

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    You're welcome
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  5. #5
    Forum Newbie
    Computer Details
    vsheehan's Computer Details
    Operating System:
    Windows 7 Pro
    Computer:
    Home Built
    Motherboard:
    ASUS P6T
    CPU:
    920 i7
    RAM:
    6 Gig
    Graphics:
    Dual NVIDIA SLI
    Primary Storage:
    WD 300GB 10k RPM VelociRaptor
    Secondary Storage:
    WHS 6 TB
    Monitor:
    Dell 24"
    Using
    Civil 3D 2013
    Join Date
    Nov 2012
    Posts
    2

    Default

    This is great. Can you add a user specified angle instead of 180?

    Thanks,
    Vince

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Welcome to CADTutor Vince

    Try the following simple program:

    Code:
    (defun c:rt ( / a e i r s )
        (if (and
                (setq a (getangle "\nSpecify Angle: "))
                (setq s (ssget "_:L" '((0 . "TEXT,MTEXT"))))
            )
            (repeat (setq i (sslength s))
                (setq e (entget (ssname s (setq i (1- i))))
                      r (assoc 50 e)
                )
                (entmod (subst (cons 50 (+ (cdr r) a)) r e))
            )
        )
        (princ)
    )
    This is a very old thread!
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  7. #7
    Forum Newbie
    Computer Details
    vsheehan's Computer Details
    Operating System:
    Windows 7 Pro
    Computer:
    Home Built
    Motherboard:
    ASUS P6T
    CPU:
    920 i7
    RAM:
    6 Gig
    Graphics:
    Dual NVIDIA SLI
    Primary Storage:
    WD 300GB 10k RPM VelociRaptor
    Secondary Storage:
    WHS 6 TB
    Monitor:
    Dell 24"
    Using
    Civil 3D 2013
    Join Date
    Nov 2012
    Posts
    2

    Default

    That works! Yeah, I found the thread in a Yahoo search.

    Thanks for the code.
    Vince

  8. #8
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    You're welcome Vince
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  9. #9
    Super Member Organic's Avatar
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Feb 2009
    Posts
    1,641

    Default

    Registered forum members do not see this ad.

    That is a good lisp. I normally use the following lisp (not written by me) for contour label orientating although it takes a couple more steps.

    Code:
    ;;  SpinText.LSP
    ;;  To Rotate Text and/or Mtext entities by the same amount
    ;;  about each one's individual insertion point.
    ;;  Kent Cooper, November 2008
    
    (defun C:SpinText (/ ttype selmode trotd trotr textset titem tdata)
      (initget "Text Mtext Both")
      (setq ttype (getkword "Type[s] of text - Text/Mtext/Both (T/M/B) <B>: "))
      (if (or (not ttype) (= ttype "Both")) (setq ttype "*TEXT"))
      (initget "All User")
      (setq
        selmode (getkword "Selection - All in drawing/User selected (A/U) <A>: ")
        trotd (getreal "Rotation (from current) in degrees <180>: ")
        trotr
          (if trotd
            (/ (* trotd pi) 180)
            pi
          ); end if and trotr
      ); end setq
      (if (/= selmode "User")
        (setq textset (ssget "_X" (list (cons 0 ttype))))
        (setq textset (ssget (list (cons 0 ttype))))
      ); end if
      (while (> (sslength textset) 0)
        (setq
          titem (ssname textset 0)
          tdata (entget titem)
          tdata (subst (cons 50 (+ (cdr (assoc 50 tdata)) trotr)) (assoc 50 tdata) tdata)
        ); end setq
        (entmod tdata)
        (entupd titem)
        (ssdel titem textset)
      ); end while
    ); end defun
    (prompt "Type SpinText to rotate Text and/or Mtext entities about their insertion points.")

Similar Threads

  1. Flip Parameter
    By YZ in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 15th Mar 2010, 11:54 pm
  2. Flip lines and arc
    By BIGAL in forum AutoCAD General
    Replies: 7
    Last Post: 1st Jul 2009, 10:23 am
  3. degrees and minute to degrees minutes and seconds
    By shekluv in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 7th Jun 2008, 09:32 pm
  4. Change multiple texts at once
    By juve in forum AutoCAD General
    Replies: 4
    Last Post: 22nd May 2008, 09:00 pm
  5. Edit multiple dimension texts at once?
    By Lucid in forum AutoCAD Drawing Management & Output
    Replies: 11
    Last Post: 6th Nov 2007, 10:08 am

Bookmarks

Posting Permissions

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