123d 发表于 2018-8-1 12:21:29

将图中所选线段标x坐标和长度保存

将图中所选线段标x坐标和长度保存

123d 发表于 2018-8-1 12:22:08

(defun c:tess
    ( / dml1 dml2 dml3 ss c dm dml ff fntx fftx tx i n pp key)
    (setq ss (ssget '((0 . "line")))
              i   0
    )
        (setq tx "")
    (while (< i (sslength ss))
        (setq dml (entget (ssname ss i))
       
        dml1(cdr (assoc 10 dml))
      dml2(cdr (assoc 11 dml))
      dml3(car dml1)
        c (distance dml1 dml2))
    (setq ff (open "C://Users/74139/Desktop/Line.csv" "w"))
        (progn
          (setq        tx
               (strcat (rtos dml3) "," (rtos c) "\n" tx)
          )
          (write-line tx ff)
        )
    (write-line "" ff)
(princ "\n选择要获取端点的直线:")
(princ "线段端点x坐标为:")
(princ dml3)

(princ "\n")
(princ "线段的长度为:")
(princ c)
(princ "\n")
(princ)
(setq i (1+ i))
)
(close ff)
)

yoyoho 发表于 2018-8-2 12:51:35

谢谢! 分享程序!!!!
页: [1]
查看完整版本: 将图中所选线段标x坐标和长度保存