怎么完善 序号球 程序
程序是一个标序号球的LSP,目前问题是:设置半径增大时,球标内文字没有一起变大以下源码:
(defun c:xh ()
(setvar "cmdecho" 0) ;命令回显
(setq tx (getint "\n起始数字:"))
(if (= tx nil)(setq tx 1))
(setq yq (getdist "\n序号球直径:"))
(if (= yq nil)(setq yq 5))
(while
(setq os (getvar "osmode"));系统变量
(setq po (getpoint "\n引线起点:"))
(setvar "osmode" 0);设置系统变量
(command "line" po pause "")
(setq pt (cadr (grread pause)))
(setq ang (angle po pt))
(command "circle" "2p" pt (polar pt ang yq) "")
(setq cir entlast)
(setq cirdata (cdr (assoc 10 (entget (cir)))))
(command "text" "j" "m" cirdata "" "" tx "")
(setq tx (1+ tx))
(setvar "osmode" os)
)
)
如何修改??
(defun c:xh ( / os tx yq po pt ang cir cirdata )
(setq os (getvar "osmode"));系统变量
(setvar "cmdecho" 0) ;命令回显
(setq tx (getint "\n 序号起始数字(1):"))
(if (= tx nil)(setq tx 1))
(setq yq (getdist "\n序号球直径(5):"))
(if (= yq nil)(setq yq 5))
(while (setq po (getpoint "\n引线起点:"))
(command "line" po pause "")
(setq pt (cadr (grread pause)))
(setq ang (angle po pt))
(command "circle" "2p" pt (polar pt ang yq))
(setq cir entlast)
(setq cirdata (cdr (assoc 10 (entget (cir)))))
(command "text" "j" "m" cirdata "" "" tx)
(setq tx (1+ tx))
)
(setvar "osmode" os)
(princ)
) 很好,谢谢! wzg356 发表于 2014-11-18 23:25 static/image/common/back.gif
不行,没有效果,直径变化时 ,文字依然没有变化 本帖最后由 ZZXXQQ 于 2014-11-21 07:52 编辑
(defun c:xh ( / os tx yq high po pc)
(setq os (getvar "osmode"));系统变量
(setvar "cmdecho" 0) ;命令回显
(setq tx (getint "\n 序号起始数字(1):"))
(if (= tx nil)(setq tx 1))
(setq yq (getdist "\n序号球直径(5):"))
(if (= yq nil)(setq yq 5))
(setq high (* yq 1.5))
(while (and (setq po (getpoint "\n引线起点: "))
(setq pc (getpoint po "\n引线终点: ")))
(setq pe (polar pc (angle pc po) yq))
(command "line" po pe "" "circle" pc yq)
(command "text" "m" pc high "" (itoa tx))
(setq tx (1+ tx))
)
(setvar "osmode" os)
(setvar "CMDECHO" 1)
(princ)
) ZZXXQQ 发表于 2014-11-19 21:31 static/image/common/back.gif
命令: ; 错误: 输入的列表有缺陷 不能正常运行 运行环境 autocad 2004 lengxiaxi 发表于 2014-11-20 22:09 static/image/common/back.gif
命令: ; 错误: 输入的列表有缺陷 不能正常运行 运行环境 autocad 2004
改的很棒!已达到预期效果!谢谢Z版!
Z版如果有空的话,能否帮忙看看我的另外一个帖子 http://bbs.mjtd.com/thread-112101-3-1.html 有热心人回复晓东有个类似的lsp,但是我试了下,应该是需要加载晓东api的,您能帮我写个独立的lsp吗?我想很多做钣金的人也需要这样一个lsp提高绘图速度。 lengxiaxi 发表于 2014-11-21 19:49
改的很棒!已达到预期效果!谢谢Z版!
Z版如果有空的话,能否帮忙看看我的另外一个帖子 http://bbs.mj ...
人心不足蛇吞象啊! highflybird2014 发表于 2014-11-21 20:36 static/image/common/back.gif
人心不足蛇吞象啊!
我这个‘不足’,不为金钱,不为名利,只为画好图,您说这过分不? lengxiaxi 发表于 2014-11-22 10:15 static/image/common/back.gif
我这个‘不足’,不为金钱,不为名利,只为画好图,您说这过分不?
亲,我的帖子多数是请人修改的,不单单是来求写的。
另外一点,明经最大的特点就是分享精神! 我虽然只能提供不完美的源码,但是经过大家的帮助后,变得完善,然后可以给更多的人搜索到,并下载应用,你说这不也是一个好事吗?并不是所有的欲望都是不好的,求知与分享不也是一种欲望吗?与其在这里评论是与非,不如把这点时间留出来多帮助下别人。对吗?
页:
[1]