fill in a database

Discussion in 'AutoCAD' started by rewilson, Feb 23, 2004.

  1. rewilson

    rewilson Guest

    Is it possible to fill in an Access database with system variables like loginname, tdindwg, dwgprefix,dwgname,etc,etc.? Has anyone done this before? I've searched for posts both here and on google, but they mostly pertain to block and attributes. TIA for the help.
     
    rewilson, Feb 23, 2004
    #1
  2. rewilson

    urugx Guest

    If you have a routine that works for blocks/attributes,
    you can make revisions to the routine so it'll work
    with what you need.
     
    urugx, Feb 23, 2004
    #2
  3. rewilson

    R.K. McSwain Guest

    Sure. If you don't want to go to the trouble of writing code to output to the MDB format, you could write out the values to a TXT file and then link the TXT file to an Access table. It's a one way street, meaning you cannot update the TXT by modifying values in Access, (effectively making the MBD read-only). But if you only need the data in a database for analysis, this might work.
     
    R.K. McSwain, Feb 23, 2004
    #3
  4. You should be able to do it with Visual Basic (VBA) by adding references to
    ADO.
     
    Allen Johnson, Feb 23, 2004
    #4
  5. rewilson

    ECCAD Guest

    rewilson,
    Search this NG for "access", lots of methods shown for opening the DB, query, etc.
    Basically you need to gather the data (from getvar ...), then store it in the DB.
    Check / link to:
    http://www.fleming-group.com/

    Bob
     
    ECCAD, Feb 23, 2004
    #5
  6. rewilson

    rewilson Guest

    I'm VB challenged.......so I really can't achieve this by myself. The one way street thing would be fine. We have all our drawings in an Access database, and the cad techs don't like to be honest with their inputs of edit time in the database. So my thought is, to create a second database, and link their workstations to it. Then record the login name, date, drawing prefix and name, and edit time automatically. That way, when the boss runs his numbers from the database, and they don't match the charge codes on time sheets, we can at least pinpoint the differences. Sound simple? :) Thanks for your help, everyone.
     
    rewilson, Feb 23, 2004
    #6
  7. rewilson

    ECCAD Guest

    Oh,
    Is this one a (new) version of trying to track the time spent - by monitoring the acad stations. IF IT IS, I won't be a part of that nonesense. Just can all of the operators, hire new ones,
    keep doing that every week if you want. You still won't be anymore productive in the end - why ? Because people got to think once in a while before pecking on the keys, or answer the phone, or go to the john, get a coffee,,,, etc.
    Just leave them alone (decreasing their stress), and they will do their jobs..!!!!

    Bob
     
    ECCAD, Feb 23, 2004
    #7
  8. rewilson

    rewilson Guest

    Can't say I disagree with you, Bob. However, it's usually only one two that spoil it for everybody else. The sooner you pinpoint the problem and eliminate it, the better it is for the rest of the competent people. I'm just the messenger.....don't shoot me.
     
    rewilson, Feb 23, 2004
    #8
  9. rewilson

    ECCAD Guest

    No shots, just being a jar head. You need VB to mount both Access and ACAD to do a direct save (VB will have to do this with a 'timer' in a repeat loop). Other alternative is write tokens to a flat file, and link to Access table.
    Rather than use Access, I would approach it with Excel and a (csv) file. Of course, this file (if operator can get to it) is fair game for deleting. With the VB approach, it is not easy to maintain the active ACAD window operations (because the VB Macro - once fired takes over, then drops back to ACAD).
    Also, when open / close / save/ saveas/ etc.,. how to 'remount' the 'active document' ? Big mess any way you go.

    Bob
     
    ECCAD, Feb 23, 2004
    #9
  10. Here is a program I wrote for a company a few years ago.
    The program writes 1 line each time a user opens a drawing.
    The program write to a specific for each user, but can be modified to write
    to only 1 file for all users.
    It does NOT track the time editing a drawing, just each time any drawing is
    open (including when AutoCAD is started - drawing name = drawing1.dwg).

    To capture the time editing a drawing would require a SPECIAL program to run
    when a users closes a drawing.
    Also, this would be difficult if the users opens more than 1 drawing at a
    time.

    The company I wrote this for, used it for many months without any users
    (except the myself and owner) knowing they were being tracked.
    We were able find out when people actually started AutoCAD in the morning
    and after lunch. Plus we were able to track the drawings they were supposed
    to be editing verses the time sheets.
    We were able to find the "Problem" people and single them out with specific
    cases of bad time sheets, start times, etc.

    I'm sure some will deplore and lament the "Spying", but if everyone was
    honest (and we know they aren't), then we wouldn't need these programs.

    Good luck.....
    ;--write drawing name to user log---------------------------------------
    (setq FN (strcat "N:/users/" (getvar "LOGINNAME") "/acadlog/acadlog.txt"))
    (if (findfile FN)
    (progn
    (setq DD (rtos (getvar "CDATE") 2 6))
    (setq YEAR (substr DD 3 2) MONTH (substr DD 5 2) DAY (substr DD 7 2))
    (setq MONTH (itoa (atoi MONTH)))
    (setq DAY (itoa (atoi DAY)))
    (setq HOUR (substr DD 10 2) MINUTE (substr DD 12 2))
    (setq DATE (strcat " Date=" MONTH "-" DAY "-" YEAR))
    (setq TT (strcat MONTH "-" DAY "-" YEAR " "))
    (setq TT (strcat TT HOUR ":" MINUTE " "))
    (setq TT (strcat TT (getvar "DWGPREFIX") (getvar "DWGNAME")))
    (setq F0 (open FN "a"))
    (if F0
    (progn
    (write-line TT F0)
    (close F0)
    )
    )
    )
    )
     
    Alan Henderson, Feb 23, 2004
    #10
  11. rewilson

    rewilson Guest

    OK.....thanks to everyone. I think I can get there from here. I appreciate all the help and input. :)
     
    rewilson, Feb 24, 2004
    #11
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.