只需一步,快速开始
如题,在此先谢了!
使用道具 举报
(command "pedit" 要转成pline的line "" "")
或者取出line的起点p1、止点p2,删除line,再
(command "pline" p1 p2 "")
自己做了一个小程序,请高手指点一下
(defun c2PL() (setq HOLDECHO (getvar "cmdecho")) (setvar "cmdecho" 0) (setq ent (entsel "\n选择<lwpolyliine> to <line>:")) (command "pedit" (car ent) "y" "j") (command pause) (setvar "cmdecho" HOLDECHO) (princ))
(defun c:j (/ join-ss rep1 len entnam enti) (setvar "CMDECHO" 0) (setq join-ss (ssget '((-4 . "<OR") (0 . "LINE") (0 . "ARC") (-4 . "<AND") (0 . "POLYLINE") (70 . 0) (-4 . "AND>") (-4 . "<AND") (0 . "LWPOLYLINE") (70 . 0) (-4 . "AND>") (-4 . "OR>") ) ) ) (if (not join-ss) (exit) ) (vl-cmdf "_.undo" "begin") (setq rep1 0) (setq len (sslength join-ss)) (terpri) (repeat len (setq entnam (ssname join-ss rep1)) (setq enti (entget entnam)) (princ (strcat "\rProcessing line " (itoa (1+ rep1)) " of " (itoa len))) (if enti (if (or (= (cdr (assoc 0 enti)) "POLYLINE") (= (cdr (assoc 0 enti)) "LWPOLYLINE") ) (command "_.pedit" entnam "j" join-ss "" "x") (command "_.pedit" entnam "y" "j" join-ss "" "x") ) ) (setq rep1 (1+ rep1)) ) (vl-cmdf "_.undo" "end") (setvar "CMDECHO" 1) (princ))
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2024-11-17 18:21 , Processed in 0.164750 second(s), 25 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.