+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Senior Member ILoveMadoka's Avatar
    Using
    Solidworks 2013
    Join Date
    Oct 2008
    Posts
    332

    Question Lisp to reorder a column of text?

    Registered forum members do not see this ad.

    Does someone have a routine (or know of a way) to reorder a column of text items?

    ie:
    Line 1
    Line 2
    Line 3
    Line 4

    to

    Line 4
    Line 3
    Line 2
    Line 1

    I have a large table of text that I need to flip the column order.
    Has someone posted something along these lines?
    Is there an Autocad command I don't know about?

    I have had no luck in any of the search terms I have used..



    Thanks for all the help you guys provide...

  2. #2
    Senior Member ymg3's Avatar
    Using
    not applicable
    Join Date
    May 2011
    Posts
    414

    Default

    Is it a true autocad table or simply line of text ?

    Post a drawing

  3. #3
    Senior Member ILoveMadoka's Avatar
    Using
    Solidworks 2013
    Join Date
    Oct 2008
    Posts
    332

    Default

    Lee Mac to the rescue once again!!!

    Dynamic Text Alignment v1.6

    http://www.lee-mac.com/dynamictextalignment.html

    I had to jump through some hoops but Lee's program made it all possible.

    Could your next update allow a text column to be rotated 360 degrees instead of limiting it 180?
    (seems that is how it worked)

    I had to rotate the text in place 180 degrees then use Autocad to rotate the entire column 180.
    Awesome! Still quite a time saver!

    Thanks Lee!

    ps: It was all regular text entities

  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
    19,360

    Default

    I'm glad my Dynamic Text Alignment program came in handy!

    Here is another way to achieve the same result:
    Code:
    (defun c:revtxt ( / e i l s )
        (if (setq s (ssget "_:L" '((0 . "TEXT"))))
            (progn
                (repeat (setq i (sslength s))
                    (setq e (entget (ssname s (setq i (1- i))))
                          l (cons (list (assoc (if (and (= 0 (cdr (assoc 71 e))) (= 0 (cdr (assoc 72 e)))) 10 11) e) (assoc -1 e)) l)
                    )
                )
                (mapcar
                   '(lambda ( a b ) (entmod (list (cadr a) (car b))))
                    (setq l (vl-sort l '(lambda ( a b ) (< (caddar a) (caddar b)))))
                    (reverse l)
                )
            )
        )
        (princ)
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  5. #5
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,879

    Default

    Registered forum members do not see this ad.

    This prompted me to a slightly different question you have 3 individual columns of text but only want to sort on 1st column wrote a export columns that joins the text into single row then using Lee-Mac's would allow sort. Any one wants it post request here. It was done to export to excel to sort.
    A man who never made mistakes never made anything

Similar Threads

  1. Reorder objects
    By gibenner in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 14th Aug 2013, 02:44 pm
  2. dynamic block via no column in multiple text
    By LauKwokFai in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 1
    Last Post: 25th Oct 2012, 01:44 pm
  3. help !! lisp code for quick dimension&column
    By git_thailand in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 1st Mar 2012, 04:35 pm
  4. HELP REPAIR OF LISP Coordinate MORE HIGH COLUMN (Z)
    By namnhim in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 30th Jun 2011, 10:44 am
  5. column lisp
    By wrha in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 14th Jan 2010, 05:08 pm

Tags for this Thread

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