DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Macros to set printing parameters

Started by guest, July 11, 2013, 08:04:27 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

guest

Can anyone tell me the necessary SYS($) functions to

select a printer?
select the paper size?
print in monochrome/colour?

Or am I barking up the wrong tree?

Thank you in anticipation.

Stan Fyffe

prl

Stan,

Scanning the version 17 macros help file, I didn't find sys() or sys$() codes for the things you have listed.

If you have a compiler (Delphi, VisualBasic, etc.),  the version 17 OLE SDK does have a PrintOption class that has all of these items.



guest

#2
prl,

Thank you for your help. I do not have a compiler so I will have to keep on trying with the macros.

dcadRob

I have not tried doing it in a macro but this link shows how to do a variety of things using command line. It might be possible to set properties the way you want and then reset when your macro is done.
http://www.robvanderwoude.com/2kprintcontrol.php

guest

#4
Rob,

That is great. Thank you.

My only problem is I am struggling to get the syntax correct for the RUN command.  This does not work.

RUN "cmd.exe /c RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "cutePDF Writer""

Can you advise? Thank you again.

Stan


prl

Quote from: [email protected] on July 12, 2013, 12:21:34 AM
RUN "cmd.exe /c RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "cutePDF Writer""

Looks like you need to build the cmdline string in several steps. 


.
.
.
q$="""
a$ = "/c RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "
b$=q$+"cutePDF Writer"+q$

'build the total cmdline string and check it first
total$=a$+b$
message total$

cmdline total$
run "cmd.exe"
.
.
.

DrollTroll

PrintBlackAndWhite is an option that will be available to both BasicCAD and OLE Automation in version 23.
25 years with DesignCAD

[email protected]

Thank you all. You have cracked it. I could never have got there in a month of Sundays!

This bit of code now runs through my various printers in turn setting each as default.

Stan


for i = 1 to 4
if i=1 then mac$="cutePDF Writer"
if i=2 then mac$="Send To OneNote 2010"
if i=3 then mac$="PaperPort Image Printer"
if i=4 then mac$="Brother DCP-6690CW Printer"

q$="""
a$ = "/c RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "
b$=q$+mac$+q$

'build the total cmdline string and check it first
total$=a$+b$
message total$

cmdline total$
run "cmd.exe"

next  i



Lar

Stan, I'll advise against you using your email as your username on this or any forum.

Lar