Hi, irot, now I used different OVERKILL-PTS algorithm :
Total : 1480 duplicate point entities deleted...
Now there is no problems with duplicate points, but now appeared one different issue : when triangulate-UCS.lsp it bugged when calculating circumcircle from 3 collinear points X values the same, but 3 different Y coordinates and 3 different Z coordinates... So I had to mod triangulate-UCS.lsp, but then again it did finish quite quick, but there were errors in TIN... I'll attach my archive for YMG to investigate if he had chance cos' I did quick mod... in (getcircumcircle) at the end I've put (if (and cp rr) ... ), meaning that sub may return nil, and that nil I've removed from al - active list here :
...
(while el
(if (or (member (reverse (car el)) el)
(member (car el) (cdr el))
)
(setq el (vl-remove (reverse (car el)) el)
el (vl-remove (car el) el)
)
(setq al (cons (getcircumcircle p (car el)) al)
al (vl-remove nil al)
el (cdr el)
)
)
)
...
OVERKILL-PTS-average-z.lsp now looks like this :
(defun c:overkill-pts-average-z ( / ss i ent entptlst k zcoords zaverage subentptlst ti )
(prompt "\nSelect points...")
(setq ss (ssget "_:L" '((0 . "POINT"))))
(setq ti (car (_vl-times)))
(repeat (setq i (sslength ss))
(setq ent (ssname ss (setq i (1- i))))
(setq entptlst (cons (list ent (cdr (assoc 10 (entget ent)))) entptlst))
)
(setq k 0)
(foreach entpt entptlst
(setq subentptlst (vl-remove-if-not '(lambda ( x ) (and (equal (car (cadr entpt)) (car (cadr x)) 1e-2) (equal (cadr (cadr entpt)) (cadr (cadr x)) 1e-2))) entptlst))
(if subentptlst
(progn
(setq zcoords (mapcar 'caddr (mapcar 'cadr subentptlst)))
(setq zaverage (/ (apply '+ zcoords) (float (length zcoords))))
(setq subentptlst (vl-remove entpt subentptlst))
(foreach subentpt subentptlst
(if (not (vlax-erased-p (car subentpt)))
(progn
(setq k (1+ k))
(entdel (car subentpt))
)
)
)
(if (vlax-erased-p (car entpt))
(progn
(entdel (car entpt))
(setq k (1- k))
(entupd (cdr (assoc -1 (entmod (subst (cons 10 (list (car (cadr entpt)) (cadr (cadr entpt)) zaverage)) (assoc 10 (entget (car entpt))) (entget (car entpt)))))))
)
)
)
)
)
(prompt "\nTotal : ") (princ k) (prompt " duplicate point entities deleted...")
(prompt "\nElapsed time : ") (princ (rtos (/ (- (car (_vl-times)) ti) 1000.0) 2 50)) (prompt " seconds.")
(princ)
)
I'll attach new DWG with points OK and my archive for YMG... You may test further with YMG's Triang and see if it's good... I am afraid I can't figure out why my TIN isn't good...
Regards, M.R.