News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

PRINTER SETTINGS (again)

Started by SFA, July 03, 2015, 05:24:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SFA

Is there any way of saving all of the current printer settings to a file in order to recall them when needed?

My thoughts are running to DesignCAD macro and the windows command line but they have got no further!


SEMPER IN EXCRETIA

DrollTroll

I don't think BasicCAD has sufficient access to the Print settings; should be doable via Ole Automation though.
25 years with DesignCAD

SFA

DT,

Thank you very much.

Can anyone give me a clue (or an example of) how to drive Ole Automation?

SFA

SEMPER IN EXCRETIA

prl

Quote from: SFA on July 07, 2015, 01:21:57 AM
Can anyone give me a clue (or an example of) how to drive Ole Automation?

Not something for the occasional user.  If you are a programmer (with compiled programs), start here:

http://forum.designcad.com/index.php?topic=1537.0

SFA

Thank you.

This looks promising!

The PrintOption class exposes properties which allow the programmer to examine and change DesignCAD's print settings.

Hierarchy:
Application ® Documents ® Document ® PrintOption

The following code fragment demonstrates how to obtain a PrintOption object:

' Assumes DcDoc is a valid DesignCAD.Document object
Dim DcPrintOption As DesignCAD.PrintOption
Set DcPrintOption = DcDoc.PrintOption

·   For a more comprehensive code sample, please examine the PrintOption sample projects.


1) Can anyone point me towards the PrintOption sample projects?
2) Am I correct to assume I have to pass control from a DesignCAD macro to a program in some other language to use this feature?
3) If I am correct in 2) above which (free) programming language should I use?

Thank you,

Stan





SEMPER IN EXCRETIA

DrollTroll

Download and install the Developers Toolkit for designcad 13; the toolkit includes samples for Visual Basic 6, Delphi 5, and Visual C++ 6, including a sample project demonstrating the PrintOption class for each language.

Once you have built the sample program, you can add it as a custom menu entry or as a custom toolbar icon to run it directly from within DesignCAD, or (depending on how you programmed it) you may also be able to run it from a macro. Interaction of macros and OLE Automation tools can be a little bit tricky, so I'd recommend it be a stand-alone app.

For a free compiler, you can download and install Visual Studio Express for Windows Desktop: https://www.microsoft.com/en-us/download/details.aspx?id=44914
This will give a a free VB.NET compiler (VB.NET is a bit different than VB6, but we can walk you through any necessary changes to the VB6 sample app).

Or if you like Delphi/Pascal better, you can use Lazarus, a free Delphi-compatible Pascal compiler. One advantage of Delphi programs is their standalone nature -- once compiled, you don't need to have another user install a bunch of extra files just so they can run your application. This is definitely not true of any .NET applications you might build, as the end-user has to have the right version of .NET installed.

Lazarus download links and instructions:
http://forum.lazarus.freepascal.org/index.php/topic,28126.0.html?PHPSESSID=578d61e45b13893dc12b97bfdf7f7004
25 years with DesignCAD

SFA

SEMPER IN EXCRETIA

DrollTroll

You planning to use Lazarus or Visual Studio Express?
25 years with DesignCAD

SFA

DT,

I've got to keep it simple because it is a bit of a distraction from what I should be doing which is structural engineering design!

I hope to produce a stand-alone app. to store the printer settings and another to read them and restore them when necessary (or possibly 2 or 3 apps. to recreate the standard set ups I use). If I can get it to work, I will make them available to all. Lazarus would probably better if it compiles stand-alone files. Lazarus it is!

Thank you for your help.

Stan









SEMPER IN EXCRETIA

DrollTroll

See this topic:

http://forum.designcad.com/index.php?topic=6268.0

If you run into problems, please follow up in the SDK area of the board.

DT
25 years with DesignCAD

SFA

DT,

Thank you very much. I have no excuses now!

Stan
SEMPER IN EXCRETIA