Batch Plotting in Background

Discussion in 'AutoCAD' started by Matt W, Aug 18, 2004.

  1. Matt W

    Matt W Guest

    I've got a home-grown program that will batch plot a group of selected files
    to a user-defined location.
    Since the switch to 2005, I've received multiple requests to update this
    program to plot in the background.
    Soooo... my question is this: Can VBA plot drawings in the background and
    allow the user to continue working, and if so, how?!?

    Thanks in advance!
     
    Matt W, Aug 18, 2004
    #1
  2. See the docs on the Plot object.

    --
    R. Robert Bell


    I've got a home-grown program that will batch plot a group of selected files
    to a user-defined location.
    Since the switch to 2005, I've received multiple requests to update this
    program to plot in the background.
    Soooo... my question is this: Can VBA plot drawings in the background and
    allow the user to continue working, and if so, how?!?

    Thanks in advance!
     
    R. Robert Bell, Aug 18, 2004
    #2
  3. Matt W

    Matt W Guest

    I had a feeling you'd show up. :)

    Is there anything in particular that I should look for? (I know how
    "helpful" and "cryptic" the help files can be sometimes)

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | See the docs on the Plot object.
    |
    | --
    | R. Robert Bell
    |
    |
    | | I've got a home-grown program that will batch plot a group of selected
    files
    | to a user-defined location.
    | Since the switch to 2005, I've received multiple requests to update this
    | program to plot in the background.
    | Soooo... my question is this: Can VBA plot drawings in the background and
    | allow the user to continue working, and if so, how?!?
    |
    | Thanks in advance!
    |
    | --
    | Matt W
    |
    | The difference between genius and stupidity is that genius has its limits.
    |
    |
    |
     
    Matt W, Aug 18, 2004
    #3
  4. Matt W

    Matt W Guest

    I sure hope you weren't referring to the StartBatchMode or BatchPlotProgess
    because...from the help file:

    "Remarks
    This method is obsolete and may be removed in a future version of AutoCAD."

    I've tried setting the BackgroundPlot variable, but that didn't have any
    affect on my batch plotting program.

    So what the heck am I missing?!?


    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | See the docs on the Plot object.
    |
    | --
    | R. Robert Bell
    |
    |
    | | I've got a home-grown program that will batch plot a group of selected
    files
    | to a user-defined location.
    | Since the switch to 2005, I've received multiple requests to update this
    | program to plot in the background.
    | Soooo... my question is this: Can VBA plot drawings in the background and
    | allow the user to continue working, and if so, how?!?
    |
    | Thanks in advance!
    |
    | --
    | Matt W
    |
    | The difference between genius and stupidity is that genius has its limits.
    |
    |
    |
     
    Matt W, Aug 18, 2004
    #4
  5. Robert can correct me, but I think you're outta luck. Is it safe to assume
    that your app is opening the files? If so, then your app will always ride
    to the top regardless of the background setting - least that's my
    understanding although I haven't had a need to try it yet.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Aug 18, 2004
    #5

  6. --
    R. Robert Bell



    I had a feeling you'd show up. :)

    Is there anything in particular that I should look for? (I know how
    "helpful" and "cryptic" the help files can be sometimes)

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | See the docs on the Plot object.
    |
    | --
    | R. Robert Bell
    |
    |
    | | I've got a home-grown program that will batch plot a group of selected
    files
    | to a user-defined location.
    | Since the switch to 2005, I've received multiple requests to update this
    | program to plot in the background.
    | Soooo... my question is this: Can VBA plot drawings in the background and
    | allow the user to continue working, and if so, how?!?
    |
    | Thanks in advance!
    |
    | --
    | Matt W
    |
    | The difference between genius and stupidity is that genius has its limits.
    |
    |
    |
     
    R. Robert Bell, Aug 18, 2004
    #6
  7. Matt W

    Matt W Guest

    I found that shortly after my last post.
    I wasn't using the correct combination of key words before.

    Thanks!

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    |
    |
    |
    | --
    | R. Robert Bell
    |
    |
    |
    | | I had a feeling you'd show up. :)
    |
    | Is there anything in particular that I should look for? (I know how
    | "helpful" and "cryptic" the help files can be sometimes)
    |
    | --
    | Matt W
    |
    | The difference between genius and stupidity is that genius has its limits.
    | | | See the docs on the Plot object.
    | |
    | | --
    | | R. Robert Bell
    | |
    | |
    | | | | I've got a home-grown program that will batch plot a group of selected
    | files
    | | to a user-defined location.
    | | Since the switch to 2005, I've received multiple requests to update this
    | | program to plot in the background.
    | | Soooo... my question is this: Can VBA plot drawings in the background
    and
    | | allow the user to continue working, and if so, how?!?
    | |
    | | Thanks in advance!
    | |
    | | --
    | | Matt W
    | |
    | | The difference between genius and stupidity is that genius has its
    limits.
    | |
    | |
    | |
    |
    |
    |
     
    Matt W, Aug 18, 2004
    #7
  8. Matt W

    Matt W Guest

    That's exactly what it's doing, Mike.
    Am I outta luck??

    I mean... how else am I supposed to obtain the drawing name and it's layout
    tabs?? I'd use ObjectDBX but you can't plot using that, unless they've
    updated it (I haven't checked).

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Robert can correct me, but I think you're outta luck. Is it safe to assume
    | that your app is opening the files? If so, then your app will always ride
    | to the top regardless of the background setting - least that's my
    | understanding although I haven't had a need to try it yet.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Aug 18, 2004
    #8
  9. You can load a drawing and not make it active, and use the Plot object to
    plot in the background. However, the drawing is loaded in the editor (just
    don't make it the ActiveDocument).

    --
    R. Robert Bell


    That's exactly what it's doing, Mike.
    Am I outta luck??

    I mean... how else am I supposed to obtain the drawing name and it's layout
    tabs?? I'd use ObjectDBX but you can't plot using that, unless they've
    updated it (I haven't checked).

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Robert can correct me, but I think you're outta luck. Is it safe to assume
    | that your app is opening the files? If so, then your app will always ride
    | to the top regardless of the background setting - least that's my
    | understanding although I haven't had a need to try it yet.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    R. Robert Bell, Aug 18, 2004
    #9
  10. Matt W

    Matt W Guest

    I'm starting to think this is going to be more work than it's worth.

    Thanks for the feedback, guys.

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | You can load a drawing and not make it active, and use the Plot object to
    | plot in the background. However, the drawing is loaded in the editor (just
    | don't make it the ActiveDocument).
    |
    | --
    | R. Robert Bell
    |
    |
    | | That's exactly what it's doing, Mike.
    | Am I outta luck??
    |
    | I mean... how else am I supposed to obtain the drawing name and it's
    layout
    | tabs?? I'd use ObjectDBX but you can't plot using that, unless they've
    | updated it (I haven't checked).
    |
    | --
    | Matt W
    |
    | The difference between genius and stupidity is that genius has its limits.
    | | | Robert can correct me, but I think you're outta luck. Is it safe to
    assume
    | | that your app is opening the files? If so, then your app will always
    ride
    | | to the top regardless of the background setting - least that's my
    | | understanding although I haven't had a need to try it yet.
    | |
    | | -- Mike
    | | ___________________________
    | | Mike Tuersley
    | | CADalyst's CAD Clinic
    | | Rand IMAGINiT Technologies
    | | ___________________________
    | | the trick is to realize that there is no spoon...
    |
    |
    |
     
    Matt W, Aug 18, 2004
    #10
  11. The other option is buy another seat of AutoCAD and set iit up on an unused
    workstation. Have your user's request processed by the unattended
    workstation. Very siimple to do and the extra cost has a quick ROI.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Aug 19, 2004
    #11
  12. Nice Robert! Knew you'd pick me up=) Guess I should follow my own advice
    and read the help file - goes against the grain kinda like reading
    instructions before attempting to assemble.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Aug 19, 2004
    #12
  13. Matt W

    Matt W Guest

    Whaaa...???

    Okay, now that you've peaked my interest... how would I go about doing
    that??!?


    Matt W

    The difference between genius and stupidity is that genius has its limits.

    | The other option is buy another seat of AutoCAD and set iit up on an
    unused
    | workstation. Have your user's request processed by the unattended
    | workstation. Very siimple to do and the extra cost has a quick ROI.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Aug 19, 2004
    #13
  14. Ok, first I'd use full vb if you have it, if not vba will work. The rules
    are few ad simple:

    1. The server [unattended workstation] needs AutoCAD
    2. It is assumed to have access to ALL files, req'd directories, etc.
    3. Access to all printers

    Then you need to figure out how it can see all files. Best thing to do is
    make the rule that only files stored on the network will be plotted. If
    users store locally it could still work but it means you'll have to copy
    files to the server then handle deleting them. Gets extremely ugly if you
    have xrefs.

    Then you need to decide how best to let the server know what/where/when/how
    to plot what. Easiest 2 methods are a backend database like Access or
    passing text files. If Access or other db, have the client app write to a
    table. This table would contain the info necessary to plot - file name,
    printer name, paper size, etc. Then have your vb app monitor the table for
    new entries by using a timer. If its vba, and Access, either use the timer
    or write code for the row added event. Using vba would require Access to
    always be open. If you use text files, same scenario except the thing to
    watch is for new text files dropped into a specific directory - the text
    files would obviously contain the info already mentioned in some sort of
    delimited format. If vba, the watcher could be from the AutoCAD printing
    piece running in AutoCAD.

    Now, just open the files and print them like you're already doing.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Aug 19, 2004
    #14
  15. Matt W

    Matt W Guest

    Of course!! I knew it was something simple. ;)
    Okay... but how do I have one PC talk to another across the network,
    nevermind accessing AutoCAD and running a program.
    (Bear with me... This is new territory I'm entering here)

    Let's say the server computer's name that would be doing the plotting is
    Server (simple enough).
    And the other computer names are Client1, Client2, Client3, etc... How do
    those "connect" to Server? And if Server already has AutoCAD open and is
    plotting, how would one of the clients know? Or should another session of
    AutoCAD automatically fire up and start printing?? Then... how would Server
    notify the client that printing is done? All files would be plotted from
    the network.

    This sounds like it might be worthwhile to write, but I want to get a little
    more information before pulling the trigger on this one.

    Thanks in advance!

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Ok, first I'd use full vb if you have it, if not vba will work. The rules
    | are few ad simple:
    |
    | 1. The server [unattended workstation] needs AutoCAD
    | 2. It is assumed to have access to ALL files, req'd directories, etc.
    | 3. Access to all printers
    |
    | Then you need to figure out how it can see all files. Best thing to do is
    | make the rule that only files stored on the network will be plotted. If
    | users store locally it could still work but it means you'll have to copy
    | files to the server then handle deleting them. Gets extremely ugly if you
    | have xrefs.
    |
    | Then you need to decide how best to let the server know
    what/where/when/how
    | to plot what. Easiest 2 methods are a backend database like Access or
    | passing text files. If Access or other db, have the client app write to a
    | table. This table would contain the info necessary to plot - file name,
    | printer name, paper size, etc. Then have your vb app monitor the table for
    | new entries by using a timer. If its vba, and Access, either use the timer
    | or write code for the row added event. Using vba would require Access to
    | always be open. If you use text files, same scenario except the thing to
    | watch is for new text files dropped into a specific directory - the text
    | files would obviously contain the info already mentioned in some sort of
    | delimited format. If vba, the watcher could be from the AutoCAD printing
    | piece running in AutoCAD.
    |
    | Now, just open the files and print them like you're already doing.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Aug 19, 2004
    #15
  16. <bah> Real Men Don't Read Docs! <vbg>

    --
    R. Robert Bell


    Nice Robert! Knew you'd pick me up=) Guess I should follow my own advice
    and read the help file - goes against the grain kinda like reading
    instructions before attempting to assemble.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    R. Robert Bell, Aug 19, 2004
    #16
  17. Mike mentioned having the clients write data to a database. The server polls
    the database and works on new records it finds there.

    --
    R. Robert Bell


    Of course!! I knew it was something simple. ;)
    Okay... but how do I have one PC talk to another across the network,
    nevermind accessing AutoCAD and running a program.
    (Bear with me... This is new territory I'm entering here)

    Let's say the server computer's name that would be doing the plotting is
    Server (simple enough).
    And the other computer names are Client1, Client2, Client3, etc... How do
    those "connect" to Server? And if Server already has AutoCAD open and is
    plotting, how would one of the clients know? Or should another session of
    AutoCAD automatically fire up and start printing?? Then... how would Server
    notify the client that printing is done? All files would be plotted from
    the network.

    This sounds like it might be worthwhile to write, but I want to get a little
    more information before pulling the trigger on this one.

    Thanks in advance!

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Ok, first I'd use full vb if you have it, if not vba will work. The rules
    | are few ad simple:
    |
    | 1. The server [unattended workstation] needs AutoCAD
    | 2. It is assumed to have access to ALL files, req'd directories, etc.
    | 3. Access to all printers
    |
    | Then you need to figure out how it can see all files. Best thing to do is
    | make the rule that only files stored on the network will be plotted. If
    | users store locally it could still work but it means you'll have to copy
    | files to the server then handle deleting them. Gets extremely ugly if you
    | have xrefs.
    |
    | Then you need to decide how best to let the server know
    what/where/when/how
    | to plot what. Easiest 2 methods are a backend database like Access or
    | passing text files. If Access or other db, have the client app write to a
    | table. This table would contain the info necessary to plot - file name,
    | printer name, paper size, etc. Then have your vb app monitor the table for
    | new entries by using a timer. If its vba, and Access, either use the timer
    | or write code for the row added event. Using vba would require Access to
    | always be open. If you use text files, same scenario except the thing to
    | watch is for new text files dropped into a specific directory - the text
    | files would obviously contain the info already mentioned in some sort of
    | delimited format. If vba, the watcher could be from the AutoCAD printing
    | piece running in AutoCAD.
    |
    | Now, just open the files and print them like you're already doing.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    R. Robert Bell, Aug 19, 2004
    #17
  18. Matt W

    Matt W Guest

    This is *definitely* more trouble than it's worth (for us anyways).
    I haven't written too much with DBs so I don't want to waste my time trying
    to learn that right now.

    Thanks for the info, guys!
     
    Matt W, Aug 19, 2004
    #18
  19. Don't give up that easy! =)

    The second option is to pass text files. First, the client app DOESN'T need
    to know or care if anything is currently plotting!

    From the client's perspective, write it so it gathers all the pertinent
    data and writes it to a text file using some kind of delimination - I like
    pipes "|". Then make sure you create the file in a shared directory on the
    "server".

    From the server's perspective, create a timer - either the form control or
    write one via WIN32 API. On the timed interval, stop the timer and have
    your code run to check for files in the directory the server is sharing.
    Store the file names to an array or collection and use them to batch plot
    one after the other. Make sure to delete the text file when done. After all
    plotting is done, turn back on the timer.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Aug 19, 2004
    #19
  20. Matt W

    Matt W Guest

    Hmmmm....

    What did you mean by this..."On the timed interval, stop the timer and have
    your code run to check for files in the directory the server is sharing."
    Are you saying that the timer should have pre-set times that it would stop
    and check for files, say, every 10 minutes??


    I still don't know if this would be very beneficial to the company, but now
    I'm thinking about taking a stab at it just because.

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Don't give up that easy! =)
    |
    | The second option is to pass text files. First, the client app DOESN'T
    need
    | to know or care if anything is currently plotting!
    |
    | From the client's perspective, write it so it gathers all the pertinent
    | data and writes it to a text file using some kind of delimination - I like
    | pipes "|". Then make sure you create the file in a shared directory on the
    | "server".
    |
    | From the server's perspective, create a timer - either the form control or
    | write one via WIN32 API. On the timed interval, stop the timer and have
    | your code run to check for files in the directory the server is sharing.
    | Store the file names to an array or collection and use them to batch plot
    | one after the other. Make sure to delete the text file when done. After
    all
    | plotting is done, turn back on the timer.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Aug 19, 2004
    #20
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.