将这两个编号lisp例程结合起来会很困难吗?我想画一个多边形周围的数字和TXT。我已经能够想出如何编辑这些,但运气不好,并结合这些功能。
- ; inserts increasing numbers inside polygon
- (defun c:iwn (/ p n ni ts oecho ds th txt na)
- (if (= 0 (getvar "dimscale"))(setq ds 1.0)(setq ds (getvar "dimscale")))
- (setq th (getvar "dimtxt"))
- (setq txt (* th ds))
- (setq ts txt)
- (if nn (setq nn (fix nn))(setq nn 1))
- (if (= nn 0)(setq nn 1))
- (princ "\n Increment by < ")
- (princ nn)
- (princ " >? : ")
- (setq ni (getint))
- (if (= ni nil)(setq ni nn)(setq nn ni))
- (if np
- ()
- (setq np 1)
- )
- (princ "\n Start or continue with number < ")
- (princ np)
- (princ " >? : ")
- (setq n (getint))
- (if (= n nil)
- (setq n np)
- (setq np n)
- )
- (setq p (getpoint "\n Number location: "))
- (setq oecho (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (while p
- (setq na (itoa n))
- (entmake (list (cons 0 "TEXT")
- (cons 10 p)
- (cons 11 p)
- (cons 1 na); actual text
- (cons 7 (getvar "TEXTSTYLE"))
- (cons 40 txt)
- (cons 72 4)
- )
- )
- (if (> n 99)
- (command "polygon" "5" p "c" (* ts 1.4)) ; edit for number of polygon sides
- (command "polygon" "5" p "c" (* ts 1.4))) ; edit for number of polygon sides
- (setq p (getpoint "\n Next number location: ")
- n (+ ni n)
- np n
- )
- )
- (setvar "cmdecho" oecho)
- (princ)
- )
- (princ "\n Type > iwn < to insert numbers inside hexagon")
第二个允许前缀和后缀TXT。
|