(defun c:横断符号( / aaa te bbb ts ccc ttt ) (princ "\n插入横断符号 ") (setvar "cmdecho" 0) (setvar "ORTHOMODE" 1) (setq ttt (strcase (getstring "\n指定标号(A) : "))) (if (= ttt "")(setq ttt "A")) (princ "\n指定位置及方向") (command "insert" "横断符号" "non" pause 1 1 pause) (setq aaa (entlast)) (command "line" "non" '(0 0) "non" '(0 1) "") (setq te (setq bbb (entlast))) (command "explode" (list aaa '(0 0))) (setq ts (ssadd)) (while (setq te (entnext te)) (setq ts (ssadd te ts)) ) (command "select" ts "") (setq ccc (ssget "p" '((0 . "TEXT")))) (entmod (subst (cons 50 0)(assoc 50 (entget (ssname ccc 0))) (entget (ssname ccc 0)))) (entmod (subst (cons 1 ttt)(assoc 1 (entget (ssname ccc 0))) (entget (ssname ccc 0)))) (entmod (subst (cons 50 0)(assoc 50 (entget (ssname ccc 1))) (entget (ssname ccc 1)))) (entmod (subst (cons 1 ttt)(assoc 1 (entget (ssname ccc 1))) (entget (ssname ccc 1)))) (command "erase" bbb "") (princ) )
发一个以前随手编的程序
基本可以满足你的需要
参考附件的模式按你的需求定义块
将这个程序的插入块名改成你的块名
再将程序名改成好记的即可 |