(defun c:name(/ pt pt1 p1 p2 yy mm dd s text1 osd layer_old rr)9 Z' ~9 B+ @3 C/ j$ c$ o' G
(setq osd (getvar "osmode"))
( z1 Y% k/ c: `7 | (setq pt0 '(142.0 5.0))6 Y l8 \& ~' _! J
(initget 128)
' m4 G: x3 Y; U9 F% w! D8 Q (setq pt (getpoint "\n请选取签名插入点"))4 y3 x0 n0 D5 G, M
(if (= pt nil)# A& k6 O$ y" v! q( f) [7 Y$ z
(setq pt pt0)6 ?, I' B7 G1 B3 ~7 O8 B
)
: Q. g% k* S8 n8 u$ R6 ? E (setq pt1 (polar pt (/ pi 6) 35))
6 d/ x% e- a" G' q& B( \ (setq pt2 (polar pt1 (/ pi 8) 3))* p0 s6 ?8 a$ M
(setq sse (ssget "_c" pt1 pt2)) ; B& O+ B2 O" G7 M m
(command "erase" sse "")
7 S! I2 G! a" m, M/ V, x
5 [( H, s0 G# i4 a (command "insert" "n1" pt "" "" ""); v0 p3 t& Y" T+ ?4 \
(setq s (getvar "cdate"))( ?. S4 z$ F& T5 g |& D7 ]! n v
(setq rr (- (* s 100000000) (fix (* s 100000000))))* e% U9 g# {. o5 I4 Y5 M+ Q
(setq yy (fix (/ s 10000)))( k* l& t) g* ?/ d d
(setq mm (fix (/ (- s (* yy 10000)) 100)))! k1 D- x& @& O
(setq dd (fix (/ (- s (* (fix (/ s 100)) 100)))))$ d* j* q C) l, K+ \. P
(setq text1 (strcat (rtos yy) "/" (rtos mm) "/" (rtos dd)))8 H2 ]) K7 j3 f: N$ Y# {& K
(setq p1 (polar pt (* 41 (/ pi 180.0)) 44.0))
6 h2 H4 F$ e. E- ~2 | (setq p2 (polar pt (* 0 (/ pi 180.0)) (+ 50.0 rr)))5 W( J3 T4 D* m
(command "style" "txt" "txt.shx,gbcbig.shx" "" 0.85 "" "" "" "")
: \2 v6 o1 @/ _8 u7 b* u1 r6 P (setq layer_old (getvar "clayer"))% s, \0 c: t. p# r6 S. d. s, D
(setvar "clayer" "text")
7 Y0 ~0 e6 g: @/ S7 M8 k1 k! p (setvar "osmode" 0)
" \' H7 q1 i: k2 p& f1 T (command "text" p1 2 0 text1)! d, I% {1 G; E- o
(setvar "cecolor" "40")7 y; Z m6 K* f B" f* f
(command "point" p2)
s I3 L: v4 x& K4 j: [ (setvar "cecolor" "bylayer")) L$ ]0 L; a6 P, G
(setvar "clayer" layer_old)
6 s" p7 \. A8 F! Z7 u0 { (setvar "osmode" osd)' {+ M! D9 a, Y. d8 S/ X
(princ)- g [0 z2 n+ B, D( l. ]/ D
) |