- (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:test ()
- (cmdla0)
- (MKLA "时间曲线" 1)
- (while (not
- (setq tn (getfiled "数据文件(txt;dat;*)" "" "txt;dat;*" 2))
- )
- )
- (setq fle (findfile tn))
- (if (not fle)
- (setq fle (getfiled "请选择数据文件" "" "txt;dat;*" 8))
- )
- (if fle
- (progn
- (setq fn (open fle "r"))
- (command "pline")
- (while (setq pt (read-line fn))
- (setq time1 (atof (substr pt 1 2))
- time2 (/ (atof (substr pt 4 2)) 60.0)
- pt (list (+ time1 time2) (atof (substr pt 7 6)))
- )
- (command pt)
- (princ ".")
- )
- (command "")
- (close fn)
- )
- (princ "\n未选择数据文件,退出")
- )
- (cmdla1)
- )
|