本帖最后由 ★飞飛★ 于 2014-10-21 20:09 编辑
- ;;------------------------------------------------------------------
- (defun c:yy () ;;画引线(文字在引线端头),★飞飛★ 2012.7.15编写
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "\n引线起点:")
- pt2 (getpoint pt1 "\n下一点:")
- pt3 (getpoint pt2 "\n终点:"))
- (command "-layer" "m" "DIM" "c" "1" "" "" )
- (command "Leader" pt1 pt2 pt3 "a" "" "n" );;;绘引线
- (setq wz (getstring "\n请输入标注文字:"))
- (setvar 'osmode 0)
- (setq zg (* 3 (getvar "dimscale")))
- (command "-style" "hztxt" "hzasc.shx,hztxt.shx" 0 0.7 0 "" "" "")
- (command "-layer" "m" "TEXT" "c" "7" "" "" )
- (command "text" pt3 zg "0" wz)
- (if (> (car pt3) (car pt2))
- (progn
- (command "justifytext" (entlast) "" "ML" )
- (setq ss (cdr (assoc 11 (entget (entlast)))))
- (command "move" (entlast) "" ss pt3 )
- (setq ss1 (polar pt3 0 (* zg 0.2))) )
- (progn
- (command "justifytext" (entlast) "" "MR" )
- (setq ss (cdr (assoc 11 (entget (entlast)))))
- (command "move" (entlast) "" ss pt3 )
- (setq ss1 (polar pt3 pi (* zg 0.2))) )
- )
- (command "move" (entlast) "" pt3 ss1 )
- (setvar 'osmode 6907)
- (setvar "cmdecho" 1)
- (princ)
- )
|