subodh_gis Posted November 13, 2013 Posted November 13, 2013 How can we find a missing number from a number sequence in a text layer using Autolisp. For ex- 1 2 3 4 6 7 in the above sequence 5 number is missing. so we should find 5 and zoom in to its nearest number as 4. Actually we need it for parcel numbering where no number should be miss. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 and bump the rest? i.e. 7 becomes 6 and 6 becomes 5? Quote
MSasu Posted November 13, 2013 Posted November 13, 2013 Subodh_gis, are you willing to write that code, so looking for some hints or request someone to write it for you? Quote
pBe Posted November 13, 2013 Posted November 13, 2013 Subodh_gis, are you willing to write that code, so looking for some hints or request someone to write it for you? I was about to write a demo code. lets wait for the OP to confirm his intent then. Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 Subodh_gis, are you willing to write that code, so looking for some hints or request someone to write it for you? Requesting someone to write it for me. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 Requesting someone to write it for me. What about it boss? [MSasu], do you concur? @Subodh_gis, Anyhoo. you did not answer my question though and bump the rest? i.e. 7 becomes 6 and 6 becomes 5? Quote
MSasu Posted November 13, 2013 Posted November 13, 2013 It’s you time and benevolence, so please proceed at your wish my friend! Sorry if my question sounded like a restriction. Is just that I really like to offer support to people that were willing to write the routines by themselves, so wanted to know if I may be involved. Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 What about it boss? [MSasu], do you concur? @Subodh_gis, Anyhoo. you did not answer my question though No I just neet to find and zoom in. Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 and bump the rest? i.e. 7 becomes 6 and 6 becomes 5? No I just neet to find and zoom in. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 Sorry if my question sounded like a restriction. Is just that I really like to offer support to people that were willing to write the routines by themselves, so wanted to know if I may be involved. No worries my friend I with you on that MSasu. No I just neet to find and zoom in. Find what? the next number of the missing digit? What if there are two missing digits? after the zoom then do what? Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 No worries my friend I with you on that MSasu. Find what? the next number of the missing digit? What if there are two missing digits? after the zoom then do what? thanks for your support find missing numbers and make list if we click on any number of missing list then zoom in to previous number of missing number. if no missing then Simple msg that no missing found. nothing to do after zoom in we will manually edit it. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 thanks for your support find missing numbers and make list if we click on any number of missing list then zoom in to previous number of missing number. if no missing then Simple msg that no missing found. nothing to do after zoom in we will manually edit it. It appears that you already have a program to find the missing numbers. What i was offering to you before was to auto-magically bump the numbers to accommodate the missing digits. Your request just became more complicated with the addition of a list box. Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 No worries my friend I with you on that MSasu. Find what? the next number of the missing digit? What if there are two missing digits? after the zoom then do what? Thanks for your kind support Find the missing numbers and make a list of them if we click on any of missing number then zoom in to previous number of that missing number. if no missing number found then simple msg that no missing found. after zoom nothing to do we will manually edit it. Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 It appears that you already have a program to find the missing numbers. What i was offering to you before was to auto-magically bump the numbers to accommodate the missing digits. Your request just became more complicated with the addition of a list box. any thing that we can in this situation list box is not necessary. any other suggestion to complete missing sequence. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 any thing that we can in this situation list box is not necessary. any other suggestion to complete missing sequence. Ok, now lets get down to business, are these TEXT entity? are they on a particular layer? will this be via selection [per block i suppose]? Uhhhmm sample drawing? Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 Ok, now lets get down to business, are these TEXT entity? are they on a particular layer? will this be via selection [per block i suppose]? Uhhhmm sample drawing? yes they are text entity. they are in "TXT01_PARCEL" layer. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 (edited) I see, still no sample drawing Here's a simple code: forced to re-number everything regardless what is the missing digit the OP "dont need this actually" We can add a sub to find the lowest missing number and start from there [maybe later]. [b]***CODE MOVED TO POST # 24***[/b] Edited November 14, 2013 by pBe Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 I see, still no sample drawing Here's a simple code: forced to re-number everything regardless what is the missing digit (defun c:filler (/ _missing cont ss str i missed num) (if (setq cont nil ss (ssget "_:L" '((0 . "TEXT") (8 . "TXT01_PARCEL"))) ) (progn (repeat (setq i (sslength ss)) (setq str (cdr (assoc 1 (entget (setq e (ssname ss (Setq i (1- i)))))) ) ) (if (numberp (setq v (read str))) (setq cont (cons (list v e) cont)) ) ) (setq cont (vl-sort cont '(lambda (j k) (< (car j) (car k)) ) ) ) (if (> (car (last cont)) (length cont)) (progn (setq num 0) (foreach val cont (vla-put-textstring (vlax-ename->vla-object (cadr val)) (itoa (setq num (1+ num))) ) ) ) ) ) ) (princ) )(vl-load-com) We can add a sub to find the lowest missing number and start from there [maybe later]. I don't need this actually. Quote
pBe Posted November 13, 2013 Posted November 13, 2013 I don't need this actually. Thats gratitude for you. It's unfortunate, I was planning to re-write the code to meet other conditions and also to include a list box. Post a sample drawing then. Quote
subodh_gis Posted November 13, 2013 Author Posted November 13, 2013 Thats gratitude for you. It's unfortunate, I was planning to re-write the code to meet other conditions and also to include a list box. Post a sample drawing then. Dear see the attached sample or can you come on Team Viewer so that i can show you. sample.dwg Quote
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.