kwok 发表于 2014-9-15 12:48
这个加不加都一样,不起作用,输入c后还是如14楼图片右边的图那样.测试环境cad2008 - ;;;修改BY HLCAD.
- (defun c:tt ( / en ent en1 pt lw)
- (command "_.undo" "_be");;命令编组开始
- (setq en (entsel "\n请点取要继续的多段线:"))
- (setq pt (osnap (cadr en) "end"))
- (setq ent (entget (car en)))
- (if (= (cdr (assoc 0 ent)) "LWPOLYLINE")
- (progn
- (or (setq lw (cdr (assoc 43 ent)));实体全局线宽
- (setq lw (cdr (assoc 40 ent)));如果无实体全局线宽 则取起始线宽
- )
- (command "_.pline" pt "w" lw lw)
- (while (/= (getvar"cmdactive") 0) (command pause))
- (setq en1 (entlast))
- (command "_.matchprop" en en1 "")
- (if (= (cdr (assoc 70 (entget (entlast)))) 0)
- (command "_.join" en1 en "")
- (progn
- (command ".pedit" (list en1 (cadr en)) "_open" "")
- (command ".pedit" en "_j" en1 "" "_cl" "")
- )
- )
- )
- (alert "选择的不是多线段!")
- )
- (command "_.undo" "_e")
- (princ)
- )
|