Autolisp pause when insert attributes
Autolisp pause when insert attributes
(OP)
I have created a program that will automatically insert a standardized drawing title, and then insert a north arrow with a specified direction. It works ok except that when lisp inserts "atitleft" and the user is prompted for the attribute title (txt), it will not allow for spaces between words. I've tried using pause instead of first using getstring-txt but that didn't work. Any ideas as how to allow for spaces when intering the title name?
(defun C:titlexft ()
(setq la (getvar "clayer"))
(command "blipmode" "on")
(command "layer" "s" "titletxt" "")
(setq lt (/ (getvar "ltscale") 30))
(setq scf (/ (getvar "dimscale") 96))
(setq pnt1 (getpoint "\nPick insertion point for bottom-left of text "))
(setq txt (getstring "\nDrawing Title: "))
(setq scl (getstring "\nDrawing Scale <20'>: "))
(setq tem (getstring "\nDrawing Template <SCALE: 1=>: "))
(command "insert" "atitleft" "s" lt pnt1 "" txt scl tem)
(setq pnt2x (- (CAR PNT1) (* 61 SCF)))
(setq pnt2y (+ (CADR PNT1) (* 18 SCF)))
(setq pnt2 (list pnt2x pnt2y))
(setq ang1 (getorient PNT2 "DIRECTION OF NORTH ARROW: "))
(setq ang2 (* (/ ANG1 PI) 180))
(setq pnt3 (polar pnt2 (+ ANG1 PI) (* 27 SCF)))
(command "insert" "anarrow" pnt2 scf "" ang2)
(command "insert" "anlogo" pnt3 scf "" "")
(command "layer" "s" la "")
(command "blipmode" "off")
)
(defun C:titlexft ()
(setq la (getvar "clayer"))
(command "blipmode" "on")
(command "layer" "s" "titletxt" "")
(setq lt (/ (getvar "ltscale") 30))
(setq scf (/ (getvar "dimscale") 96))
(setq pnt1 (getpoint "\nPick insertion point for bottom-left of text "))
(setq txt (getstring "\nDrawing Title: "))
(setq scl (getstring "\nDrawing Scale <20'>: "))
(setq tem (getstring "\nDrawing Template <SCALE: 1=>: "))
(command "insert" "atitleft" "s" lt pnt1 "" txt scl tem)
(setq pnt2x (- (CAR PNT1) (* 61 SCF)))
(setq pnt2y (+ (CADR PNT1) (* 18 SCF)))
(setq pnt2 (list pnt2x pnt2y))
(setq ang1 (getorient PNT2 "DIRECTION OF NORTH ARROW: "))
(setq ang2 (* (/ ANG1 PI) 180))
(setq pnt3 (polar pnt2 (+ ANG1 PI) (* 27 SCF)))
(command "insert" "anarrow" pnt2 scf "" ang2)
(command "insert" "anlogo" pnt3 scf "" "")
(command "layer" "s" la "")
(command "blipmode" "off")
)





RE: Autolisp pause when insert attributes
(setq txt (getstring T "\nDrawing Title: "))
will allow you to enter a string with spaces in it.
I'm confused though on the following command:
command "insert" "atitleft" "s" lt pnt1 "" txt scl tem)
After the double quotes (which is saying you're accepting the current number for the rotation). The insert command is done. I assume your trying to put in values for attributes. But as near as I can tell that won't work. I'm using Acad 2002 so maybe something changed but I doubt it.
RE: Autolisp pause when insert attributes
RE: Autolisp pause when insert attributes
Anyway, glad I could help