CAD Lisp代码多边形线顶点
你好我正在使用Lee Mac cad lisp程序“PolyInfo V 1.3”用于导出多段线顶点坐标。但为了充分发挥工作的乐趣,我需要一些修改。
程序的URL:http://www.lee-mac.com/polyinfo.html
代码的URL:http://www.lee-mac.com/lisp/html/PolyInfoV1-3.html
正如您所见,该程序导出了有关多段线的大量信息。所以我想修改代码,只导出两列中的多段线起点顶点x和y坐标(我的cad版本信息导出到txt文件)。
结果应该如下所示:
________________________________
多段线起点x
649542.45
649542.35
649542.28
多段线起点y
495232.54
495232.23
495232.41
________________________________
有人能帮我弄清楚我必须修改代码的哪一部分才能得到我想要的结果吗?请 你试过他的积分经理吗? 不幸的是,我使用了,但我使用的不是精确的AutoCAD程序。我正在使用ZW CAD。我是cad程序的廉价版本。因此,命令行promt“**对话框文件无法写入**”。有时并非所有的lisp程序都能工作。
我刚刚找到了一个导出X-Y坐标的简单代码。
URL:http://www.eng-tips.com/viewthread.cfm?qid=195727
这几乎是我所需要的。代码结果:(x坐标)、(Y坐标)
(x坐标)、(Y坐标)
但是,我可以更改coords打印的代码,而不是在一行中,而是在单独的列中吗?例如:
(x坐标)
(x坐标)
(Y坐标)
(Y坐标) 您可以回到第一步的基础知识,使用“getcoordinates”函数,然后以您想要的方式导出您想要的内容。看看这个例子。
; pline co-ords example
; By Alan H
(defun getcoords (ent)
(vlax-safearray->list
(vlax-variant-value
(vlax-get-property
(vlax-ename->vla-object ent)
"Coordinates"
)
)
)
)
(defun co-ords2xy ()
; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
(setq len (length co-ords))
(setq numb (/ len 2)) ; even and odd check required
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)
; program starts here
(setq co-ords (getcoords (car (entsel "\nplease pick pline"))))
(co-ords2xy) ; list of 2d points making pline
(princ co-ordsxy)
想要改变这个
标记N,E坐标与领导者-David B.Stewart
(定义C:LP(/PNT1 P1X P1Y STDY DY COORDN COORDE PTXT)
(setq PNT1(getpoint
“\n点击坐标点:”)
(setq P1X(car pnt1));x坐标
(setq P1Y(cadr pnt1));y坐标
(setq STDX(rtos P1X 2 2))
(setq STDY(rtos P1Y 2 2))
(setq坐标(strcat“N=“STDY))
(setq坐标(strcat“E=“STDX))
(setq PTXT(获取点
“\n点击文本位置:”)
(命令“LEADER”PNT1 PTXT“COORDN COORDE”)
(普林斯)
)
这边走
N=8566159.79
E=505422.47
想这样吗
N=8.566.159,79
E=505.422,47
想知道是否有可能默认
从未见过这样的数字格式,逗号作为小数点?
不是这个?
N=8566159.79
E=505422.47
谷歌“用千位分隔符格式化数字”还有许多其他语言的例子
页:
[1]