串多义线
;将所选择的line或arc串成多义线(defun c:ddx (/ ssa ssa-ent ent-p i)<BR> (command "undo" "be");设置返回起始点<BR> (setq ssa (ssget))<BR> (setq i 0)<BR> (while (< i (sslength ssa))<BR> (setq ssa-ent (ssname ssa i))<BR> (setq ent-p (cdr(assoc 0 (entget ssa-ent))))<BR> (if (not (null ent-p));判断原图元是否已串入多义线<BR> (if (or (= ent-p "LWPOLYLINE") (= ent-p "POLYLINE"));判断原图元属性<BR> (command "pedit" ssa-ent "j" ssa "" "")<BR> (command "pedit" ssa-ent "y" "j" ssa "" "")<BR> ))<BR> (setq i (1+ i))<BR> )<BR> (command "undo" "e");设置返回终止点<BR> (princ)<BR>) 谢谢!
能否加一个提示生成多义线数量,及是否封闭? 谢谢大哥,帮我解决了一个问题
;将所选择的line或arc串成多义线
(defun c:ddx (/ ssa ssa-ent ent-p i)<BR> (command "undo" "be");设置返回起始点<BR> (command "qselect" "" "")<BR> (setq ssa (ssget))<BR> (setq i 0)<BR> (while (< i (sslength ssa))<BR> (setq ssa-ent (ssname ssa i))<BR> (setq ent-p (cdr(assoc 0 (entget ssa-ent))))<BR> (if (not (null ent-p));判断原图元是否已串入多义线<BR> (if (or (= ent-p "LWPOLYLINE") (= ent-p "POLYLINE"));判断原图元属性<BR> (command "pedit" ssa-ent "w" "5" "j" ssa "" "")<BR> (command "pedit" ssa-ent "y" "w" "0.5" "j" ssa "" "")<BR> ))<BR> (setq i (1+ i))<BR> )<BR> (command "undo" "e");设置返回终止点<BR> (princ)<BR>)
我这样一改就可以实现先选择其中一层的线,实现先选择线后 PE 线了。 如果不考虑不同图层的问题,不用程序,pedit->m或mpedit就可搞定 这个代码可以参考,谢谢楼主分享啊。
页:
[1]