A little LISP tweeking please
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
A little LISP tweeking please

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Rick Spangenberger
Guest





Posted: Sat Feb 12, 2005 7:15 am    Post subject: A little LISP tweeking please Reply with quote

An NG member was kind enough to supply this code to me. It draws a line
underneath text with inputted text location, linetype and linetype scale.
------------------------------------------------------------------------------------------------------------------------------------------------------

I would like it to use the current text style and height, instead of the
standard style and prompting me for a height.

I would like it to use hidden as the linetype, instead of being prompted.

I would like it to retain the initially prompted input value for the
linetype scale, until I change it.

Finally, stay in the command until I force an exit.
________________________________________________________________________________________________________________

This is the code:

(defun c:ntu (/ tx hei loc ss ssn sse sp th gap tb tb1
tlen ep elast ename opt ss2 ent sf opt1)
(vl-load-com)
(setq tx (getstring T "\nENTER NEW TEXT TO ADD UNDERLINE: "))
(setq st (getstring S "\nENTER TEXT STYLE: '))
(setq loc (getpoint "\nENTER LOCATION FOR OBJECT: "))
(command "_text" loc ST "" tx "")
(setq ss (entlast))
(setq sse (entget ss))
(setq sp (cdr (assoc 10 sse)))
(setq th (cdr (assoc 40 sse)))
(setq gap (* th 0.2))
(setq tb (textbox sse))
(setq tb1 (nth 1 tb))
(setq tlen (car tb1))
(setq sp (list (car sp)(- (cadr sp) gap)(caddr sp)))
(setq ep (list (+ (car sp) tlen)(cadr sp)(caddr sp)))
(command "_line" sp ep "")
(setq elast (entget (entlast))
ename (cdr (car elast))
opt (getstring "\nENTER NEW LINETYPE NAME: "))
(command "_change" ename "" "p" "lt" opt "")
(setq ss2 (entlast))
(setq ent (vlax-ename->vla-object ss2))
(setq sf (rtos (vlax-get-property ent "LinetypeScale")))
(setq opt1 (getreal (strcat "\nENTER NEW LINE TYPE SCALE" "<" sf ">" ":
")))
(vla-put-LinetypeScale ent opt1)
(princ)
)

A great thanks to Ade Suharna for supplying the code.
Thanks for any help forthcoming!

Back to top
ECCAD
Guest





Posted: Sat Feb 12, 2005 9:49 pm    Post subject: Re: A little LISP tweeking please Reply with quote

Rick,
See the other thread.

Bob
Back to top
TCEBob
Guest





Posted: Sun Feb 13, 2005 6:12 am    Post subject: Re: A little LISP tweeking please Reply with quote

Bob, give us a hint.

rs

"ECCAD" <nospam@address.withheld> wrote in message
news:8087571.1108226984066.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
Rick,
See the other thread.

Bob


Back to top
ECCAD
Guest





Posted: Sun Feb 13, 2005 6:13 pm    Post subject: Re: A little LISP tweeking please Reply with quote

TCEBob,
Hint:
:)

http://discussion.autodesk.com/thread.jspa?threadID=382909

Bob
Back to top
tcebob
Guest





Posted: Mon Feb 14, 2005 12:38 am    Post subject: Re: A little LISP tweeking please Reply with quote

Ah, so. The program had some errors as Rick had entered it and I started to
fudge with it before the crash. Hmm. . .

rs

"ECCAD" <nospam@address.withheld> wrote in message
news:25480376.1108300442175.JavaMail.jive@jiveforum2.autodesk.com...
: TCEBob,
: Hint:
::)
:
: http://discussion.autodesk.com/thread.jspa?threadID=382909
:
: Bob
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Access Forum - Microsoft Office Forum - Electronics

Contact Us Powered by phpBB