Handling different prompts - plot command?

Discussion in 'AutoCAD' started by mkaufhold, Dec 9, 2004.

  1. mkaufhold

    mkaufhold Guest

    Having some trouble here. I am using lisp to print drawings to the user's default printer. There are about three different printers we use. Two of them require that you enter "11x17" to print on 11 x 17 paper and the other requires that you enter it as "11x17 (11 x 17 in.)"

    Without messing around with the paper sizes for the printers or changing any other printer settings, is there another way I can do this? I tried retrieving the name of the default printer using the code below (that way I could enter the responses based on which printer the job would go to) but for some reason it does not return the name of the default, it gives me the name of another printer. I've tried it over and over and rechecked my default...no luck.

    (vla-get-defaultoutputdevice (vla-get-output (vla-get-preferences (vlax-get-acad-object))))

    Any help would be greatly appreciated! TIA.
    Marti
     
    mkaufhold, Dec 9, 2004
    #1
  2. mkaufhold

    mkaufhold Guest

    And actually I guess this isn't handling different prompts, I just need a good way to give different responses to the same prompt...
     
    mkaufhold, Dec 9, 2004
    #2
  3. mkaufhold

    RDI Guest

    I don't know the answer--but I can confirm that I was able to reproduce
    this. I have about 10 printers installed on my PC. Rather than spell them
    all out, I'll just call them A, B, D etc.

    * My default printer (windows level default) is A.
    * In acad's config dialog my default printer is B.
    * When I start a new dwg file and start page petup, it says "None" in
    plotter.
    * But when I run your code, it returns C. Guess what--C was NEVER my
    default printer at any level and was VERY rarely ever used to print from
    acad..


    default printer. There are about three different printers we use. Two of
    them require that you enter "11x17" to print on 11 x 17 paper and the other
    requires that you enter it as "11x17 (11 x 17 in.)"
    any other printer settings, is there another way I can do this? I tried
    retrieving the name of the default printer using the code below (that way I
    could enter the responses based on which printer the job would go to) but
    for some reason it does not return the name of the default, it gives me the
    name of another printer. I've tried it over and over and rechecked my
    default...no luck.
     
    RDI, Dec 9, 2004
    #3
  4. mkaufhold

    BillZ Guest

    Code:
    ;;04/09/04 Bill Zondlo -received from AutoDesk NG
    ;;programming examples to get plotter info
    ;;
    (defun get_plotter_names ()
    (vla-RefreshPlotDeviceInfo (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
    (vlax-safearray->list
    (vlax-variant-value
    (vla-getplotdevicenames
    (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object)))))) ;gets list of installed plotters
    ) 
    Code:
    ;;04/09/04 Bill Zondlo -received from AutoDesk NG
    ;;programming examples to get plotter info
    ;;
    (defun get_paper_sizes ()
    (vla-RefreshPlotDeviceInfo (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
    (vlax-safearray->list
    (vlax-variant-value
    (vla-getCanonicalMediaNames
    (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object)))))) ;gets all media names
    )
    Bill
     
    BillZ, Dec 10, 2004
    #4
  5. mkaufhold

    mkaufhold Guest

    Thanks to both for your help. I really appreciate it.

    And Bill, those are both great. They are not exactly what I was looking for, but I will definitely put them to use if I don't come up with anything else. =)
     
    mkaufhold, Dec 10, 2004
    #5
  6. mkaufhold

    BillZ Guest

    You're welcome,

    I didn't use them much myself but they helped me figure out what I needed to do here. :)

    Bill
     
    BillZ, Dec 10, 2004
    #6
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.