- ;排除相差精度在0.0001之内的点
- (defun get-pline-point (e / i jd lst pt0 upt v)
- (setq i -1)
- (setq jd 0.0001)
- (while (setq v (vlax-curve-getpointatparam e (setq i (1+ i))))
- (if (= i 0)
- (progn
- (setq lst (cons v lst))
- (setq pt0 v)
- (setq upt v)
- )
- (progn
- (if (equal upt v jd)
- (progn
- (princ)
- )
- (progn
- (if (equal pt0 v jd)
- (progn
- (princ)
- )
- (progn
- (setq lst (cons v lst))
- (setq upt v)
- )
- )))))
- );while
- (setq lst (cdr lst))
- (reverse lst)
- )
- (setq pt_s (get-pline-point (car (entsel))))
- (setq ssObjects (ssget "_WP" pt_s '((0 . "INSERT") (100 . "AcDbBlockReference"))))
|