[求助]如何批量给线段标注上编号和长度?
如何实现给图中的线段批量编号和标注长度(非用标注工具,而是直接输入长度数字)?
(defun c:bzline ()
(setq ss (ssget '((0 . "LINE"))))
(setq i 0)
(repeat (sslength ss)
(setq e (ssname ss i))
(setq el (entget e))
(setq obj (vlax-ename->vla-object e))
(setq start (vlax-curve-getStartPoint obj))
(setq end (vlax-curve-getendPoint obj))
(setq l (vlax-curve-getDistAtPoint obj end))
(setq str (strcat "BH=" (rtos (1+ i)) " Long=" (rtos l 2 3) "m"))
(entmake
(list '(0 . "TEXT")
(cons 1 str)
(cons 10 (mapcar '(lambda (x y) (/ (+ x y) 2.)) start end))
(cons 40 1)
(cons 50 (angle start end))
)
)
(setq i (1+ i))
)
)
newbuser 发表于 2015-7-8 17:29 static/image/common/back.gif
(defun c:bzline ()
(setq ss (ssget '((0 . "LINE"))))
(setq i 0)
谢谢NEWBUSER,的确NB,完美地解决了我的问题,我是要下决心来学习LSP了。 圆如何标示??
页:
[1]