- (defun c:tbsy(/ k pt1 pt2 pt3 pt4 pt5 pt6 pt7 t1 t2 P4 pt1_mid )
- (princ "【欢迎使用,程序命令为:tbsy】")
- (setq oldcmdecho (getvar "cmdecho"))
- (setq oldosmode (getvar "osmode"))
- (setq AA (getvar "clayer"))
- (setvar "cmdecho" 0)
- (setvar "osmode" 0)
- (command "layer" "m" "文字" "c" "3" "" "lt" "CONTINUOUS" "" "");文字图层
- (setq pt1 (getpoint "\n索引区域中心点位置:"))
- (setq pt2 (getpoint pt1 "\n索引线转折点:"))
- (command "line" "non" pt1 pt2 "")
- (setVar "OrthoMode" 1)
- (setq pt5 (getpoint pt2 "\n索引符号方位:"))
- (setq k (angle pt2 pt5))
- (setq pt3 (polar pt2 k 2200))
- (setq pt4 (polar pt3 k 1000))
- (command "line" "non" pt2 pt4 "")
- (command "circle" "2p" "non" pt3 "non" pt4)
- (setq pt1_mid (mid_pt pt2 pt3)
- p4 (polar pt1_mid (* 0.5 pi) 100) ;;文字起点
- )
- (setq str "TB2012-1")
- (command "-text" "j" "c" p4 300 0 str)
- (setq t1 (getstring "\n索引代号:"))
- (setq t2 (getstring "\n索引图集页码:"))
- (setq pt6 (mid_pt pt3 pt4))
- (setq pt7 (polar pt6 (* pi 0.5) 200))
- (command "-text" "j" "m" pt7 350 0 t1)
- (setq pt7 (polar pt6 (* pi -0.5) 210))
- (command "-text" "j" "m" pt7 350 0 t2)
- (setvar "cmdecho" oldcmdecho)
- (setvar "osmode" oldosmode)
- (setvar "PLINEWID" 0)
- (setvar "AUTOSNAP" 61)
- (setvar "clayer" AA)
- (print)
- )
- (defun mid_pt (a b)
- (mapcar
- '(lambda (a b) (/ (+ a b) 2))
- a
- b
- )
- )
|