- (load "xyp_lib")
- ;|加载通用函数
- 如果已经下载xyp_lib并放到搜索路径下可以不再下载!
- 利用以下任何一种方式即可加载和运行通用函数内的所有子程序:
- 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屏幕
- 通用函数下载地址:
- http://bbs.mjtd.com/forum.php?mod=viewthread&tid=37554|;
- ;;;线开口
- (defun c:test040 (/ pt1 pt2 pt3 sss nnn e leng df s1)
- (CMDLA0)
- (setvar "osmode" 0)
- (setq pt1 (getvar "VSMIN")
- pt2 (getvar "VSMax")
- pt3 (_MIDP pt1 pt2)
- SSS (ssget '((0 . "CIRCLE,ELLIPSE,*LINE,ARC")))
- NO1 (UDIST 1 "" "\n\t线长" NO1 pt3)
- NO2 (UDIST 1 "" "\n\t缺口长" NO2 pt3)
- nnn -1
- )
- (while (setq e (ssname sss (setq nnn (1+ nnn))))
- (setq leng (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e))
- df (fix (abs (/ leng (+ NO1 no2))))
- )
- (repeat df
- (setq pt1 (vlax-curve-getPointAtDist
- (vlax-ename->vla-object e)
- no1
- )
- pt2 (vlax-curve-getPointAtDist
- (vlax-ename->vla-object e)
- (+ no1 no2)
- )
- )
- (command "break" e pt1 pt2)
- (command "select" "l" "")
- (setq s1 (ssget "p")
- e (ssname s1 0)
- )
- )
- )
- (CMDLA1)
- )
|