26 lines
555 B
Markdown
26 lines
555 B
Markdown
```Lisp
|
|
|
|
(defun draw_L_C (sp ep color)
|
|
(command "line" sp ep "")
|
|
(command "chprop" "l" "" "c" color "")
|
|
(command "circle" "2p" sp ep)
|
|
(command "chprop" "l" "" "c" (+ 1 color) "")
|
|
(princ)
|
|
|
|
)
|
|
|
|
(defun c:exo3 ()
|
|
(setvar "cmdecho" 0)
|
|
(setq p1 (getpoint "\n>>첫점 입력 : "))
|
|
(setq p2 (getpoint p1 "\n>>두번째점 입력 : "))
|
|
(setq bc (getint "\n>>기준 색상 입력 : "))
|
|
|
|
; sub함수(draw_L_C) 외부파일로 저장했을경우 로드하는 로직 필요함
|
|
; (load "sub함수 예제")
|
|
(draw_L_C p1 p2 bc)
|
|
|
|
(princ)
|
|
)
|
|
|
|
```
|