;; Name:- Auto Numbering
;; Written By:- Jimmy D
;; Written on:- 17/5/1999
;; Modified by:- GCP310
;; Modified on:- 15/8/2006
;; This program is for auto-numbering
(defun C:autonum (/ pnt1 start rot count ang inc oldlayer)
(setq ang 0 rot 0 count 0 inc 1 total 30000 OY 1500 OX 1500 )
(princ " \n")
(princ "Warning: Please make sure you have set your text style\n")
(princ " and height before you continue. \n")
(setq oldlayer (getvar "clayer"))
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 33)
(if(not(tblsearch"layer" "DIMESION"))
(command "-layer" "n" "DIMENSION" "c" "red" "DIMENSION" "" )
) ;; If
(setvar "clayer" "DIMENSION")
(setq count (getint "Enter Starting No.: "))
(if (null count) (setq start 1))
(setq inc 1)
(setq ox (*(getdist "Select x offset: ")0.5))
(if (null ox) (setq ox 0))
(setq oy (*(getdist "Select y offset: ")0.5))
(if (null oy) (setq oy 0))
(setq th (getint "\nEnter text height: "))
(if (null th) (setq th 450))
(while (<= count total)
;; Gets point for Number
(setq pnt1 (getpoint "Pick Ref Point or Ecs to end: "))
;; Extracts x and y co-ordinates from pnt1
(SETQ px1 (CAR pnt1))
(SETQ ly1 (CDR pnt1))
(SETQ py1 (CAR ly1))
(SETQ px2 (+ px1 ox))
(SETQ PY2 (+ py1 oy))
;; Creates new point from x and y
(SETQ pnt2 (LIST px2 py2))
;; Inserts text on to point
(command "text" "s" "standard" "mc" pnt2 th 0 count)
;; Increases count in relation to the increment
(setq count (+ count inc))
) ;; While
) ;; Defunc
Bookmarks