编写一个AutoLISP程序,从p1到p2点画一条直线。直线p1p2与正x轴夹角为A,p1点与p2点间的距离L,在p1 p2及 5
编写一个AutoLISP程序,从p1到p2点画一条直线。直线p1p2与正x轴夹角为A,p1点与p2点间的距离L,在p1p2及其中点分别画一个园,圆直径为D1(D1=L/4...
编写一个AutoLISP程序,从p1到p2点画一条直线。直线p1p2与正x轴夹角为A,p1点与p2点间的距离L,在p1 p2及其中点分别画一个园,圆直径为D1(D1=L/4)。要求提示输入:p1 L A。
展开
2个回答
展开全部
(defun c:drl ( / cm os p1 p2 l a )
(setq cm (getvar "cmdehco"))
(setq os (getvar "osmode"))
(setq p1 (getpoint "\n请选择基点:"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq l (getdist p1 "\n请输入长度: "))
(setq a (getangle p1 "\n请输入角度: "))
(setq p2 (polar p1 a l))
(command "_.Line" p1 p2 "" "_.Circle" p1 (/ l 4.0) "_.Circle" p2 (/ l 4.0))
(command "_.Circle" (polar p1 a (/ l 2.0)) (/ l 4.0))
(command "_.Osmode" os "_.Cmdecho" cm)
(princ)
)
(setq cm (getvar "cmdehco"))
(setq os (getvar "osmode"))
(setq p1 (getpoint "\n请选择基点:"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq l (getdist p1 "\n请输入长度: "))
(setq a (getangle p1 "\n请输入角度: "))
(setq p2 (polar p1 a l))
(command "_.Line" p1 p2 "" "_.Circle" p1 (/ l 4.0) "_.Circle" p2 (/ l 4.0))
(command "_.Circle" (polar p1 a (/ l 2.0)) (/ l 4.0))
(command "_.Osmode" os "_.Cmdecho" cm)
(princ)
)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
才5分...
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询