+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jun 2011
    Posts
    83

    Default single line text

    Registered forum members do not see this ad.

    I need a lisp to use DT command in a way that when the user press the enter no new line get started and command ends, how should I do it? absolutely no idea

  2. #2
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jun 2011
    Posts
    83

    Default

    never mind, got it. I should make the user press enter twice

  3. #3
    Senior Member
    Using
    not applicable
    Join Date
    Jan 2008
    Location
    Littleton Colorado USA
    Posts
    166

    Default

    Registered forum members do not see this ad.

    In case you may still be interested, here is a program to do what you asked for.

    Code:
    (defun Text (pt hgt str) 
    (entmakex (list (cons 0 "TEXT")
    (cons 10 pt)
    (cons 11 pt) 
    (cons 40 hgt)
    (cons 72 0) ; lower left justified
    (cons 1 str)))
    )
    
    (defun c:dtxx (/ *ERROR* osave c txtstr txtsz)
    
    (defun *ERROR* (msg)
    (setvar "OSMODE" osave)
    (princ)
    )
    
    (setq osave (getvar "OSMODE"))
    (setvar "OSMODE" 0)
    (setq txtsz (getvar "TEXTSIZE"))
    (setq c (getpoint "\nSelect location: "))
    (initget 129)
    (setq txtstr (getstring T "\nText: "))
    (terpri)
    (terpri)
    (Text c txtsz txtstr)
    (setvar "OSMODE" osave)
    (princ) )
    The rotation angle is the default (zero) and the current text size is used. You could, of course, add code to get these values from the user.

Similar Threads

  1. Convert Single line text to multi-line?
    By LKJR in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 13
    Last Post: 16th Jan 2013, 07:31 pm
  2. Single Line text to Multiline Text, possible?
    By Fire_col in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 23rd Feb 2010, 02:50 pm
  3. change from single line text to multiline text
    By zarzar in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 20th Oct 2009, 11:12 am
  4. Single Line Text
    By mr_mojo_risin in forum AutoCAD General
    Replies: 5
    Last Post: 21st May 2008, 02:31 pm
  5. single line text
    By kc27315 in forum AutoCAD Drawing Management & Output
    Replies: 16
    Last Post: 4th Jan 2008, 03:41 am

Bookmarks

Posting Permissions

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