프로그램
캐드 분류

리습 문의입니다.

컨텐츠 정보

본문

현재 캐드 2015년 버전에 윈도우8 64비트 사용중에 있습니다.
예전에 썼던 컴퓨터(캐드 2011버젼 윈도우7 64비트)에서는 리습이 먹혔는데요
현재 지금 안되고 있는데 고수님들한테 여쭤봅니다.

;;http://www.cadtutor.net/
;;by Lt Dan's legs


(defun c:DC (/ *error* snap ent e en gr pt)
  (vl-load-com)
  (defun *error* (msg)
    (cond ((wcmatch (strcase msg) "*BREAK*,*CANCEL*")(princ "*Cancel*"))
          ((wcmatch (strcase msg) "*EXIT*")(princ "*Exit*"))
          (t (princ msg))
    )
    (if e
      (entdel (cdr (assoc -1 e)))
    )
    (princ)
  )
  (defun snap (/ txt)
    (if (< (getvar 'osmode) 15360)
      (foreach x (list (cons 0 "_non")(cons 1 "_end")(cons 2 "_mid")(cons 4 "_cen")(cons 8 "_nod")(cons 16 "_qua")(cons 32 "_int")
                 (cons 64 "_ins")(cons 128 "_per")(cons 256 "_tan")(cons 512 "_nea")(cons 1024 "_qui")(cons 2048 "_app")(cons 4096 "_ext")(cons 8192 "_par"))
        (if (not (zerop (logand (getvar 'osmode) (car x))))
          (if txt
            (setq txt (strcat txt "," (cdr x)))
            (setq txt (cdr x))
          )
        )
      )
    )
    (if txt txt)
  )
  (defun ent ( ename )
    (entget
      ename
      '("ACAD")
    )
  )
  (while
    (not
      (and
        (setq en (car (entsel "nSpecify dimension to continue: ")))
        (eq "DIMENSION" (cdr (assoc 0 (entget en))))
      )
    )
    (prompt "nMissed! Try again!")
  )
  (setq en (ent en))
  (prompt "nSpecify second point : ")
  (while (and en (or (eq gr nil)(eq (car gr) 3)))
    (while (eq 5 (car (setq gr (grread 't 15 0))))
      (if (not (and (snap)(setq pt (osnap (cadr gr) (snap)))))
        (setq pt (cadr gr))
      )
      (if e
        (entmod
          (subst
            (cons 14 pt)
            (assoc 14 e)
            e
          )
        )
        (progn
          (foreach x en
            (if (or (eq (car x) -1)
                    (eq (car x) 2)
                    (eq (car x) 5)
                    (eq (car x) 330)
                )
              (setq e (vl-remove x en))
            )
          )
          (setq e
           (entmakex
       (subst
                (cons 13
               (if (< (distance pt (cdr (assoc 13 e)))(distance pt (cdr (assoc 14 e))))
                 (cdr (assoc 13 e))(cdr (assoc 14 e))
             )
                )
                (assoc 13 e)
                (subst
                  (cons 14
                   (if (< (distance pt (cdr (assoc 13 e)))(distance pt (cdr (assoc 14 e))))
                     (cdr (assoc 13 e))(cdr (assoc 14 e))
                 )
               )
             (assoc 14 e)
             e
                )
              )
            )
          )
          (setq e (ent e))
        )
      )
    )
    (if (eq (car gr) 3)
      (setq en (ent (entlast)) e nil)
    )
  )
  (if e
    (entdel (cdr (assoc -1 e)))
  )
  (princ)
)

관련자료

댓글 1 / 1 페이지

조용!!님의 댓글

(while (eq 5 (car (setq gr (grread 't 15 0)))) 여기 ' 티끌 하나 보이네요? 테스트는 안해봈습니다.. 소스로봤을땐 버전과 무관할듯 하네요

전체 61 / 4 페이지
번호
제목
이름

최근글


새댓글


알림 0