LISP 좀 봐주세요…(_ _)
컨텐츠 정보
- 124 조회
- 5 댓글
- 0 추천
- 0 비추천
-
목록
본문
먼저 감사합니다…(_ _)
센터라인인데요.
오류가 자주 나네요.
몇줄 고견 부탁합니다.
(defun dtr (a)
(* pi (/ a 180.0)))
(defun c:cl (/ a b lay rad cen pt1 pt2 pt3 pt4)
(setq lay (getvar “clayer”))
(setq ly (tblsearch “layer” “4”))
(if (= ly nil)(command “-layer” “m” “4” “c” “1” “” “l” “center” “” “s” lay “”))
(setq a (entsel “n원(Circle) 또는 호(Arc)를 선택하시오: “))
(setq b (entget (car a)))
(setq cen (cdr (assoc 10 b)))
(setq rad (cdr (assoc 40 b)))
(setq pt1 (polar cen (dtr 90) (+ rad (/ rad 5))))
(setq pt2 (polar cen (dtr -90) (+ rad (/ rad 5))))
(setq pt3 (polar cen (dtr 180) (+ rad (/ rad 5))))
(setq pt4 (polar cen (dtr 0) (+ rad (/ rad 5))))
(command “line” pt1 pt2 “”)
(command “chprop” “l” “” “la” “4” “”)
(command “line” pt3 pt4 “”)
(command “chprop” “l” “” “la” “4” “”)
(princ)
)
항상 건강하세요.
관련자료
캐드플러스님의 댓글
(defun dtr (a) (* pi (/ a 180.0)))
(defun c:cl (/ a b lay rad cen pt1 pt2 pt3 pt4 os_mode) (setq lay (getvar “clayer”)) (setq ly (tblsearch “layer” “4”)) (if (= ly nil)(command “-layer” “m” “4” “c” “1” “” “l” “center” “” “s” lay “”))
(if (setq a (entsel “n원(Circle) 또는 호(Arc)를 선택하시오: “)) (progn (setq b (entget (car a))) (setq cen (cdr (assoc 10 b))) (setq rad (cdr (assoc 40 b)))
(setq pt1 (polar cen (dtr 90) (+ rad (/ rad 5)))) (setq pt2 (polar cen (dtr -90) (+ rad (/ rad 5)))) (setq pt3 (polar cen (dtr 180) (+ rad (/ rad 5)))) (setq pt4 (polar cen (dtr 0) (+ rad (/ rad 5))))
(setq os_mode (getvar “osmode”)) (setvar “osmode” 0) (command “line” pt1 pt2 “”) (command “chprop” “l” “” “la” “4” “”) (command “line” pt3 pt4 “”) (command “chprop” “l” “” “la” “4” “”) (setvar “osmode” os_mode) ) );end of if. (princ) )