;;;多段线加点
- (defun c:tt (/ CMDECHO EN PT ENDEN SS osmode)
- (setq cmdecho (getvar 'cmdecho))
- (setq osmode (getvar 'osmode))
- (setvar 'cmdecho 0)
- (setvar 'osmode 930)
- (and
- (setq en (car (entsel "\n选择多段线:")))
- (WCMATCH (cdr (assoc 0 (entget en))) "*POLYLINE")
- (setq pt (getpoint "\n打断位置点: "))
- (progn
- (setq enden (entlast))
- (command "_break" en "near" pt pt)
- (setq ss (ssadd))
- (while (setq enden (entnext enden))
- (if (not (member (cdr (assoc 0 (entget enden)))
- '("ATTRIB" "VERTEX" "SEQEND")))
- (ssadd enden ss)
- )
- )
- (command "pedit" en "j" ss "" "")
- )
- )
- (setvar 'cmdecho cmdecho)
- (setvar 'osmode osmode)
- (princ)
- )
|