iCAx开思网
标题:
来写个小LISP
[打印本页]
作者:
bytanjian
时间:
2006-10-16 23:20
标题:
来写个小LISP
看上去简单,做起来麻烦.一般做法先延长,再测量AB长度,再使DE与之相等,这样做需要测量,如果精度不够还会导致长度不一致.我想直接用一个命令将它做完.比如,选取直线DE,再选取直线BC,然后就完成工作了.有没有高手编个LISP呀?
作者:
xubojian
时间:
2006-10-17 08:20
你要写这个程序,跟复制直线AB到C点有什么区别?
作者:
Andyes
时间:
2006-10-17 16:47
(defun dxf (code elist)
(cdr (assoc code elist))
)
;;; No error check
;;; for test only
(defun c:yzby ()
(setq OsM (GetVar "OsMode"))
(SetVar "OsMode" 0)
(cond
((not (setq e1 (entsel "\n選線一: "))))
(T
(while (not (setq e2 (entsel "\n選線二: "))))
(setq e1 (car e1)
e2 (car e2)
dat (entget e1)
p1 (dxf 10 dat)
p2 (dxf 11 dat)
dat (entget e2)
p3 (dxf 10 dat)
p4 (dxf 11 dat)
px (inters p1 p2 p3 p4 nil)
)
(if (> (distance p1 px) (distance p2 px))
(command "move" e1 "" p2 px)
(command "move" e1 "" p1 px)
)))
(SetVar "OsMode" OsM)
(princ)
)
(princ "\nPress YZBY to start ...")
(princ)
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3