Lisp for cht

Discussion in 'AutoCAD' started by Phil Clark, Jul 7, 2003.

  1. Phil Clark

    Phil Clark Guest

    This is what I use...probably could be a lot cleaner, but hey it works!  Note: it sorts by Y value only



     



    (defun SORTSS (SSEL / INS1 DONE SS2)
      (setq NEWSS '())
      (foreach SSNAM SSEL
        (setq INS1 (cdr (assoc 10 (entget SSNAM))))
        (setq INS1 (trans INS1 SSNAM 1))
          (if (not NEWSS)
            (setq NEWSS (list SSNAM))
            (progn
              (setq SS2 NEWSS DONE nil NEWSS1 '() )
              (foreach SSNAM2 SS2
                (setq INS2 (cdr (assoc 10 (entget SSNAM2))))
                (setq INS2 (trans INS2 SSNAM2 1))
                (if (not DONE)
                  (if (> (cadr INS1) (cadr INS2))
                    (progn
                      (setq DONE T)
                      (if NEWSS1
                        (setq NEWSS (append NEWSS1 (list SSNAM SSNAM2)))
                        (setq NEWSS (list SSNAM SSNAM2))
                      )   ;end if
                    )   ;end progn
                    (if (not NEWSS1)
                      (setq NEWSS1 (list SSNAM2))
                      (setq NEWSS1 (append NEWSS1 (list SSNAM2)))
                    )   ;end if
                  )    ;end if
                  (setq NEWSS (append NEWSS (list SSNAM2)))
                )    ;end if
              )    ;end foreach
             (if (not DONE)
               (setq NEWSS (append NEWSS (list SSNAM)))
             )    ;end if
            )    ;end progn
          )     ;end if
        )     ;end foreach
      )     ;end defun



    "pillaisg" <> wrote in message news:...

    want to give the selection for the text which are to be edited in a window rather than to select it individually but when i give the selection by window it selects the text randomly but i need it in a sequence either in a row or column is there any lisp for that and how to make lisp file
     
    Phil Clark, Jul 7, 2003
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.