本帖最后由 Gu_xl 于 2013-3-19 21:24 编辑
zsw23 发表于 2011-9-21 00:03
可以连续加点就好了
稍加改进,连续加点,并且有夹点显示,可以及时看见所加点!
- (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")
- (progn
- (while (setq pt (getpoint "\n打断位置点: "))
- (setq enden (entlast))
- (command "_break" en (vlax-curve-getclosestpointto en 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 "" "")
- (sssetfirst nil (ssadd en))
- )
- )
- )
- (setvar 'cmdecho cmdecho)
- (setvar 'osmode osmode)
- (princ)
- )
|