- (defun c:tbsy()
- (princ "【欢迎使用,程序命令为(圈索引):tbsy】")
- (setq oldcmdecho (getvar "cmdecho"))
- (setq oldosmode (getvar "osmode"))
- (setvar "cmdecho" 0)
- (setvar "osmode" 16417)
- (command "layer" "m" "索引图层" "c" "7" "" "lt" "CONTINUOUS" "" "p" "n" "" "");索引图层
- (setq pt1 (getpoint "\n索引区域中心点位置:"))
- (setq pt2 (getpoint pt1 "\n索引线转折点:"))
- (command "line" pt1 pt2 "")
- (setq l_ast1 (entlast))
- (command "change" l_ast1 "" "p" "c" 3 "" )
- (setvar "ORTHOMODE" 1)
- (setq pt5 (getpoint pt2 "\n索引符号位置:"))
- (setq k (angle pt2 pt5))
- (setq pt3 (polar pt2 k 2200))
- (setq pt4 (polar pt3 k 100))
- (command "line" pt2 pt4 ""))
- (setq l_ast (entlast))
- (command "change" l_ast "" "p" "c" 3 "" )
- (setvar "ORTHOMODE" 0)
- (setq pt1_mid (mid_pt pt3 pt4))
- (command "circle" pt3 pt4)
- (setq l_ast (entlast))
- (command "change" l_ast "" "p" "c" 3 "" )
- (setq t1 (getstring "\n索引代号:"))
- (setq t2 (getstring "\n索引图纸编号:"))
- (command "style" "TSSD_Bold" "tssdeng2,china" "0" "1.0" "0" "" "" "")
- (command "-style" "TSSD_Bold" "" 0 1 0 "n" "n" "n")
- (setq pt7 (polar pt1_mid (* pi 0.5) 200))
- (command "-text" "j" "m" pt7 350 0 t1)
- (setq pt7 (polar pt1_mid (* pi -0.5) 210))
- (command "-text" "j" "m" pt7 350 0 t2)
- (setq pt1_mid (mid_pt pt2 pt3)
- p4 (polar pt1_mid (* 0.5 pi) 100) ;;文字起点
- )
- (setq str "TB2012-1")
- (command "text" "j" "c" "non" p4 300 0 str)
- (command "-style" "TSSD_Bold" "" 0 75 0 "n" "n" "n")
- (setvar "cmdecho" oldcmdecho)
- (setvar "osmode" oldosmode)
- (setvar "PLINEWID" 0)
- (setvar "AUTOSNAP" 61)
- (print)
- )
请帮忙看看怎么不对啊
|