本帖最后由 zhuquanmao 于 2012-4-9 00:33 编辑
- (defun c:TT ( / ang bhx osm pt1 pt2 pt3 qzx r rx tt)
- (setq osm (getvar "osmode"))
- (setvar "cmdecho" 0)
- (if (null rr)
- (setq rr (getvar "circlerad"))
- )
- (initget (+ 2 4))
- (setq rx (getreal (strcat "\n请输入标号圆半径 < " (rtos rr) ">:")))
- (if (null rx)
- (setq r rr)
- (setq r rx)
- )
- (if (= bh nil)
- (progn
- (initget (+ 2 4))
- (setq bh (getint "\n输入起始号<1>:"))
- (if (= nil bh)
- (setq bh 1)
- )
- )
- (progn
- (setq bhx (getint (strcat "\n输入起始号<" (itoa bh) ">:")))
- (if (= bhx nil)
- (setq bh bh)
- (setq bh bhx)
- )
- )
- )
- (if (null qz)
- (setq qz (getstring "\n前缀<无>:"))
- (progn
- (setq qzx (getstring (strcat "\n前缀<" qz ">:")))
- (if (= qzx "")
- (setq qz qz)
- (setq qz qzx)
- )
- )
- )
- (setq tt 0)
- (while (= tt 0)
- (setq pt1 (getpoint "\n请输入第一点: "))
- (if pt1
- (progn
- (setq pt2 (getpoint pt1 "\n请输入第二点: "))
- (if pt2
- (progn
- (setvar "osmode" 0)
- (command "_.line" pt1 pt2 "")
- (setq ang (angle pt1 pt2))
- (setq pt3 (polar pt2 ang r))
- (command "circle" pt3 r)
- (command "text" "mc" pt3 r 0 (strcat qz (itoa bh)))
- (setq bh (1+ bh))
- (setvar "osmode" OSM)
- (setq tt 0)
- )
- (setq tt 1)
- )
- (setq tt 0)
- )
- (setq tt 1)
- )
- )
- (setq rr r)
- (setvar "cmdecho" osm)
- (prin1)
- )
|