|
发表于 2012-7-15 00:40
|
显示全部楼层
来自: 中国湖北宜昌
这个用VBA作麻烦,用LISP简单搞定
(defun c:pe()
(setvar "cmdecho" 0)
(setq sss (ssget))
(setq n 0)
(while (< n (sslength sss))
(setq en (ssname sss n))
(setq en_list (entget en))
(setq entype (cdr (assoc 0 en_list)))
(if (= entype "LWPOLYLINE")
(command "pedit" en "u" "")
(command "pedit" en "y" "")
) ;_ 结束if
(setq n (1+ n))
) ;_ 结束while
(setq ssa nil)
(setq ssa (ssget "X" (list (c*** 0 "LWPOLYLINE"))))
(command "pedit" "m" ssa "" "j" 0.3 "" "")
(setq sss nil)
(setq ssa nil)
(setvar "cmdecho" 1)
(prin1)
) ;_ 结束defun
|
|