prakashreddy Posted March 29, 2012 Posted March 29, 2012 (defun c:A4 () (COMMAND "-PLOT" "Y" " " "PRINTER + COPIER" "A4" "M" "LANDSCAPE" "N" "E" "fit" "center" "Y" "monochrome.ctb" "N" "W" "n" "n" "y" "zoom" "e" "qsave") ) When I type "A4" in command prompt automatically print will go. Above "PRINTER + COPIER" is the printer name. But that is changed to "\\dc\utax_csd". I replaced the same text in above. but, because of the single back slash ("\") it is not working. i mean when iam using this string in lisp the single back slash ("\") is disappearing and it giving new string as "\\dcuutax_csd".. Finally error is coming with Printer name not matching. How i can overcome this one.....Can any one help me... Quote
BIGAL Posted March 30, 2012 Posted March 30, 2012 A bit more you can have the same problem with directory names the \\ implies a single \ to be used, so \\\\ would be two \\ thanks to those who helped previously. Quote
prakashreddy Posted March 30, 2012 Author Posted March 30, 2012 Use "\\\\dc\\utax_csd" Thanks Mr lee But i tried to keep like this but this also not working. If i keep two Back slashes ("\\") the out put will come as same, if i keep three one is reducing, if i keep single it vanishing. Quote
pBe Posted March 30, 2012 Posted March 30, 2012 Use"\\\\dc\\utax_csd" X2 Should work with no problem. unless you mispelled the printer name Quote
MSasu Posted March 30, 2012 Posted March 30, 2012 In my opinion, a more reliable solution is to create a PC3 setup file for that printer and use it to address the device in your code. That way, when the printer is changed, you will have to modify only one thing. Regards, Mircea Quote
pBe Posted March 30, 2012 Posted March 30, 2012 in that case: This will give you a list of the PC3 names (vl-directory-files (vla-get-PrinterConfigPath (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "*.pc3" 1) Quote
Lee Mac Posted March 30, 2012 Posted March 30, 2012 But i tried to keep like this but this also not working. If i keep two Back slashes ("\\") the out put will come as same, if i keep three one is reducing, if i keep single it vanishing. To better understand why the extra backslash is needed, read the following: Escape Characters Escape Sequences in literal strings For fun: Leaning Toothpick Syndrome Quote
prakashreddy Posted April 1, 2012 Author Posted April 1, 2012 I am going like this... (setq def_printer_name (vla-get-defaultoutputdevice (vla-get-output (vla-Get-Preferences (vlax-get-acad-object))))) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.