Results 1 to 4 of 4

Thread: auto numbering block attrib

  1. #1
    Active Member
    Join Date
    2015-09
    Posts
    72
    Login to Give a bone
    0

    Default auto numbering block attrib

    I like the automatic text numbering function in the express tools. is there anything like that for blocks?

  2. #2
    100 Club
    Join Date
    2008-08
    Location
    Vancouver, BC
    Posts
    105
    Login to Give a bone
    0

    Default Re: auto numbering block attrib

    I have this, where you give the first number you want to start with, then select each block and they will be numbered in order.

    Code:
    (defun c:ano (/ TX TXVAL TXENT a# last#) 
      (setvar "cmdecho" 0)
      (if (= last# nil)(setq last# "nil")(princ))
    
      (setq a# (strcat (getstring (strcat "\nFirst No. <" last# ">:"))))
      (if (= a# "")(setq a# last#))
    
    (while
    
      (setq TX (car (nentsel "\nPick Text : ")))
      (setq TXENT (entget TX))
      (if (or (= (cdr (assoc 0 TXENT)) "TEXT")(= (cdr (assoc 0 TXENT)) "ATTRIB"))
        (progn
          (setq TXENT (entget TX))
          (setq TXVAL a#)
          (do-it)
          (setq a# (rtos (+ (distof a#) 1) 2 0))
          (setq last# a#) 
        )
        (progn
          (alert "No Text or Attributes Selected!")
          (c:ano)
        )
      )
    )  
      (princ)
    )
    
    (defun do-it ()
      (setq TXENT (subst (cons 1 TXVAL) (assoc 1 TXENT) 
                         TXENT
                  )
      )
      (entmod TXENT) 
      (entupd TX)
      (princ)
    )
    
    (princ)

  3. #3
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: auto numbering block attrib


  4. #4
    Active Member
    Join Date
    2015-09
    Posts
    72
    Login to Give a bone
    0

    Default Re: auto numbering block attrib

    thanks to everyone

Similar Threads

  1. Auto Numbering
    By sandeep_koodal in forum AutoCAD Tips & Tricks
    Replies: 9
    Last Post: 2012-05-16, 03:25 PM
  2. Need Help: Auto Numbering Block attributes
    By ReachAndre in forum AutoLISP
    Replies: 8
    Last Post: 2011-12-14, 12:37 PM
  3. link mtext auto-numbering to block text
    By dnicho12 in forum AutoCAD Fields
    Replies: 1
    Last Post: 2007-01-29, 07:36 PM
  4. Changing dyn. block state makes multiple Attrib. changes harder.
    By norrin in forum Dynamic Blocks - Technical
    Replies: 7
    Last Post: 2006-08-09, 08:48 PM
  5. Block with attrib using entmake
    By vlee in forum AutoLISP
    Replies: 3
    Last Post: 2004-06-30, 03:00 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
  •