Jump to content

Find Missing text number in a layer


subodh_gis

Recommended Posts

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • subodh_gis

    13

  • pBe

    10

  • MSasu

    2

  • BlackBox

    1

Top Posters In This Topic

Posted Images

Hi ! any progress .

 

Wasn't aware you posted a sample drawing subodh_gis, besides the sample doesnt show a missing number at all.

 

FWIW

(defun c:filler	(/ _missing cont ss str i missed num noone)
(defun _missing (l / missing)
   (repeat (- (setq lv (apply 'max l))
       (apply 'min l)
    )
     (if (not (member (setq lv (1- lv)) l))
(setq missing (cons lv missing))
     )
   )
   missing
 )  
 (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 (vlax-ename->vla-object e)) cont))
)
     )
     (setq cont (vl-sort cont
		  '(lambda (j k)
		     (< (car j) (car k))
		   )
	 )
     )
     (if (setq missed (_missing (mapcar 'car cont)))
(progn
	(setq cont
	       (cdr (member
		      (assoc (1- (setq num (car missed))) cont)
		      cont
		    )
	       )
	)
  (foreach val cont
    (vla-put-textstring
      (cadr val)
      (itoa num)
    )(setq num (1+ num))
  )
)
     )
   )
 )
 (princ)
)

Link to comment
Share on other sites

Wasn't aware you posted a sample drawing subodh_gis, besides the sample doesnt show a missing number at all.

 

FWIW

(defun c:filler	(/ _missing cont ss str i missed num noone)
(defun _missing (l / missing)
   (repeat (- (setq lv (apply 'max l))
       (apply 'min l)
    )
     (if (not (member (setq lv (1- lv)) l))
(setq missing (cons lv missing))
     )
   )
   missing
 )  
 (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 (vlax-ename->vla-object e)) cont))
)
     )
     (setq cont (vl-sort cont
		  '(lambda (j k)
		     (< (car j) (car k))
		   )
	 )
     )
     (if (setq missed (_missing (mapcar 'car cont)))
(progn
	(setq cont
	       (cdr (member
		      (assoc (1- (setq num (car missed))) cont)
		      cont
		    )
	       )
	)
  (foreach val cont
    (vla-put-textstring
      (cadr val)
      (itoa num)
    )(setq num (1+ num))
  )
)
     )
   )
 )
 (princ)
)

 

how it will work ?

Link to comment
Share on other sites

Hey guys, having just read this, and the OP's other thread, I think there's a bit of miscommunication here.

 

It seems our new friend from Bijnor, India is after some .NET code, not only due to their explicit request in the other thread, but as can be observed in the Visual Studio form designer icon shown in the upper left of post #11... Methinks the OP may have accidentally posted in the LISP forum.

 

While I do recognize that they're asking others to write code for them, without posting any source-code demonstrating an initial effort on their part, I truly do not think they intended to waste other's time in writing code for a different language altogether (in this case LISP).

 

For the record, I could be utterly mistaken here, but this is my understanding, so please take from it what you like.

 

Cheers

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...