发布于:2008-05-19 09:37:19
来自:建筑设计/CAD下载及教程
[复制转发]
AutoLISP中调用offset命令出现的问题,我想用下面的程序画三条平行多段线,可是运行时大部分不成功,结果只有两条多段线,为什么?怎么解决????急急急急急急请高手帮忙!!!!
(defun c:sanxian()
(setq os (getvar "osmode"))
(setq p1 (getpoint "输入第一点:"))
(setq p3(getpoint "输入下一点:"))
(setq p2 p3)
(command "pline" p1 p2)
(while (/= p2 nil)
(setq p2 (getpoint "输入下一点:"))
(command p2)
)
(setq a (angle p1 p3))
(setq pt1 (polar p1 (+(/ pi 2) a) 0.4))
(setq pt2 (polar p1 (+(/ pi 2) a) -0.4))
(setvar "osmode" 0)
(command "offset" 0.4 p1 pt1 "")
(command "offset" 0.4 p1 pt2 "")
)
全部回复(1 )
只看楼主 我来说两句 抢板凳(setq os (getvar "osmode"))
(setq p1 (getpoint "输入第一点:"))
(setq p3(getpoint "输入下一点:"))
(setq p2 p3)
(command "pline" p1 p2)
(while (/= p2 nil)
(setq p2 (getpoint "输入下一点:"))
(command p2)
)
(setq a (angle p1 p3))
(setq pt1 (polar p1 (+(/ pi 2.0) a) 0.4))
(setq pt2 (polar p1 (+(/ pi 2.0) a) -0.4))
(setvar "osmode" 0)
(setq en (entlast))
(command "offset" 0.4 en p1 en pt1 "") ;这里改下
;(command "offset" 0.4 p1 pt2 "")
)
回复 举报