아스키 코드
파일:attachment/1275273992_asciitable.gif 2열 이후의 코드들은 위키에서 사용할 수
namu.wiki
;; by ASCII
(chr (+ (ascii "C") 32)) ;; "C" -->"c"
(chr (- (ascii "c") 32)) ;; "c" --> "C"
;; by Lisp fuction
(strcase "CcCc") ;; "CCCC"
(strcase "CcCc" T) ;; "cccc"
;; 소문자는 대문자보다 ascii 10진법으로 32 크다.
;; strcase 함수로 일괄 대소문자 변경.
;; Changing the capitalize the first letter
(defun KM:CAPI ( _STR / str0 str1 str2 str3 Nstr)
(setq str0 _STR)
(setq str1 (strcase str0 T))
(setq str2 (substr str1 1 1))
(setq str3 (substr str1 2))
(setq str2 (chr (- (ascii str2) 32)))
(setq Nstr (strcat str2 str3))
)
;; substr 함수로 첫글자와 두번째부터 글자를 분리하고, 첫글자만 대문자로 변경
(defun c:capi ( / )
(setq txtdxf (entget (car (entsel)))) ;; select a txt
(setq str (cdr (assoc 1 txtdxf))) ;; extract string from the txt
(KM:CAPI str)
(princ)
)
'autocad' 카테고리의 다른 글
| radian (0) | 2025.09.08 |
|---|---|
| 문장 내부에 마지막 숫자만 무조건 1 증가; 감소 (0) | 2025.09.04 |
| Find Centroid of reg.Triangle (0) | 2025.09.02 |
| 엔티티 수정; Modify entity(entmod) (0) | 2025.08.26 |
| 납품: Xref; revision Layer; issue Date 관리 (0) | 2025.08.25 |