entmake 관련해서 질문드립니다
컨텐츠 정보
- 818 조회
- 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 다음에 어떠한 문자가 들어가도 다 실행되던데 정확어떤 문자가 들어가야 하나요?
관련자료
닐스몹님의 댓글
윽…어떤 방식으로 수정하면 좋을지 봐주 실 수 있으신가요??
(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이상 경우만 나눠서 "-"라는 텍스트만 생성하는 리습입니다..