Results 1 to 2 of 2

Thread: increment number

  1. #1
    Member
    Join Date
    2011-07
    Posts
    13

    Question increment number

    hi
    I need to modify the attachment lisp as my project,the increment number ok,but same time I need select one by one (without use repeat command) or to change all single selection without decimal places(0).

    thanks in advance

    venki
    Attached Files Attached Files

  2. #2
    I could stop if I wanted to pbejse's Avatar
    Join Date
    2010-10
    Posts
    397

    Default Re: increment number

    Code:
    (defun c:NI (/ ss en ed ov tv add)
      (initget 3)
      (setq add (getreal "\nAmount To Add:   "))
    
      (and (setq ss (ssget '((0 . "TEXT"))))
           (while (setq en (ssname ss 0))
                  (setq ed (entget en)
                        tv (cdr (assoc 1 ed)))
                  (and (numberp (read tv))
                       (setq ov (atof tv))
                       (entmod (subst (cons 1 (rtos (+ ov add) 2 0))
                                      (assoc 1 ed) ed)))
                  (ssdel en ss)))
      (prin1))
    Code:
    (defun c:NI (/ en ed ov tv add)
      (initget 3)
      (setq add (getreal "\nAmount To Add:   "))
      (while (and
                   (setq en (car (entsel "\nSelect Text to modify:")))
                   (wcmatch (cdr (assoc 0 (entget en))) "*TEXT")
                   )
            (setq ed (entget en)
                        tv (cdr (assoc 1 ed)))
                  (and (numberp (read tv))
                       (setq ov (atof tv))
                       (entmod (subst (cons 1 (rtos (+ ov add) 2 0))
                                      (assoc 1 ed) ed)))
            ))

Similar Threads

  1. Increment number of block dynamic
    By califantis in forum AutoLISP
    Replies: 2
    Last Post: 2010-11-30, 06:16 AM
  2. Attribute increment
    By sandeep_koodal in forum AutoCAD Tips & Tricks
    Replies: 2
    Last Post: 2009-01-15, 04:15 AM
  3. Replies: 2
    Last Post: 2007-12-17, 08:10 PM
  4. Increment Text
    By Robert.Hall in forum AutoLISP
    Replies: 11
    Last Post: 2007-01-11, 07:11 PM
  5. Replies: 4
    Last Post: 2005-10-11, 05:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •