看看这个autolisp画图有什么错误,为什么就出不来图
发布网友
发布时间:2024-10-02 21:17
我来回答
共1个回答
热心网友
时间:2024-10-02 21:45
你写的点代码是【P0】,下面把这个写成【PO】,所以不能够使用。另外绘制的时候,关闭捕捉
(defun C:tes ( / cp1 cp2 p0 p1 p10 p11 p12 p13 p2 p3 p4 p5 p6 p7 p8 p9)
(setq #os1 (getvar "osmode"));得到捕捉设置
(setq p0 (getpoint "\n361起点:"))
(setq cp1 (getdist p0 "\n3字半径:"))
(setq cp2 (getdist p0 "\n小圈半径:"))
(setq p1 (polar p0 pi cp1))
(setq p2 (polar p0 0 cp1))
(setq p3 (polar p0 (/ pi 2) cp1))
(setq p4 (polar p2 (/ pi 2) (* cp1 2)))
(setq p5 (polar p1 (/ pi 2) (* cp1 2)))
(setq p6 (polar p0 0 (* cp1 3)))
(setq p7 (polar p0 0 (* cp1 2)))
(setq p8 (polar p7 (/ pi 2) (* cp1 2)))
(setq p9 (polar p6 (/ pi 2) (* cp1 3)))
(setq p10 (polar p8 0 (* cp1 2)))
(setq p11 (polar p9 0 (* cp1 3)))
(setq p12 (polar p11 (/ pi -2) (* cp1 4)))
(setq p13 (polar p11 0 cp1))
(setvar "osmode" 0);关闭捕捉
(command "arc" p5 p4 p3 "")
(command "arc" p3 p2 p1 "")
(command "arc" p10 p9 p8 "")
(command "line" p8 p7 "")
(command "line" p11 p12 "")
(command "circle" p6 cp1)
(command "circle" p13 cp2)
(setvar "osmode" #os1);还原捕捉
(prin1)
)