Append text to dimension

Discussion in 'AutoCAD' started by Tim, Feb 7, 2005.

  1. Tim

    Tim Guest

    Hi

    I would like to write a program to append text to a dimension. What I do now
    is, select the dim, go to the properties box and in the text override box
    type some thing like "<>(12Pls)" if I have more then one that will have the
    same text I just select all of them first, I would like to have the the
    command ask for the text and then just select all the dimension I need to
    add the text to. I'm just learning lisp. I look at the help files and
    believe I may need to use Active x but I'm not sure. Like I said I'm a
    newbie.

    Thanks
    Tim
     
    Tim, Feb 7, 2005
    #1
  2. Tim

    T.Willey Guest

    Maybe something like:

    (defun c:AppendDim (/ tmpEnt tmpTxt tmpEntData Txt ss)

    (if
    (and
    (setq Txt (getstring T"\n Enter value to add to end of dimension text: "))
    (setq ss (ssget '((0 . "DIMENSION"))))
    )
    (while (setq tmpEnt (ssname ss 0))
    (setq tmpEntData (entget tmpEnt))
    (setq tmpTxt (cdr (assoc 1 tmpEntData)))
    (entmod (subst (cons 1 (strcat tmpTxt " "Txt)) (assoc 1 tmpEntData) tmpEntData))
    (ssdel tmpEnt ss)
    )
    )
    (princ)
    )

    Tim
     
    T.Willey, Feb 7, 2005
    #2
  3. Tim

    Tim Guest

    Thank you it works great,
    Very Cool, I'll have to sit here and study how it all works allot simpler
    than I thought.

    Thank you again.
     
    Tim, Feb 7, 2005
    #3
  4. Tim

    T.Willey Guest

    You're welcome. If you don't understand something after looking through it and the help file, post and someone will most likely answer.

    Tim
     
    T.Willey, Feb 7, 2005
    #4
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.