![](source/plugin/imc_colorcode/images/loading.gif) - [FONT=courier new](load "xyp_lib.vlx") ;版本 V.20051205 (1781)
- ;|下载和加载通用函数(可在签名栏直接下载后放到搜索路径下)
- 利用以下任何一种方式(首选第一种)即可加载和运行通用函数内的所有子程序:
- ★1·在acad.lsp中增加(load"xyp_lib.vlx")
- ■2·在每个程序内增加(load"xyp_lib.vlx")
- ■3·在command下,输入(load"xyp_lib.vlx")
- ■4·在菜单.mnl中增加(load"xyp_lib.vlx")
- ■5·将xyp_lib.vlx文件直接拽到cad屏幕
- [COLOR=red] ★通用函数下载地址:[/COLOR]
- [url]http://www.xdcad.net/forum/attachment.php?s=&postid=1606661[/url]
- |;
- ;;;多义线顶点序号及坐标标注,可输出坐标数据到文本文件
- (defun c:test065 ()
- (CMDLASC0)
- (setq tx1 (UKWORD 7 "1 2" "\n确定顶点顺序 : 1-正向/2-反向" tx1)
- tx2 (UKWORD 7 "Y N" "\n是否输出顶点坐标数据 : Y-是/N-否" tx2)
- )
- (if (= tx2 "Y")
- (setq ffn (getfiled "\n保存的坐标文件" "坐标" "txt" 1)
- ff (open ffn "w")
- )
- )
- (while (setq en (car (entsel "\n选择对象<退出> : ")))
- (if (or (= (xyp-get-DXF 0 en) "POLYLINE")
- (= (xyp-get-DXF 0 en) "LWPOLYLINE")
- )
- (progn
- (setq ptn (xyp-get-Vertexs en 1)
- i -1
- j 0
- )
- (if (= tx1 "2") ;反向
- (setq ptn (reverse ptn))
- )
- (foreach pt ptn
- (MKLA "坐标编号" 1)
- (xyp-Text 3 pt (itoa (setq j (1+ j))))
- (MKLA "坐标" 3)
- (xyp-ZB pt)
- (if (= tx2 "Y")
- (wr-tx pt ff)
- )
- )
- )
- )
- )
- (if (= tx2 "Y")
- (progn
- (close ff)
- (princ (strcat "\n 坐标写至=>" ffn))
- )
- )
- (CMDLA1)
- )
- (defun wr-tx (point filename / tx)
- (setq tx (strcat
- (rtos (car point) 2)
- " "
- (rtos (cadr point) 2)
- " "
- (rtos (caddr point) 2)
- )
- )
- (write-line tx filename)
- )[/FONT]
|