Author Topic: how to add a printer for cad by using lisp program?  (Read 1948 times)

0 Members and 1 Guest are viewing this topic.

taner

  • Guest
how to add a printer for cad by using lisp program?
« on: March 11, 2008, 12:58:27 AM »
Dear all
how  to add a printer for cad by using lisp program?
tks

Patrick_35

  • Guest
Re: how to add a printer for cad by using lisp program?
« Reply #1 on: March 11, 2008, 08:39:23 AM »
Hi

An example
Code: [Select]
(setq wsn (vlax-create-object "WScript.Network"))
(vlax-invoke wsn 'AddWindowsPrinterConnection "\\\\Server_name\\Printer_name")
(vlax-release-object wsn)

@+

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: how to add a printer for cad by using lisp program?
« Reply #2 on: March 11, 2008, 09:44:36 AM »
Be sure to add (vl-load-com) any time use use vla vlax or vlr functions to load the ActiveX support.
You only need to call it once but you must call it for the functions to be available.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: how to add a printer for cad by using lisp program?
« Reply #3 on: March 11, 2008, 01:27:53 PM »
Be sure to add (vl-load-com) any time use use vla vlax or vlr functions to load the ActiveX support.

Sort of a side-topic, but why doesn't Autodesk just remove that requirement and add the necessary libraries in the core program...? At the very least, they could add (vl-load-com) to acad200x.lsp

septicad

  • Guest
Re: how to add a printer for cad by using lisp program?
« Reply #4 on: March 19, 2008, 12:30:29 PM »
Is there a way to create a list of the currently installed printers in LISP - and then also determine their associated paper sizes?

To better understand my issue: See a quick movie demostration here of my DCL/LISP code: http://www.septicad.com/temp/sprint.html  [ignore the truetype issues with the latest Bricscad release].

Currently, the user has to physically enter the PrinterName and PaperName, which is cAseSensitIVe - (i.e. hp DeskJet xxx, Letter 8.5" x 11").  The variation in paper size naming from printer to printer is rediculous (Letter - vs - 8.5" x 11" letter size...  Of course the user only has to do this once (its stored in a text file for further use), but still... its a pain to answer these support calls if I don't need to...

Thanks in advance

Steve Marcotte
SeptiCAD.com