大家好,我有个CAD的lisp编程的问题。我想得到CAD中某些线的每个节点的坐标

大家好,我有个CAD的lisp编程的问题。我想得到CAD中某些线的每个节点的坐标,现在有个程序是可以点选后得到这些点的坐标,我希望能直接选线就能得到这些点的坐标。请高手帮帮忙,谢谢了。
-------点选的代码--------
(defun c:djbh()
(setq ff (open (getfiled "Save as" "c:" "csv" 1) "w"))
(setq ents "")
(while
(setq pt (getpoint "\n pick up the points:"))
(setq s (strcat (rtos (nth 1 pt) 2 3) " , " (rtos (nth 0 pt) 2 3)))
(write-line s ff)
(princ "\n")
(princ (strcat "\n output word'" s "'"))
(setq ents "")
)
)

(defun c:djbh ()
(setq ff (open (getfiled "Save as" "C:" "csv" 1) "w"))
(while (setq obj (car (entsel)))
(setq data (entget obj))
(setq pt (list (cdr (assoc 10 data)) (cdr (assoc 10 data))))
(foreach x pt
(setq
s
(strcat (rtos (nth 1 x) 2 3) " , " (rtos (nth 0 x) 2 3))
)
(write-line s ff)
(princ "\n")
(princ (strcat "\n output word'" s "'"))
)
)
(close ff)
(princ)
)追问

谢谢你的热心回复,我刚测试了没法选择一系列的线啊。。。

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜