×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Lisp Routines

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

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

RE: Lisp Routines

(OP)
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: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

In the line
(command ".text" pt1 250 0 n2 "")

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

HTH,
Carl

RE: Lisp Routines

(OP)
Thanks, It has worked well.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources