本帖最后由 Comming 于 2015-1-17 21:18 编辑
lengxiaxi 发表于 2014-11-29 12:03 
嗯,可以用了。我此前也转发过你这个lsp,请版主修改了。效果和你这个一样。引脚如果能改为箭头就完美了。 ...
引脚改为箭头了,你用一下,看看还有什么问题需要改进!在我能力之内会帮你解决。 - (defun c:xhq (/ gj tx yq os)
- (setq os (getvar "osmode"))
- (setvar "cmdecho" 0)
- (setq tx (getint "\n起始值<1>:"))
- (if (= tx nil)
- (setq tx 1)
- )
- (setq yq (getdist "\n文字高度:"))
- (if (= yq nil)
- (setq yq 5)
- )
- (initget "p")
- (setq gj (getkword "\n[设置递增/递减(P)]<递增>:"))
- (cond ((= gj nil) (dz))
- ((= gj "p") (dj)))
- (princ)
- (setvar "osmode" os)
- )
- (defun dz ()
- (while (>= tx tx)
- (yx)
- (setq tx (1+ tx))
- )
- )
- (defun dj ()
- (while (<= tx tx)
- (yx)
- (setq tx (1- tx))
- )
- )
- (defun yx ()
- (setvar "osmode" 512)
- (setq apt (getpoint "\n引线起点:"))
- (command "leader"apt(setq bpt (getpoint apt "\n引线终点:"))"""""n")
- (setq ang (angle apt bpt))
- (setvar "osmode" 0)
- (command "circle" "2p" bpt (polar bpt ang (* 2.5 yq)))
- (setq cir entlast)
- (setq cirdata (cdr (assoc 10 (entget (cir)))))
- (command "text" "j" "mc" cirdata yq "" tx)
- )
|