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

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.