编写autolisp程序并通过visual lisp集成开发环境调试该程序
问题描述:
编写autolisp程序并通过visual lisp集成开发环境调试该程序
:程序文件名为drawing.lsp,程序中定义了函数drawing,用于根据用户指定的圆心位置和半径绘一个基圆和与该圆同心的另外三个圆,这三个圆的半径依次是与其相邻的前一个圆半径的1.2倍.
答
(defun c:drawing()
(setvar "cmdecho" 0)
(setq ptcenter (getpoint "\n请输入圆心位置:"))
(setq dist(getdist "\n请输入基圆半径:"))
(command "_circle" ptcenter dist)
(command "_circle" ptcenter (* dist 1.2) )
(command "_circle" ptcenter (* dist 1.2 1.2) )
(command "_circle" ptcenter (* dist 1.2 1.2 1.2) )
(princ)
)
再保存为drawing.lsp就OK了...