drawing number list

Discussion in 'AutoCAD' started by Chuck, Jul 28, 2003.

  1. Chuck

    Chuck Guest

    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
    )
     
    Chuck, Jul 28, 2003
    #1
  2. Chuck

    kgs Guest

    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.
     
    kgs, Nov 1, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.