Jump to content

single line text


anishtain4

Recommended Posts

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

Link to comment
Share on other sites

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

 

(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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...