(defun c:name(/ pt pt1 p1 p2 yy mm dd s text1 osd layer_old rr); C3 Z+ `1 `* V2 ~1 j
(setq osd (getvar "osmode"))
& _2 V+ m6 _2 G4 A# m: O (setq pt0 '(142.0 5.0))' ^' ]0 Q6 G8 ^& z
(initget 128) w; x7 i5 v1 M- d' E) x
(setq pt (getpoint "\n请选取签名插入点"))
5 L) f$ v- l- e7 t0 i (if (= pt nil)$ \% l( U2 n. ^, \; J, l
(setq pt pt0)
1 } u8 U5 t7 q9 K3 m. A )
2 z# j; a% Q& v% C4 J2 n' s (setq pt1 (polar pt (/ pi 6) 35))
2 r3 I. ?: l/ D (setq pt2 (polar pt1 (/ pi 8) 3))
" [1 m J$ T, ? n' } (setq sse (ssget "_c" pt1 pt2)) : T3 v. J L2 s- X
(command "erase" sse "")
5 e: l3 e( w I# k, \5 k# w0 M& P# W+ U
(command "insert" "n1" pt "" "" "")
4 V( d/ H6 B, P0 }0 t (setq s (getvar "cdate"))( }/ E9 L' b) P/ O6 ?& K
(setq rr (- (* s 100000000) (fix (* s 100000000))))
` ?: _% f: @, g: C (setq yy (fix (/ s 10000)))' N P ^) M5 c" X# o; d
(setq mm (fix (/ (- s (* yy 10000)) 100)))
# Y: x. W* F' m4 K8 s" T. S* Q0 _ (setq dd (fix (/ (- s (* (fix (/ s 100)) 100)))))
+ l/ K- i+ k o+ b (setq text1 (strcat (rtos yy) "/" (rtos mm) "/" (rtos dd)))
0 z% w" Q6 O k5 r8 v6 M+ u) B6 I' O (setq p1 (polar pt (* 41 (/ pi 180.0)) 44.0))
/ j( y; ^: B# A (setq p2 (polar pt (* 0 (/ pi 180.0)) (+ 50.0 rr)))5 n4 b2 q$ h0 z. U8 N: q
(command "style" "txt" "txt.shx,gbcbig.shx" "" 0.85 "" "" "" "")0 W8 a, _/ w' d6 A4 N, R, r
(setq layer_old (getvar "clayer"))
. u/ @. p+ b: \' c8 z9 ^7 I e (setvar "clayer" "text")+ ]! e8 }3 \! E9 ^0 f
(setvar "osmode" 0)
4 l/ V% H; q* r5 d5 W: j: [ (command "text" p1 2 0 text1)
) Y4 W5 b l- j- \6 D (setvar "cecolor" "40")
( w& G8 c' U" O; m. X. e* a3 f, d* w (command "point" p2)
# N; Z! j* z: N* _ (setvar "cecolor" "bylayer")
" x8 ]: y- f% h/ |( U# g6 E2 I (setvar "clayer" layer_old)
# F% u; D" z% \& F, U0 T (setvar "osmode" osd)
; t/ t3 \# h2 L9 p( Y2 V2 L. k (princ)8 G) K6 V. V+ n/ Z
) |