Message 1 of 11
AutoCAD R14 AutoLISP Error: Bad Argument Type

Not applicable
08-31-2000
06:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am new in learning AutoLISP on AutoCAD R14. I tried to construct a 'catenary' curve: Y = 1/2[exp(X) + exp(-X)]. I can not figure out why the program listed below does not work. Please help: tell me why I got an Error : Bad Argument Type in the following program:
(defun C:SUSP () ; Suspension Bridge
(graphscr)
(setq L (getreal "\rPLEASE ENTER THE Bridge Span "))
(setq H (getreal "\rPLEASE ENTER THE Height of The Bridge "))
(setq X (- 0 (/ L 2)))
(setq P1 (list (- 0 (/ L 2)) (- H (* 0.548 H))) Q T)
(while Q
(setq A (EXP (* 2 X (/ 1.0 L))))
(setq B (EXP (- 0 (* 2 X (/ 1.0 L)))))
(setq Y (- (* 0.324 H (+ A B)) (* 0.548 H)))
(setq P2 (list X Y))
(command "LINE" P1 P2 "")
(setq P1 P2 X (+ X (/ L 50)))
(if (> X (/ L 2))(setq Q nil))
)
)
Thanks in advance,
Scott Chang
(defun C:SUSP () ; Suspension Bridge
(graphscr)
(setq L (getreal "\rPLEASE ENTER THE Bridge Span "))
(setq H (getreal "\rPLEASE ENTER THE Height of The Bridge "))
(setq X (- 0 (/ L 2)))
(setq P1 (list (- 0 (/ L 2)) (- H (* 0.548 H))) Q T)
(while Q
(setq A (EXP (* 2 X (/ 1.0 L))))
(setq B (EXP (- 0 (* 2 X (/ 1.0 L)))))
(setq Y (- (* 0.324 H (+ A B)) (* 0.548 H)))
(setq P2 (list X Y))
(command "LINE" P1 P2 "")
(setq P1 P2 X (+ X (/ L 50)))
(if (> X (/ L 2))(setq Q nil))
)
)
Thanks in advance,
Scott Chang