大家好,我有个CAD的lisp编程的问题。我想得到CAD中某些线的每个节点的坐标
大家好,我有个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"))
(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)
)
(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)
)
追问
谢谢你的热心回复,我刚测试了没法选择一系列的线啊。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询