Text to elevation?

Discussion in 'AutoCAD' started by Randy S, Apr 26, 2004.

  1. Randy S

    Randy S Guest

    is there an AutoLISP out there that will take text that is drawn at zero elevation and move it up to the actual elevation that is in the text. I am going to be using this info for a Land Desktop surface.

    Thanks,
    Randy
     
    Randy S, Apr 26, 2004
    #1
  2. Randy S

    btlsp Guest

    Untested, use in conjunction with the fntn series @ http://www.btlsp2000.com/page9.html
    ;=================================================
    ; > > > TUP < < <
    ;BILL TONNESEN EMAIL >>
    ;TUP.LSP 040426
    ;=================================================
    (defun C:TUP ()
    (svar)
    ;------------------------------------------------------
    ;...interface
    (if (not imtup)(setq imtup (list 2
    "Enter Elevation to-which-to-move" "0" )))
    (setq
    imtup (imp imtup)
    t2e (ssname (ssget) 0)
    v2 (mget imtup 1 0)
    v3 (get 10 t2e)
    v4 (vc2 (vc2 v2 v0) v3)
    t2 (get 1 t2e) )
    (command "move" t2e "" v3 v4)
    (itzovr) )
    ;------------------------------------------------------
    ;...BT.LSP Routines
    ;SVAR IMP MGET
     
    btlsp, Apr 26, 2004
    #2
  3. Randy S

    bob.at Guest

    Randy,

    I had something for blocks+attributs in my archiv, changed it for texts. Feel free to use the following.
    Works only, if the text contains only the numbers for the elevation. If you have other in the text (i.g "h = 117.55") you must add a filter befor the line "(setq hoe (atof...."

    bob.at

    (defun C:MOVH_Text (/ bl la as e e2 eli eli2 hoe pkt pktn i)

    (setq expertold (getvar "EXPERT")) (setvar "EXPERT" 4)
    (setq echoold (getvar "CMDECHO")) (setvar "CMDECHO" 0)
    (setq regenold (getvar "REGENMODE")) (setvar "REGENMODE" 0)
    (setq osnapold (getvar "OSMODE")) (setvar "OSMODE" 0)
    (command "_UCS" "_WORLD")
    (setvar "CMDECHO" 0)

    (setq la (strcase (getstring "\nLayer Name (or *): ")))
    (while (= la "")
    (setq la (strcase (getstring "\nLayer Name (or *): ")))
    )

    (setq i 0.0)
    (cond ((= la "*")
    (setq as (ssget "X" (list (cons 0 "Text")))))
    (T
    (setq as (ssget "X" (list (cons 0 "Text") (cons 8 la)))))
    )
    (while (< i (sslength as))
    (setq e (ssname as i))
    (setq eli (entget e))
    (setq hoe (atof (cdr (assoc 1 eli))))
    (setq pkt (cdr (assoc 10 eli)))
    (setq pktn (list (car pkt) (cadr pkt) hoe))
    (command "_MOVE" e "" pkt pktn)
    (setq i (1+ i))
    )

    (command "_UCS" "_P")
    (setvar "REGENMODE" regenold)
    (setvar "CMDECHO" echoold)
    (setvar "EXPERT" expertold)
    (setvar "OSMODE" osnapold)
    (princ)

    )
     
    bob.at, Apr 26, 2004
    #3
  4. Randy S

    btlsp Guest

    Revised(Line 14) "TUP":

    ; > > > TUP < < <
    ;BILL TONNESEN EMAIL >>
    ;TUP.LSP 040426
    ;======================================================
    (defun C:TUP ()
    (svar)
    ;------------------------------------------------------
    ;...interface
    (if (not imtup)(setq imtup (list 2
    "Enter Elevation to-which-to-move" "0" )))
    (setq
    imtup (imp imtup)
    t2e (ssname (ssget) 0)
    v2 (scvc k (mget imtup 1 0))
    v3 (get 10 t2e)
    v4 (vc2 (vc2 v2 v0) v3)
    t2 (get 1 t2e) )
    (command "move" t2e "" v3 v4)
    (itzovr) )
    ;------------------------------------------------------
    ;...BT.LSP Routines
    ;SVAR IMP MGET
     
    btlsp, Apr 26, 2004
    #4
  5. Randy S

    btlsp Guest

    Revised "TUP":
    ;=================================================
    ; > > > TUP < < <
    ;BILL TONNESEN EMAIL >>
    ;TUP.LSP 040426
    ;=================================================
    (defun C:TUP ()
    (svar)
    ;------------------------------------------------------
    ;...interface
    (prompt "Pick Text")
    (setq
    t2e (ssname (ssget) 0)
    v2 (scvc k (rtos (get 1 t2e)))
    v3 (get 10 t2e)
    v4 (vc2 (vc2 v2 v0) v3) )
    (command "move" t2e "" v3 v4)
    (itzovr) )
    ;------------------------------------------------------
    ;...BT.LSP Routines
     
    btlsp, Apr 26, 2004
    #5
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.