프로그램
캐드 분류

entmake 관련해서 질문드립니다

컨텐츠 정보

  • 259 조회
  • 7 댓글
  • 0 추천
  • 0 비추천
  • 목록

본문

(defun uni (txt)


  (entmake (list (cons 0 "TEXT")
   (cons 1 "-")
   (cons 6 (cdr (assoc 6 ent)))
   (cons 7 (getvar "textstyle"))
   (cons 10 (list (+ (nth 1 (assoc 10 ent)) 344) (nth 2 (assoc 10 ent))))
   (cons 11 (list (+ (nth 1 (assoc 11 ent)) 355) (nth 2 (assoc 11 ent))))
   (cons 40 (cdr (assoc 40 ent)))
   (cons 41 (cdr (assoc 41 ent)))
   (cons 62 (cdr (assoc 62 ent)))
   (cons 72 2)
   (cons 73 2)))
)

캐드에 입력하고

커맨드창에
(uni unit) 이렇게 입력하니까 리습은 되는데

(uni 다음에 어떠한 문자가 들어가도 다 실행되던데 정확어떤 문자가 들어가야 하나요?

관련자료

댓글 7

닐스몹님의 댓글

파일내용까지 확인했습니다..! 친절한 설명까지 감사합니다!!

수야12님의 댓글

댓글로 달았다가 게시글이 지저분해져서 파일로 올립니다 ^^ ;;

닐스몹님의 댓글

윽…어떤 방식으로 수정하면 좋을지 봐주 실 수 있으신가요??

(defun c:wgt (/ text len r ent txt)

 (setvar "cmdecho" 0)

  (setq text (ssget "w" '(3788 3075) '(3860 2246) '((-4 . ""))))   (setq len (sslength text) r 1)

 (repeat len   (setq ent (entget (ssname text (1- r))))   (setq txt (cdr (assoc 1 ent)))  (if (> (atof txt) 1)   (uni unit))   (tot total)   (setq r (1+ r))  )

 (setvar "cmdecho" 1) (princ) )

(defun uni (txt)

  (entmake (list (cons 0 "TEXT")    (cons 1 "-")    (cons 6 (cdr (assoc 6 ent)))    (cons 7 (getvar "textstyle"))    (cons 10 (list (+ (nth 1 (assoc 10 ent)) 344) (nth 2 (assoc 10 ent))))    (cons 11 (list (+ (nth 1 (assoc 11 ent)) 355) (nth 2 (assoc 11 ent))))    (cons 40 (cdr (assoc 40 ent)))    (cons 41 (cdr (assoc 41 ent)))    (cons 62 (cdr (assoc 62 ent)))    (cons 72 2)    (cons 73 2))) )

(defun tot (txt)

  (entmake (list (cons 0 "TEXT")    (cons 1 "-")    (cons 6 (cdr (assoc 6 ent)))    (cons 7 (getvar "textstyle"))    (cons 10 (list (+ (nth 1 (assoc 10 ent)) 344) (nth 2 (assoc 10 ent))))    (cons 11 (list (+ (nth 1 (assoc 11 ent)) 500) (nth 2 (assoc 11 ent))))    (cons 40 (cdr (assoc 40 ent)))    (cons 41 (cdr (assoc 41 ent)))    (cons 62 (cdr (assoc 62 ent)))    (cons 72 2)    (cons 73 2))) )

단순히 좌표만따서 좌표내의 텍스트가 1일 경우와 2이상 경우만 나눠서 "-"라는 텍스트만 생성하는 리습입니다..

수야12님의 댓글

아무거나 써도 실행 되는 이유가 txt 변수를 리습안에서 사용하지 않기 때문입니다  그냥 uni 라는 리습을 실행할때 사용하지는 않겟지만 리습 호출용 키로 아무거나 끼워 넣게 다는 의미가 되는 거죠 
여분필드1 여분필드2 여분필드3
전체 7,152 / 1 페이지
번호
제목
이름
알림 0