 - (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")
- 通用函数下载地址:
- dispbbs.asp?boardID=3&ID=37554&page=1
- |; ;;;
- (defun c:test () ;(/ m n leng)
- (CMDLA0)
- (setq num (UREAL 1 "" "\n数值" num)
- ss (ssget '((0 . "*TEXT")))
- i -1
- )
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq txt (dxf 1 (entget s1))
- leng (strlen txt)
- n 1
- m ""
- )
- (while (< n leng)
- (setq t1 (substr txt n 2))
- (if (= t1 "~")
- (setq m n)
- )
- (setq n (1+ n))
- )
- (if (/= m "")
- (progn
- (setq tx1 (substr txt 1 (- m 1))
- tx2 (substr txt (+ m 2))
- txt-new (strcat (rtos (+ (atof tx1) num) 2)
- "~"
- (rtos (+ (atof tx2) num) 2)
- )
- )
- )
- (setq txt-new (rtos (+ (atof txt) num) 2))
- )
- (sub_upd s1 1 txt-new)
- )
- (CMDLA1)
- )
|