Results 1 to 7 of 7

Thread: Getting the Windows Default Printer

  1. #1
    Active Member Mike hacker's Avatar
    Join Date
    2000-11
    Location
    London
    Posts
    64
    Login to Give a bone
    0

    Default Getting the Windows Default Printer

    via a lisp. Any help would be very welcome.

    What we are trying to acheive is a one click print button. Pick the icon and it will send the current drawing to fit to A3 to your Windows default printer.

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Getting the Windows Default Printer

    If you can use VBA instead of lisp, take a look at http://jtbworld.blogspot.com/2006/01...using-vba.html
    R.K. McSwain | CAD Panacea |

  3. #3
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    0

    Default Re: Getting the Windows Default Printer

    This may get you closer to your goal:
    Code:
    (setq prn "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
          prn (vl-registry-read prn "Device")
          prn (substr prn 1 (vl-string-search "," prn)))
    Last edited by CAB2k; 2006-09-28 at 02:20 PM.

  4. #4
    100 Club
    Join Date
    2004-12
    Posts
    153
    Login to Give a bone
    0

    Default Re: Getting the Windows Default Printer

    here's what i did to achieve that. I made sure i had the .pc3 file all setup first through the add a plotter wizard in the options dialog box. Then i ran a plot through the normal plot window, and made sure to apply it to the layout. Then run -plot and say yes to the detailed configuration. Since you applied to layout the first time through all the settings should be set according to what you want it to look like, and then just copy and paste all of the info in the < >. Here's what it looks like


    (defun plot2436()
    (command "-plot" "y" "" "Oce 9400.pc3" "ARCH expand D (24.00 x 36.00 Inches)" "i" "L" "N" "W" "0.000000,0.000000" "36.000000,24.000000" "1:1" "C" "Y" "Pens - 24x36.ctb" "Y" "N" "N" "N" "N" "Y" "Y"))

    Hope this helps.

  5. #5
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Getting the Windows Default Printer

    We import a page setup and set it current to perform our one button plot to files, the modification only runs when the title block is located at 0,0 and the layout tab uses the proper naming convention for our plot files. Then we plot using the following options:

    Code:
    	   (command ".-PLOT"
    		"N"						 ;Detailed plot configuration? [Yes/No] <No>: N
    		 ""						   ;Enter a layout name or [?] <Layout1>:
    		 pagesetup		  ;Enter a page setup name <>:
    		 ""						   ;Enter an output device name or [?] <current>:
    		 "y"						  ;Write the plot to a file [Yes/No] <N>: y
    		 file						 ;Enter file name <maverickengineeringx5405RCp01001-Layout1.PLT>:
    		 "y"						  ;Save changes to page setup [Yes/No]? <N> n
    		 "y"						  ;Proceed with plot [Yes/No] <Y>:
    )									  ;end command
    The items in red are variables that were defined earlier in the program, however if you select "N" for plot to file the options leave out that line.

    The best way to write something like this is to follow the prompts for (-plot) it will put all the options on the command line

  6. #6
    I could stop if I wanted to
    Join Date
    2015-08
    Posts
    263
    Login to Give a bone
    0

    Default Re: Getting the Windows Default Printer

    Quote Originally Posted by m.f.hacker
    via a lisp. Any help would be very welcome.

    What we are trying to acheive is a one click print button. Pick the icon and it will send the current drawing to fit to A3 to your Windows default printer.
    I use functions of DOSLIB from www.mcneel.com to access default printer, get all the printers or set a specific printer as default.

    Regards,

    Abdul Huck

  7. #7
    Active Member Mike hacker's Avatar
    Join Date
    2000-11
    Location
    London
    Posts
    64
    Login to Give a bone
    0

    Default Re: Getting the Windows Default Printer

    Quote Originally Posted by CAB2k
    This may get you closer to your goal:
    Code:
    (setq prn "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
          prn (vl-registry-read prn "Device")
          prn (substr prn 1 (vl-string-search "," prn)))
    That did the trick. Thank you.

Similar Threads

  1. Default Printer Setting
    By studio3p in forum Revit Architecture - General
    Replies: 19
    Last Post: 2019-10-11, 05:24 PM
  2. Default Printer when opening drawing with unrecognized printer
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2014-05-19, 10:45 AM
  3. Revit should have its own default printer
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2008-12-01, 08:41 PM
  4. Default Printer Management
    By thomas.stright in forum Software
    Replies: 0
    Last Post: 2007-08-21, 12:37 PM
  5. Setting of Default Printer
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2006-08-21, 04:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •