jeremyearle5 Posted April 5, 2012 Share Posted April 5, 2012 I'm trying to filter out plines that are duplicates of each other from a list. I've been trying to compare 1 point in the first pline against the list of points from the other plines. They will only share a point if they are identical for this use. I've been trying to work this out on my own but it has becaome a complete mess and I know there must be a simpler way. This code works but has no way of checking the last pline. comparepts is a list of lists of the points on the plines nubpaths is a list of the pline entity names Help if you can please. (setq compctr1 0 ctr 0 numnubs (length nubpaths) nlist (list) ) (while (< compctr1 (- numnubs 1)) (setq compctr2 (+ compctr1 1)) (while (and (< compctr2 numnubs) (not reject)) (setq complngth (length (nth compctr2 comparepts))) (setq compctr3 0) (while (and (< compctr3 complngth) (not (equal (car (nth compctr1 comparepts)) (nth compctr3 (nth compctr2 comparepts)) 0.00009))) (setq compctr3 (+ compctr3 1)) ) ;_ end of while (if (/= compctr3 complngth) (setq reject T) ) ;_ end of if (setq compctr2 (+ compctr2 1)) (if (= compctr2 numnubs) (setq nlist (append nlist (list (nth compctr1 nubpaths)))) ) ) ;_ end of while (setq compctr1 (+ compctr1 1) reject nil ) ) ;_ end of while Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.