Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lisp Routines 1

Status
Not open for further replies.

tendai1

Structural
Mar 29, 2003
24
0
0
GB
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.
 
Replies continue below

Recommended for you

1) add cmdecho off at the beginning and cmdecho on at the end
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
 
Sorry for the late reply. This is one of my lisp codes, I have even tried cmdecho still no change. Whats the best way to determine which System Variable to use and when? I am still leaning lisp be patient with me.

;|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:eek:bn (/ 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 &quot;\nBegin Numbering from <&quot; (itoa n2) &quot;>: &quot;)))
(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 &quot;Object_Number&quot; ent1))
(setq ent1 (list -3 ent1))
(setq ent1 (list ent1))
(setq lsent (entget (nth 0 (entsel &quot;\nSelect Object: &quot;))))
(setq pt1 (cdr (assoc 10 lsent)))
(setq pt1 (polar pt1 0 200))
(setq pt1 (polar pt1 (/ pi 2) 200))
(regapp &quot;Object_Number&quot;)
(setq exdata ent1)
(setq nwent1 (append lsent exdata))
(entmod nent1)
(setq n2 (itoa n1))
(command &quot;.text&quot; pt1 250 0 n2 &quot;&quot;)
)
(setq ss1 nil)
(setvar &quot;blipmode&quot; blp1)
(setvar &quot;clayer&quot; cl1)
(setvar &quot;osmode&quot; osm)
(setvar &quot;cmdecho&quot; 1)
(princ); nice departure
)
 
In the line
(command &quot;.text&quot; pt1 250 0 n2 &quot;&quot;)

delete the last &quot;&quot;, as follows:
(command &quot;.text&quot; pt1 250 0 n2)

HTH,
Carl
 
Status
Not open for further replies.
Back
Top