Changing Printer Support File Path via Lisp

Discussion in 'AutoCAD' started by Jorge Z, Jul 16, 2003.

  1. Jorge Z

    Jorge Z Guest

    Any ideas on this matter? I have the adding the support path thing figured
    out, but not sure of the Printer Support file path. The reason i ask is that
    we're planing on moving to a network based .pc3, .pmp, .ctb system and I'm
    looking for a quick fix. for our 50+ machines. Thanks in advance

    Jorge
     
    Jorge Z, Jul 16, 2003
    #1
  2. If you use the same printer name when you install the printers on each
    computer, the you should be able to use the same pc3 for all systems to
    access the same printer as well as share page setup names.

    Dave Alexander
     
    Dave Alexander, Jul 16, 2003
    #2
  3. check out these functions

    vla-get-printerconfigpath
    vla-put-printerconfigpath
     
    Jason Piercey, Jul 16, 2003
    #3
  4. Jorge Z

    Jorge Z Guest

    We have that now, but everyone works localy. We're moving to a network based
    location for pc3's, and ctbs. I was just wondering if anyone had any coding
    in lisp to do this with a lisp routine other than me having to go into each
    pc and set up the paths.

    Jorge
     
    Jorge Z, Jul 16, 2003
    #4
  5. Jorge Z

    Jorge Z Guest

    I'm new to visual lisp Jason.. Would you happen to have the full/part code
    for what i want to do laying around?

    Jorge
     
    Jorge Z, Jul 16, 2003
    #5
  6. This would be one way to handle it

    ; [path] - string, path to apply
    ; return: t or nil
    (defun putPrinterConfigPath (path)
    (not
    (vl-catch-all-error-p
    (vl-catch-all-apply
    (function
    (lambda ()
    (vla-put-printerConfigPath
    (vla-get-files
    (vla-get-preferences
    (vlax-get-acad-object)
    )
    )
    path
    )
    )
    )
    )
    )
    )
    )

    ; use like so: (putPrinterConfigPath "Your\\Path\\Here")
     
    Jason Piercey, Jul 16, 2003
    #6
  7. Jorge,

    I still don't see what the problem is. As each person logs on the work
    station, they just set the path. They should know how to do this anyway. If
    no one is using the work station, who cares. When it is used, then set the
    path. In fact, you can ignor it until someone needs to plot. Then they can
    set the path.

    Dave Alexander
     
    Dave Alexander, Jul 16, 2003
    #7
  8. Jorge Z

    Jorge Z Guest

    have one for the DRV and CTB path too? Thanks for the other one.. Works
    great.

    Jorge.

     
    Jorge Z, Jul 16, 2003
    #8
  9. Jorge Z

    Jorge Z Guest

    Complete agree with you Jason. If anyone other than CADD Management was
    modifying/cuctomizing the Acad platform, we would be spending alot more time
    re-installing autocad on their PC's. :D

    Jorge..
     
    Jorge Z, Jul 16, 2003
    #9
  10. Jason,
    I think you have to allow your "folks" some participation in your system.
    The knowledge of how to set a path to a ctb or pc3 should not be a big
    thing. If not, then you may not be getting the best out of them. The worst
    thing that can happen is to work with people that do exactly what you tell
    them to do because that is "all" that they will do.

    Dave Alexander
     
    Dave Alexander, Jul 17, 2003
    #10
  11. Did not test them but they should work.

    ; [path] - string, path to apply
    ; return: t or nil
    (defun putPrinterDescPath (path)
    (not
    (vl-catch-all-error-p
    (vl-catch-all-apply
    (function
    (lambda ()
    (vla-put-printerDescPath
    (vla-get-files
    (vla-get-preferences
    (vlax-get-acad-object)
    )
    )
    path
    )
    )
    )
    )
    )
    )
    )

    ; [path] - string, path to apply
    ; return: t or nil
    (defun putPrinterCtbPath (path)
    (not
    (vl-catch-all-error-p
    (vl-catch-all-apply
    (function
    (lambda ()
    (vla-put-printerStyleSheetPath
    (vla-get-files
    (vla-get-preferences
    (vlax-get-acad-object)
    )
    )
    path
    )
    )
    )
    )
    )
    )
    )

    or you could combine them all into one routine for updating
    the plotter information, just hard code the paths and you are set.

    ; return t or nil
    (defun mySetup ()
    (and
    (or *acad* (setq *acad* (vlax-get-acad-object)))
    (or *pref* (setq *pref* (vla-get-preferences *acad*)))
    (not
    (vl-catch-all-error-p
    (vl-catch-all-apply
    (function
    (lambda ()
    (vla-put-printerConfigPath *pref* "Your\\Path\\Here"); .pc3 location
    (vla-put-printerDescPath *pref* "Your\\Path\\Here"); driver path
    (vla-put-printerStyleSheetPath *pref* "Your\\Path\\Here"); ctb path
    )
    )
    )
    )
    )
    )
    )
     
    Jason Piercey, Jul 17, 2003
    #11
  12. Dave,

    I am not against educating users, I'll often teach them as
    much as they want to learn, provided I know what I am
    talking about <g>.

    I just feel that some system settings should not be messed
    with, (granted, ctb paths will not cause major havoc) or I'll
    end up with...."Why isn't this working like it used to?", "No,
    I didn't change anything" but in reality, they did.... sometimes
    it can just lead to wasting more time than anything.

    Oh, and we have had some of those "I do nothing more than
    I am told to do" type employees. Very frustrating! If a certain
    person shows interest and I personally feel they can handle it
    then I'll show them all I have "under the hood".
     
    Jason Piercey, Jul 17, 2003
    #12
  13. Jason,

    Thought as much but felt I had to say something anyway.

    Dave Alexander
     
    Dave Alexander, Jul 17, 2003
    #13
  14. I hear ya.
     
    Jason Piercey, Jul 17, 2003
    #14
  15. Jorge Z

    morrisde Guest

    &nbsp;(setenv "PrinterConfigDir" &lt;pc3 path&gt;)
    &nbsp;(setenv "PrinterDescDir" &lt;pmp path&gt;)
    (setenv "PrinterStyleSheetDir" &lt;ctb path&gt;)

    Make sure you use either \\ or / for folder separators. We use the same folder for all three, it seems to work just fine, and it's pretty simple, just a folder called n:/printing (n: is our support drive).
    Regards,
    Dave
     
    morrisde, Jul 17, 2003
    #15
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.