리습고수분의 도움 부탁드립니다.
컨텐츠 정보
- 798 조회
- 3 댓글
- 0 추천
- 0 비추천
-
목록
본문
2012버전까지 잘 사용하다가
관련자료
상큼메론90님의 댓글
질문하는데 시간을 투자해 주세요. 대충질문하면 안됩니다.
질문이 2012버젼까지 사용하다가 윈도우10으로 갈아탔는데, 캐드는 2015를 쓴다는 것임??? 아니면 윈도우10에서 캐드 2012에서 osmode "nil" 이라는 에러가 난다는거임???
답변하는것은 더 많은 시간이 투자됩니다. 정확한 답을 얻으려면 질문에 시간을 투자해 주세요… 질문자님 캐드가 2015 버젼을 쓴다고 해 봅시다. 캐드 2015 버젼에서는 리습 안에서 command 명령어가 command-s 로 바뀌었습니다.
command 와 동일한 vl-cmdf 명령어는 그대로 사용 가능하구요~
버젼이 높아 질수록 버젼별로 안되는 리습들이 몇개 있습니다. 대부분 command 명령어로 시작되는 곳에서 약간씩 차이가 있더군요~
그리고 command-s 등 약간 바뀐것들은 아래 참고하시면 도움되실듯
본론으로 들어가서 일단 2015에서 그렇게 에러가 난다고 가정하면, 아래와 같이 수정됩니다.
(defun c:els (/ ss sslist i index linelist linenumlist ent old10 old11 dist lnum count temp total subtotal txt pt) (princ "n Eltity Length Sum") (setvar "cmdecho" 0) (setq sslist nil) (setq ss (ssget (list (cons 0 "LINE,CIRCLE,ARC,POLYLINE,LWPOLYLINE,ELLIPSE,SPLINE")))) (if ss (progn (setq index 0) (setq linelist nil) (setq linenumlist nil) (repeat (sslength ss) (setq ent (ssname ss index)) ;(command "lengthen" ent "") (command-s "lengthen" ent "" "" "") ; <— 2015 수정 (setq dist (GETVAR "PERIMETER")) (if (apply 'or (mapcar '(lambda (x) (equal dist x 0.0001)) linelist)) (progn (setq temp 0) (setq lnum nil) (foreach x linelist (if (equal dist x 0.0001) (setq lnum temp) ) (setq temp (1+ temp)) ) (setq count 0) (setq temp nil) (foreach x linenumlist (if (= count lnum) (setq temp (append temp (list (+ x 1)))) (setq temp (append temp (list x))) ) (setq count (1+ count)) ) (setq linenumlist temp) ) (progn (setq linelist (append linelist (list dist))) (setq linenumlist (append linenumlist (list 1))) ) ) (setq index (1+ index)) ) (setq txt "") (setq count 0) (setq total 0) (setq subtotal 0) (repeat (length linelist) (if (= count 0) (if (> (nth count linenumlist) 1) (setq txt (strcat "nL=" (rtos (/ (nth count linelist) 1000.0) 2 2) "x" (rtos (nth count linenumlist) 2 0) "ea")) (setq txt (strcat "nL=" (rtos (/ (nth count linelist) 1000.0) 2 2))) ) (if (> (nth count linenumlist) 1) (setq txt (strcat txt "+" (rtos (/ (nth count linelist) 1000.0) 2 2) "x" (rtos (nth count linenumlist) 2 0) "ea")) (setq txt (strcat txt "+" (rtos (/ (nth count linelist) 1000.0) 2 2))) ) ) (setq subtotal (* (/ (nth count linelist) 1000.0) (nth count linenumlist))) (setq total (+ subtotal total)) (setq count (1+ count)) ) (setq txt (strcat txt "=" (rtos total 2 2) "m")) (setq txt (strcat txt ", 객체수" (rtos (length linelist) 2 0) "개")) (princ txt) (setq pt (getpoint "n 텍스트 삽입점 : ")) (if (not (setq ptt (getreal (strcat "n현재 TextSize : <" (rtos(getvar "textsize") 2 1) "> 입니다. 원하는 Text 크기를 입력하세요, 원치 않으면 그냥 엔터를 치세요 : ")))) (setq ptt (getvar "textsize")) (setvar "textsize" ptt) ) ;(if pt (command "text" pt "" "" txt)) (if pt (command-s "text" pt "" "" txt)) ; <— 2015 수정 ) ) (princ) )
;;;