pheng
Electrical
- Oct 4, 2005
- 2
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")
)