Lisp Routines
Lisp Routines
(OP)
When I run several lisp routines they work well, but my main problen is the text I get at the end i.e. (STT Unknown command "STT". Press F1 for help.) despite getting the expected results. Would you please help me? I have even added the search path. Some routines do not display that massage.





RE: Lisp Routines
2) add a "princ" at the end
3) don't use Ctrl-C to exit the routine
4) if you must use Ctrl-C to exie the routine, include a basic error handler in the routine
Post one of the lisp routines if it is short for us to review
RE: Lisp Routines
;|Writen by Eddie Mukahadira. This code is for incremental
labelling of objects objects.
|;
(prompt
"\nObject Numbering Version 1.0 May 2003 \nby Eddie Mukahadira tendairejoice@btopenworld.com"
)
(Defun c:obn (/ n1 n2)
(setq blp1 (getvar "blipmode") cl1 (getvar "clayer") osm (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(setvar "osmode" 0)
(prompt "\n Select Objects to be Numbered: ")
(setq ss1 (ssget))
(setq l1 (sslength ss1))
(if (null n2) (setq n2 1))
(initget 6)
(setq n1 (getint (strcat "\nBegin Numbering from <" (itoa n2) ">: ")))
(if (null n1) (setq n1 n2))
(setq n1 (- n1 1))
(repeat (sslength ss1)
(setq n1 (+ 1 n1))
(setq ent1 (cons 1070 n1))
(setq ent1 (list "Object_Number" ent1))
(setq ent1 (list -3 ent1))
(setq ent1 (list ent1))
(setq lsent (entget (nth 0 (entsel "\nSelect Object: "))))
(setq pt1 (cdr (assoc 10 lsent)))
(setq pt1 (polar pt1 0 200))
(setq pt1 (polar pt1 (/ pi 2) 200))
(regapp "Object_Number")
(setq exdata ent1)
(setq nwent1 (append lsent exdata))
(entmod nent1)
(setq n2 (itoa n1))
(command ".text" pt1 250 0 n2 "")
)
(setq ss1 nil)
(setvar "blipmode" blp1)
(setvar "clayer" cl1)
(setvar "osmode" osm)
(setvar "cmdecho" 1)
(princ); nice departure
)
RE: Lisp Routines
(command ".text" pt1 250 0 n2 "")
delete the last "", as follows:
(command ".text" pt1 250 0 n2)
HTH,
Carl
RE: Lisp Routines