;선택순서 넘버링(습작)=======================================
(defun c:cn3(/ $str $s1 $s2 $s3 $s4 n $c $ntxt gr)
;;*—–
(defun myerror (s)
(if (not (member s ‘(“console break” “함수가 취소되었습니다.” “Function cancelled”)))
(princ “nerror : * 어허 숫자도 구분 못하는갑네~!!*”)
)
(setq *error* olderr)
(princ)
)
;;*———
(setq olderr *error* *error* myerror)
(setq $str “” $s1 “1” n_1 “1” $c_1 “3” ccl “1”)
(if (/= nil $s5)(setq $s1 $s5))
(@cn3)
(if (= ccl nil)(exit)(progn
(setq n (atoi n_1))
(if (not n)(setq n 1))
(setq $c (atoi $c_1))
(setq $s4(atoi $s1))
(setq a (grread 1 14 2))
(while 1
(setq $s2 (car(entsel)))
(if (= $s2 nil)(setq $s2 (car (entsel))))
(setq gr (car(grread T 14 2)))
(if (and (= gr 12)(= $s2 nil)) *error*)
(setq $s2 (entget $s2))
(setq $s3 (itoa $s4))
(repeat (- $c (strlen $s3))
(setq $s3 (strcat “0” $s3))
);repeat
(setq $s3 (strcat $str $s3))
(setq $ntxt (cons 1 $s3))
(setq $s3 (subst $ntxt (assoc 1 $s2) $s2))
(entmod $s3)
(setq $s4 (+ $s4 n))
(setq $s5 (itoa $s4))
);while
)
)
(princ)
);defun
;;;++++++++++++++++++++++++++++++++++++++++++++++
;;;++++++++++++++++++++++++++++++++++++++++++++++
(defun @cn3( / key1 key2 key3 key4 key5 key6 )
(setq fname (vl-filename-mktemp “dcl.dcl”))
(setq fn (open fname “w”))
(write-line
“cn3 : dialog {
label = ”넘버링 교체(CN3)”;
initial_focus = ”*s1”;
:boxed_column{label= ””;
: edit_box {
label = ”앞글자:”;
key = ”*str”;
mnemonic = ”N”;
edit_width = 10;
edit_limit = 10;
allow_accept = true;
}
: edit_box {
label = ”시작 번호:”;
key = ”*s1”;
mnemonic = ”N”;
edit_width = 10;
edit_limit = 10;
allow_accept = true;
}
: edit_box {
label = ”증분값:”;
key = ”*n1”;
mnemonic = ”N”;
edit_width = 10;
edit_limit = 10;
allow_accept = true;
}
: edit_box {
label = ”자릿수:”;
allow_accept = true;
edit_width = 10;
key = ”*c1”;
}
}
ok_cancel;
}”
fn)
(close fn)
(setq dcl_id (load_dialog fname))
(new_dialog “cn3” dcl_id)
(set_tile “*str” $str)
(set_tile “*s1” $s1)
(set_tile “*n1” n_1)
(set_tile “*c1” $c_1)
(action_tile “*str” “(setq $str $value)”)
(action_tile “*s1” “(setq $s1 $value)”)
(action_tile “*n1” “(setq n_1 $value)”)
(action_tile “*c1” “(setq $c_1 $value)”)
(action_tile “accept” “(done_dialog 1)”)
(action_tile “cancel” “(setq ccl nil)(done_dialog 0)”)
(start_dialog)
(vl-file-delete fname)
)
위 리습은
이미 입력되어있는 문자를 클릭하면
이런창이 뜨며
앞글자 + 숫자 형태로 변형이 되는 리습인데
숫자 주변으로 테두리 ( 타원 혹은 사각형)을 입힐수 없을까요?
가능하다면 추가적으로
이미 입력되어있는 문자를 클릭해서 변경하는 방식보단
새로이 입력해서 넣는방식이 좀더 편하지 않을까 싶은데
변경 가능하려나요?
출처 – 고캐드