圆批量变点,autolisp代码如下,适合任何坐标系。
(defun c:tes ( / &k1 &kw1 &p1 &tc1)
(if (null vlax-dump-object) (vl-load-com) )
(princ "\n请选择圆")
(if (setq &kw1 (ssget '((0 . "CIRCLE"))))
(progn
(while (setq &k1 (ssname &kw1 0))
(setq &kw1 (ssdel &k1 &kw1))
(setq &k1 (vlax-ename->vla-object &k1))
(setq &tc1 (vla-get-layer &k1));图层
(setq &p1 (Vlax-SafeArray->List (Vlax-Variant-Value (vla-get-Center &k1))))
(vla-delete &k1)
(entmake (list '(0 . "POINT") (cons 8 &tc1) (cons 10 &p1)))
);while
)
)
(princ)
);复制到记事本,以【.lsp】为后缀命名。cad命令【appload】加载,命令【TES】。