Jump to content

Autoselecting numbers in the order


t6nis143

Recommended Posts

Hi!

 

Is there a way to make autocad to autoselect numbers in correct order (from 501 to 530 ie.)? Selecting them by single clicks takes too much time.

 

Thanks a lot!

Untitled.jpg

Link to comment
Share on other sites

I want the software to autoselect them by order, so I could use TCOUNT and change the numbers. (for example: 401...450 to 501...550)

Selecting each of them by single click takes too much time. Is there any way to autoselect them by order?

Link to comment
Share on other sites

I have never used TCOUNT but looking at the command I doubt that it is possible to pre select the order. However if you can be more specific about what you need a custom LISP could be written (not by me) that would combine the selection and the incremented text.

Link to comment
Share on other sites

Using ssget in a lisp you can search for all the numbers in one go if as I have guessed they are blocks, then say filter it down to your range use, a VLsort then loop through them to change the numbers. Phew not that hard. Do you want the numbers to be correct + 1 for each or just add a fixed value? Fixed is real easy.

 

No sample dwg so please post including answer to question line above.

Link to comment
Share on other sites

Using ssget in a lisp you can search for all the numbers in one go if as I have guessed they are blocks, then say filter it down to your range use, a VLsort then loop through them to change the numbers. Phew not that hard. Do you want the numbers to be correct + 1 for each or just add a fixed value? Fixed is real easy.

 

No sample dwg so please post including answer to question line above.

 

Im not sure what you mean by that, but yes I need the numbers to always increase by +1, but the value of the numbers depend on which houseplan im using it on.

(Sorry, my english is kind of rusty)

 

In example, if you look at the screenshot above, I'd like autocad to select the numbers in the circle only, in increasing order, so I could use TCOUNT function later or put this function in a lisp. (Using TCOUNT assumes you single-select object in certain order and it will number them in the same exact order)

Link to comment
Share on other sites

Yes, single line

 

Try this and let me know how you'd get on with it .

 

(defun c:test (/ n1 n2 sad ss i sn e st)
 ;;    Tharwat 26.June.2014        ;;
 (if (and (setq n1 (getint "\n Specify First number in order [smallest] :"))
          (setq n2 (getint "\n Specify Second number in order [biggest] :"))
          (princ "\n Select texts ...")
          (setq sad (ssadd)
                ss  (ssget "_:L" '((0 . "TEXT") (1 . "*#*")))
          )
     )
   (repeat (setq i (sslength ss))
     (setq sn (ssname ss (setq i (1- i)))
           e  (entget sn)
           st (cdr (assoc 1 e))
     )
     (if (and (numberp (setq n (read st))) (< (1- n1) n (1+ n2)))
       (ssadd sn sad)
     )
   )
 )
 (sssetfirst nil sad)
 (princ)
)

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...