See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Change text elevation to its value.

  1. #1
    100 Club bmonk's Avatar
    Join Date
    2005-11
    Location
    ...1st & 1st...Im at the nexis of the universe...
    Posts
    159
    Login to Give a bone
    0

    Default Change text elevation to its value.

    I'm sure this has been discussed, but im not finding any threads about it, so I'll ask here.

    Does anyone have a lisp to change the elevation of text (dtext, mtext, etc.) to its value?

    e.g. text = 532.33, but the elev. = 0

    I want the elev. to change to 532.33.



    thanks

  2. #2
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    1

    Default Re: Change text elevation to its value.

    ;This autolisp program moves text to an elevation based on it's value.

    Code:
    (DEFUN C:MTE ()
     (PROMPT "\n***Move Text to Elevation***")
     (SETVAR "CMDECHO" 0)
     (COMMAND "UNITS" "2" "2" "" "" "" "")
     (SETQ APS (SSGET '((0 . "TEXT")) ))
     (SETQ APSL (SSLENGTH APS))
     (SETQ CT1 (- APSL 1))
     (SETQ LP1 1)
     (WHILE LP1
      (SETQ APSN (SSNAME APS CT1))
      (SETQ CT1 (- CT1 1))
      (SETQ APSNL (ENTGET APSN))
      (SETQ APSNLIP (CDR (ASSOC 10 APSNL)))
      (SETQ APSNLIPX (CAR APSNLIP))
      (SETQ APSNLIPY (CAR (CDR APSNLIP)))
      (SETQ APSNLELZ (DISTOF (CDR (ASSOC 1 APSNL)) 2))
      (SETQ NAPSNLPT (LIST APSNLIPX APSNLIPY APSNLELZ))
      (IF (/= APSNLELZ NIL) 
       (PROGN
        (COMMAND "CHANGE" APSN "" "P" "C" "RED" "")
        (COMMAND "MOVE" APSN "" APSNLIP NAPSNLPT)
      )); END PROGN/IF APSNLELZ
      (IF (< CT1 0) (SETQ LP1 nIL))
     );END LP1
     (SETVAR "CMDECHO" 1)
     (PRINC)
    );END MTE
    Attached Files Attached Files

  3. #3
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    1

    Default Re: Change text elevation to its value.

    Guess, you need to change Z ordinate of the texts,
    correct me if I am wrong
    Give this a try


    ~'J'~

    Code:
    (defun c:CLV (/ elev elist en i ipt newpt ss txstr)
      (princ "\n  Select text") 
      (if (setq ss (ssget '((0 . "*TEXT"))))
        (progn
        (setq i -1)
        (repeat (sslength ss)
          (setq elist (entget (setq en (ssname ss (setq i (1+ i)))))
    	    ipt (cdr (assoc 10 elist))
    	    txstr (cdr (assoc 1 elist))
    	    elev (atof txstr)
    	    newpt (list (car ipt) (cadr ipt) elev )
    	    )
          (entmod (subst (cons 10 newpt)(assoc 10 elist) elist))
          (entupd en)
          )
        )
        )
      (princ)
      )
    (princ "\n\t\t* Type CLV to execute *")
    (princ)

  4. #4
    100 Club bmonk's Avatar
    Join Date
    2005-11
    Location
    ...1st & 1st...Im at the nexis of the universe...
    Posts
    159
    Login to Give a bone
    0

    Default Re: Change text elevation to its value.

    Quote Originally Posted by fixo
    Guess, you need to change Z ordinate of the texts,
    correct me if I am wrong
    Give this a try


    ~'J'~

    Code:
    (defun c:CLV (/ elev elist en i ipt newpt ss txstr)
      (princ "n  Select text") 
      (if (setq ss (ssget '((0 . "*TEXT"))))
        (progn
        (setq i -1)
        (repeat (sslength ss)
          (setq elist (entget (setq en (ssname ss (setq i (1+ i)))))
    	    ipt (cdr (assoc 10 elist))
    	    txstr (cdr (assoc 1 elist))
    	    elev (atof txstr)
    	    newpt (list (car ipt) (cadr ipt) elev )
    	    )
          (entmod (subst (cons 10 newpt)(assoc 10 elist) elist))
          (entupd en)
          )
        )
        )
      (princ)
      )
    (princ "ntt* Type CLV to execute *")
    (princ)

    Thank you, it works like a charm. I had set aside the project that I was needing this for, and got going on it again today, and I though "man, I wish I had a lisp routine for this". I started to make a new thread, and my auto-fill text popped down when I was typing out the title, and then I remembered I had done this once before. Anyway, long story longer, it works great, and thank you again.

Similar Threads

  1. Replies: 5
    Last Post: 2016-08-11, 11:35 PM
  2. 2014: Spot Elevation with Boxed elevation text
    By kchenault in forum Revit MEP - General
    Replies: 0
    Last Post: 2014-02-27, 05:20 PM
  3. 2004: When I change dimn. text size, won't change in model space.
    By lucky13gurl420508758 in forum AutoCAD General
    Replies: 2
    Last Post: 2012-11-07, 06:19 PM
  4. Change elevation of existing elevation labels
    By dzatto in forum ACA General
    Replies: 10
    Last Post: 2009-08-16, 01:34 PM
  5. Elevation tag change?
    By CADMama in forum Revit Architecture - Families
    Replies: 3
    Last Post: 2006-09-12, 02:51 AM

Posting Permissions

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