drawing number list

Well, with much help from others esp. Tom D. this is what I've got. It seems
to work well. It takes a drawing number from a list and prints it in the
bottom right corner of the drawing, then updates the list for the next user.
It also creates the list if none exists.
Thanks all,
Chuck
(defun c:dnum ()
(setq dp (getvar "DWGPREFIX")) ;returns the current drive and directory of
the
drawing
(setq filename (strcat dp "drawing numbers.txt"))
;creates the file in the "dp" directory
(if (setq ofil (open filename "r"))
(progn
(while (setq nxtlin (read-line ofil))
(setq lastnum nxtlin)
) ;while
(setq increment (1+ (atoi lastnum)))
(close ofil)
) ;progn, then
(setq increment 1)
) ;if
(setq ofil (open filename "a")) ;if it doesn't exist, it will be created
(write-line (itoa increment) ofil)
(close ofil)
(setq a (getvar "TEXTSIZE"))
(setq x (/ a 2)) ;sets the vertical offset to textsize/2
(setq a (- (car (getvar "limmax")) a)) ;sets the horizontal offset to
limmax-textsize
bottom-right
justified
(command "text" "j" "br" (list a x) "" "" lastnum)
;prints the dnumber at the predetmined co-ordinates
)
Reply to
Chuck
Loading thread data ...
Glad it's working, Chuck. Thanks for posting your finished product. No doubt it will help someone else. ;)
Reply to
TomD
What would be wrong wih using an external database program like Access, outside of AutoCAD. Does, or will this routine give you realtime save to the directory options, so that while you are working you can modify the directories' files. It is an excellent idea, but for the sake of preservation, wouldn't it be better to handle this with an externally written software. This type of organization is an excellent idea, and could be highly customized to make your day a whole lot easier. Major companies diddle around with files here and there all the time. It is unbelievable. Using many fields you could organize your dwg names by letter and number codes, or sort the fields any way you want by description for example. There is a lot of confusion about using dwg names. One of the fields you could use is an append revision, so you don't have to search multiple file/dwg names for minor changes/uses. "Computers In Manufacturing" talks about the Opitz code, a way to organize names for mfrg routing, etc... There are 26 x10x26 possibilities in three digits for example. Then another program could be used to grab all of the existing files you have scattered around and dump them into the lexicon, all together. You may need to organize the files into directory(ies) before starting. You may need to give prioritization by date, or other desription, with the option to overwrite, change, or append to the dwg files as the directory is being built. These two pieces of software could be invaluable. Any comments would be greatly appreciated.
Reply to
kgs
There's nothing wrong with your idea, IMO. I considered that, but decided it was way too much for our needs. If you're working in an environment with many users and require that much flexibility, I think it would be well worth it. For us, it simply isn't worth it.
Reply to
TomD

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.