(defun C:TT(/ a b zero x y pt i j)
(setq a (getpoint "选择原点:\n"))
(setq b (list 0 0 0))
(while (not (= b nil))
(setq b (getpoint "选择测端点:\n"))
(if (not (= b nil))
(setq x (abs (- (car a) (car b)))))
(if (not (= b nil))
(setq y (abs (- (cadr a) (cadr b)))))
(if (not (= b nil))
(setq pt (cons (list x y) pt))
)
)
(setq pt (reverse pt))
(princ"\n X方向的距离统计\n")
(setq i 0)
(repeat (length pt)
(princ (* 0.001 (nth 0 (nth i pt))))
(princ "\n")
(setq i (+ i 1))
)
(princ"\n Y方向的距离统计\n")
(setq j 0)
(repeat (length pt)
(princ (* 0.001 (nth 1 (nth j pt))))
(princ "\n")
(setq j (+ j 1))
)
(princ)
)
只做了起点的,终点的自己手动减一下或读出长度减去这个值输出来吧(princ "\n************************\n查询点到线段起点的距离小程序,快捷键cc")
(defun c:cc( / str)
(setq str(vlax-curve-getDistAtPoint (vlax-ename->vla-object (nth 0 (entsel "\n选择线段:"))) (getpoint "\n选择点:\n")))
(princ "该点到线段起点距离为:")
(princ str)
(princ)
)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)