adding text editor to lisp

Discussion in 'AutoCAD' started by FELIPE, Dec 9, 2004.

  1. FELIPE

    FELIPE Guest

    GaryDF gave me this routine yesterday.
    It copys text down.
    would it be difficult to have it open the dtext editor on the last text so that I can edit the new line of text easily?

    Thanks


    (defun c:AT (/ qlst tsize inp que num)
    (princ "\n* DText only *")
    (SETQ QUE (ssget '((0 . "text"))))
    (setq qlst (entget (ssname que 0)))
    (if nonstandardspacing
    (setq spacingmodifier nonstandardspacing)
    (setq spacingmodifier 1.5))
    (setq tsize (* -1 (* spacingmodifier (cdr (assoc 40 qlst)))))
    (SETQ INP (GETreal "\n* Enter how many lines of dtext to add *"))
    (cond ((= INP NIL) (SETQ NUM 2))
    ((minusp inp) (setq num (fix (1+ (abs inp)))))
    (t (setq num (fix (1+ (abs inp))))))
    (COND ((NULL INP) (command "array" "p" "" "r" num "1" tsize))
    ((MINUSP inp) (command "array" "p" "" "r" num "1" (abs tsize)))
    (T (command "array" "p" "" "r" num "1" tsize)))
    (SETQ QUE NIL))
     
    FELIPE, Dec 9, 2004
    #1
  2. FELIPE

    Jim Claypool Guest

    (defun c:AT (/ qlst tsize inp que num)
    (princ "\n* DText only *")
    (SETQ QUE (ssget '((0 . "text"))))
    (setq qlst (entget (ssname que 0)))
    (if nonstandardspacing
    (setq spacingmodifier nonstandardspacing)
    (setq spacingmodifier 1.5)
    )
    (setq tsize (* -1 (* spacingmodifier (cdr (assoc 40 qlst)))))
    (SETQ INP (GETreal "\n* Enter how many lines of dtext to add *"))
    (cond
    ((= INP NIL) (SETQ NUM 2))
    ((minusp inp) (setq num (fix (1+ (abs inp)))))
    (t (setq num (fix (1+ (abs inp)))))
    )
    (COND
    ((NULL INP) (command "array" "p" "" "r" num "1" tsize))
    ((MINUSP inp) (command "array" "p" "" "r" num "1" (abs tsize)))
    (T (command "array" "p" "" "r" num "1" tsize))
    )
    (SETQ QUE NIL)
    (command "ddedit" (entlast)) ;; ADDED THIS LINE
    )
     
    Jim Claypool, Dec 9, 2004
    #2
  3. FELIPE

    FELIPE Guest

    Thanks
    Now its perfect
     
    FELIPE, Dec 9, 2004
    #3
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.