 - (defun t_ins (p1 s h / ent)
- (setq ent '((67 . 0)(0 . "TEXT"))
- ent (cons (cons 40 h) ent)
- ent (cons (cons 1 s) ent)
- ent (cons (cons 10 p1) ent)
- ent (reverse ent)
- )
- (entmake ent)
- )
- (defun c:test1()
- (command "-layer" "n" "pntext" "s""pntext""")
- (setq Kuan (getreal "\n请输入冲针宽度增加量(0.1):")
- Chang (getreal "\n请输入冲针长度增加量(0.1):")
- Hao (getreal "\n请输入起始符号的整数(1):"))
- (if (= Kuan nil) (setq Kuan "0.1"))
- (if (= Chang nil) (setq Chang "0.1"))
- (if (= Hao nil) (setq Hao "1"))
- (setq p (getpoint "\n请确定报表输出位置:"))
- (setq p (trans p 1 0))
- (setq sd (ssget "X" (list(cons 8 "PN1"))))
- (setq kx (ssget "X" (list(cons 8 "PN2"))))
- (setq a (sslength sd))
- (setq a0 (cdr (assoc 10 (entget (ssname sd 0))))
- a1 (cdr (assoc 1 (entget (ssname kx 0)))))
- (setq k1 (substr a1 1 4)
- k2 (substr a1 6 4)
- kk1 (substr a1 10 4)
- kk2 (substr a1 15 2)
- kk3 (substr a1 17)
- k3 (rtos (+ (read k1) (read kuan)) 2 2)
- k4 (rtos (+ (read k1) (read chang)) 2 2))
- (setq es (strcat Hao " " k1 " * " k2 kk1 kk2 " " k3 " * " k4 " " "" " " "(" kk3 ")"))
- (t_ins (mapcar '+ p '(-2.0 5.0 0.0)) "符号 尺 寸 形状 冲 针 数量" 2.5)
- (t_ins (mapcar '+ p '(0.0 0.0 0.0)) es 2.3)
- )
求高手修改!!
|