subodh_gis Posted May 17, 2014 Share Posted May 17, 2014 I have parcel IDs (numbers as text objects) in a layer. I like to find out duplicate Parcel IDs and Missing Parcel Ids in sequence. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 18, 2014 Share Posted May 18, 2014 I have parcel IDs (numbers as text objects) in a layer. I like to find out duplicate Parcel IDs and Missing Parcel Ids in sequence. Sound easy enough, and do what with the results afterwards If there are indeed missing and duplicates? Quote Link to comment Share on other sites More sharing options...
subodh_gis Posted May 18, 2014 Author Share Posted May 18, 2014 Thanks for kind reply.Can we make list box of the duplicates and missing. when we select the listbox item it just zoom to that id in case of duplicate and previous id in case of missing. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 18, 2014 Share Posted May 18, 2014 Thanks for kind reply.Can we make list box of the duplicates and missing. when we select the listbox item it just zoom to that id in case of duplicate and previous id in case of missing. Figures, I knew there's more to that than just capturing those items. I can only write a quick code for missing/duplicates. Will that help you at all? BYW: are those whole "numbers" as text? can you post a sample of a parcel ID number? Quote Link to comment Share on other sites More sharing options...
subodh_gis Posted May 18, 2014 Author Share Posted May 18, 2014 yes they are integer like 123 124 125 and so on. i have to manually correct the duplicates so it will be better if we can change the property of duplicate so that we can identify them. But how we will identify missing in the sequence, any table? Quote Link to comment Share on other sites More sharing options...
pBe Posted May 18, 2014 Share Posted May 18, 2014 I can only "Help" you so much subodh_gis, the only thing i'll do for you is to provide a simple code to target missing/duplicates. You need to remember , we are doing this on our spare time. You can however contact forum members to write a custom lisp for you for a fee. otherwise wait for somebody here to write a complete code to your liking. Your call dude. Quote Link to comment Share on other sites More sharing options...
subodh_gis Posted May 18, 2014 Author Share Posted May 18, 2014 ok code what u can. Every help is great for me. thanks in advance. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 18, 2014 Share Posted May 18, 2014 (edited) ok code what u can. Every help is great for me.thanks in advance. That is all i want to hear Q&D for duplicate/missing items (defun c:demo ( / sst a b c duplicate e f g i n missing sequence data) ;;; Demo by pBeMay2014 ;;; (if (setq data nil c nil duplicate nil missing nil sst (ssget "_X" '((0 . "TEXT") (8 . "ThisLayer");<--- change this to your specific layer (1 . [color="blue"]"*#*"[/color])))) (progn ;;; Gather all "number" from valid selected objects ;;; (repeat (setq i (sslength sst)) (setq data (cons (cdr (assoc 1 (entget (ssname sst (setq i (1- i))))) ) data ) ) ) ;;; Find duplicates via while loop ;;; (while (setq a (car data) b (cdr data) ) (setq c (cons a c)) (if (> (length b) (length (setq b (vl-remove a b)))) (Setq duplicate (cons a duplicate)) ) (setq data b) ) ;;; Sort remaining items from lowest to highest value ;;; (setq sequence (vl-sort (mapcar 'atoi c) '<)) ;;; Retrieve missing item on the sorted list ;;; (while (setq e (car sequence) f (cdr sequence) ) (setq n 1) (while (and (/= (setq g (+ n e)) (car f))) (setq missing (cons (itoa g) missing) n (1+ n) ) ) (setq sequence f) ) ) (princ "\n<<<None objects Found>>>") ) (princ "\nDuplicates: ") (princ (vl-sort (mapcar 'atoi duplicate) '<)) (princ "\nMissing: ") (princ (reverse missing)) (princ) ) HTH Edited May 18, 2014 by pBe Quote Link to comment Share on other sites More sharing options...
subodh_gis Posted May 18, 2014 Author Share Posted May 18, 2014 Thanks its working perfect. but is some situation when any number by mistake is having space before and after it will not treat it as a number. can we find such number. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 18, 2014 Share Posted May 18, 2014 sure... code updated at post#8 Quote Link to comment Share on other sites More sharing options...
subodh_gis Posted May 18, 2014 Author Share Posted May 18, 2014 please suggest some programmer who can do next part of the code because this can only help if we have list box of missing and duplicate and we can zoom to text to correct it manually. reference post of Lee Mac http://www.lee-mac.com/listboxsync.html Quote Link to comment Share on other sites More sharing options...
pBe Posted May 18, 2014 Share Posted May 18, 2014 subodh_gis, Please tell us at least you are trying to learn how to code on your own, it appears that you're just helping yourself and the company you work for with free routines in the expense of our fellow forum members. This is CADTutor after all. Come to think of it, i do remember you from some other thread -->Find-Missing-text-number-in-a-layer Quote Link to comment Share on other sites More sharing options...
subodh_gis Posted May 18, 2014 Author Share Posted May 18, 2014 Yes I am learning Autolisp. I respect CADTutor and all the fellow forum members.I can pay the fee for this routine if they will charge. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.