你找到通过251的那段的两个端点,加入你需要的点,下面这个函数是在多线段中加入点:
- (defun Addpt(ent pt pt1 pt2 / ent ents ents2 pt i item pt1x pt2x m)
- (setq ents (entget ent))
- (setq pt1x (reverse (cdr (reverse pt1))))
- (setq pt2x (reverse (cdr (reverse pt2))))
- (setq i 0)
- (setq m t)
- (while (< i (length ents))
- (setq item (nth i ents))
- (if (and m (or
- (equal pt1x (cdr item))
- (equal pt2x (cdr item))
- ))
- (progn
- (setq ents2 (append ents2 (list item '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 (reverse (cdr (reverse pt)))))))
- (setq m nil)
- )
- (setq ents2 (append ents2 (list item)))
- )
- (setq i (1+ i))
- )
- (setq ents2 (subst (cons 90 (+ (cdr (assoc 90 ents2)) 1)) (assoc 90 ents2) ents2))
- (entmod ents2)
- )
|