728x90
문자 또는 숫자 자동 증가
(defun c:tag ( / fun ins ocs str uxa )
(while
(not
(or (= "" (setq str (getstring "\nSpecify grid line tag: ")))
(wcmatch str "~*[~0-9]*")
(wcmatch str "~*[~a-zA-Z]*")
)
)
(princ "\n 숫자 또는 알파벳문자이어야 함...")
)
(if (/= "" str)
(progn
(if (wcmatch str "~*[~0-9]*")
(setq fun (lambda ( x ) (itoa (1+ (atoi x)))))
(setq fun LM:A++)
)
(setq ocs (trans '(0.0 0.0 1.0) 1 0 t)
uxa (angle '(0.0 0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t))
)
(while (setq ins (getpoint "\nSpecify point : "))
(entmake
(list
'(00 . "TEXT")
'(72 . 4)
'(73 . 0)
(cons 001 str)
(cons 050 uxa)
(cons 007 (getvar 'textstyle))
(cons 040 (getvar 'textsize))
(cons 010 (trans ins 1 ocs))
(cons 011 (trans ins 1 ocs))
(cons 210 ocs)
)
)
(setq str (fun str))
)
)
)
(princ)
)
;; Alpha++ - Lee Mac
;; Increments an alphabetical string by one, e.g. AZ => BA
;; a - [str] alphabetical string
(defun LM:A++ ( a )
( (lambda ( f ) (vl-list->string (reverse (f (reverse (vl-string->list a)) t))))
(lambda ( l x )
(cond
( (null l) (if x '(65) '(97)))
( (= 090 (car l)) (cons 65 (f (cdr l) t )))
( (= 122 (car l)) (cons 97 (f (cdr l) nil)))
( (cons (1+ (car l)) (cdr l)))
)
)
)
)
(princ)
728x90
'캐드리습' 카테고리의 다른 글
리습강의 (0) | 2023.07.29 |
---|---|
도곽블럭_선택하여_선축척변경 (0) | 2023.06.27 |
SSGET 사용법 정리 (0) | 2023.06.27 |
중심선 리습 (0) | 2023.02.15 |
멀티 회전복사 리습 (0) | 2023.02.14 |