用简单lisp程序编制

用简单lisp程序编制,第1张

(defun c:zfx(/ A ANG p1 p2 p3 p4 p5 os cmd)

(SETQ CMD (GETVAR "cmdecho"))

(SETVAR "cmdecho" 0)

(setq os (getvar "osmode"))

(setq A (getreal"\n:输入边长"))

(setq ANG (getreal"\n:输入角度"))

setq r (getreal"\n:输入半径指乎滚"))

(setq p1 (getpoint"\n:指定起点"))

(setvar "顷缺osmode" 0)

(setq p2 (polar p1 (* pi (/ ANG 180)) A))

(setq p3 (polar p2 (* pi (+ 0.5 (/ ANG 180))) A))

(setq p4 (polar p1 (* pi (+ 0.5 (/ ANG 180))) A))

(command "pline" p1 p2 p3 p4 "c")

(SETQ p5 (polar p1 (+ (* pi (/唯余 ANG 180)) (* 0.25 pi)) (* A (sin (/ pi 4)))))

(command "circle" p5 r)

(setvar "osmode" os)

(SETVAR "cmdecho" CMD)

(PRINC)

)

这个还是不好做到的。空禅裂

你可以用ssget 和斗闭 vl-string-subst这两个函数试试 ,不过,vl-string-subst 中提到只能替换第一个你要变通,才能替换字符串中袭旁的所有。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12320483.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存