From: dr. Tommie
Subject: Auto numbering
Date:
Message-ID: <789hk9$1n1$1@news1.skynet.be>
Hi,
Does anyone has an autolisp file with an automatic numbering system for
electrical drawings.
I do have this (but maybe somebody has a better one)
The best one should be one that changes the numbering when I insert another
line.
Thanks
dr. Tommie
----------------------------------------------------------------------------
---------------------------------------------
(defun c:nummering (
/ oldecho tmp numHt numValStr
)
(setq oldecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(if (not numVal) (setq numVal 1))
(if (not numInc) (setq numInc 1))
(setq tmp (getint (strcat "\nStarting number <" (itoa numVal) ">:
")))
(if tmp (setq numVal tmp))
(setq tmp (getint (strcat "\nIncrement by <" (itoa numInc) ">: ")))
(if tmp (setq numInc tmp))
(if (= 0.0 (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))))
(progn
(initget (+ 1 2))
(setq numHt (getdist "\nText height: "))
)
)
(while (setq pikPnt (getpoint
(strcat
"\nInsertion point for "
(itoa numVal)
": "
)
)
)
(setq
numValStr (itoa numVal)
numVal (+ numVal numInc)
)
(command "._text" "mc" pikPnt)
(if numHt (command numHt))
(command "" numValStr)
)
(setvar "cmdecho" oldecho)
(princ)
)
----------------------------------------------------------------------------
---------------------------------------------