-
- (load "xyp_lib.vlx") ;版本 V.20060210
- ;|下载和加载通用函数(可在签名栏直接下载后放到搜索路径下)
- 利用以下任何一种方式(首选第一种)即可加载和运行通用函数内的所有子程序:
- ★1·在acad.lsp中增加(load"xyp_lib")
- ■2·在每个程序内增加(load"xyp_lib")
- ■3·在command下,输入(load"xyp_lib")
- ■4·在菜单.mnl中增加(load"xyp_lib")
- ■5·将xyp_lib.vlx文件直接拽到cad屏幕
- [COLOR=red] ★通用函数下载地址:[/COLOR]
- [url]http://bbs.mjtd.com/forum.php?mod=viewthread&tid=37554[/url]
- |;
- ;;;平行线之距离
- (defun c:test ()
- (CMDLA0)
- (setq s1 (car (USEL 0 "LINE" "LINE线"))
- s2 (car (USEL 0 "LINE" "LINE线"))
- ang (abs (- (xyp-get-AngleAtPoint s1 (xyp-get-dxf 10 s1))
- (xyp-get-AngleAtPoint s2 (xyp-get-dxf 10 s2))
- )
- )
- )
- (while (>= ang pi)
- (setq ang (- ang pi))
- )
- (if (< (abs ang) 0.00000001)
- (progn
- (setq pt1 (xyp-get-dxf 10 s1)
- pt2 (xyp-get-FaxianAtPoint s1 pt1 100)
- pt3 (xyp-get-dxf 10 s2)
- pt4 (xyp-get-dxf 11 s2)
- pt22 (inters pt1 pt2 pt3 pt4 nil)
- dist (distance pt1 pt22)
- )
- (princ "\n两平行线距离 = ")
- (princ dist)
- )
- (princ "\n两线不平行!")
- )
- (CMDLA1)
- )
|