找回密码
 [加入论坛]
查看: 1464|回复: 0

[LISP函数]:一个很好用的画截断线的LISP

[复制链接]
2443725 发表于 2004-7-1 04:24 | 显示全部楼层 |阅读模式

<>一个很好用的画截断线的LISP
(defun c:JDX ()
(setq oldos (getvar "osmode"))
(setq oldpk (getvar "pickbox"))
(setvar "pickbox" 0)
(setvar "osmode" 0)
(setq scal1 (getreal "\nenter the relative &lt;12&gt;:"))
(if (= scal1 nil) (setq scal1 12))
(setq XY1 (getpoint "\nfirst point:"))
(setq XY2 (getpoint XY1 "\nsecnod point:"))
(brkli scal1 XY1 XY2)
(setvar "pickbox" oldpk)
(setvar "osmode" oldos)
)
(defun brkli (scal1 XY1 XY2)
(setq a (angle XY1 XY2))
(setq d (distance XY1 XY2))
(setq XY3 (polar XY1 a (/ d 2)))
(setq XY4 (polar XY3 (- a (* 4 (/ pi 4))) (* (/ d scal1) 1 )))
(setq XY5 (polar XY3 (+ a (* 3 (/ pi 4))) (* (/ d scal1) 1.414)))
(setq XY6 (polar XY3 (- a (* 1 (/ pi 4))) (* (/ d scal1) 1.414)))
(setq XY7 (polar XY3 (- a (* 0 (/ pi 4))) (* (/ d scal1) 1 )))
(command "pline" XY1 "w" "0" "0" XY4 XY5 XY6 XY7 XY2 "")
(setvar "pickbox" oldpk)
(setvar "osmode" oldos)
)  </P>
您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

手机版|化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

GMT+8, 2026-12-1 17:21

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表