Printing Automation

#1
choice i would like to automate. I know i can save the icad info in a pcp file but can I automate selection of the paper and layout (landscape). I understand that this is out of icad, but is it still possible with say vba?

Thx

b

#2
braan_h,

When it comes to printing/plotting VBA offers total control.

A class called PlotManager has the following methods:
ExportPlotProperties
ImportPlotProperties
GetPaperSize
SetPapersize
GetWindow
SetWindow
Preview
Print

and the following Properties:
Area
CentreOnPage
Footer
Header
HideLines
OnlyWindowArea
PlotProperties
PaperOrientation
View

In the PlotProperties class you can use all the settings on the Print Dialog such as scale, OriginX, OriginY etc.

And if if you want more, VBA can access the Windows API functions and change your printer setup - print - then reset or even change the default printer based on any criteria you want.

The only caution is that I have not tried all of the PrintManager and PlotProperties methods and properties and can't confirm they all work correctly. I will be covering this topic later in my VBA tutorials and will try out all these prior to posting.



------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au

#3
John,

Have you done anymore on this topic. This would really come in handy.

With VBA can I control the paper size in my printer driver properties??

Thank you,

Scott

#4
Hi John,

I would also like to see an example of plot automation using VBA.
Back in the good ol' R14 days I used to have and automated system where by the user had an option to hit the autoplot (that's what I named it) button. By using a flag to identify the title block combined with lisp files, autospool scripts, pcp files and what have you (I can't even remember now), anyone in the office could send a perfect plot everytime, even if they knew nothing about CAD. A strict "One drawing One file" rule is also necessary for this system to work.

Now with Icad and AutoCAD 2000 using the Windows printing system, my plot automation system died a instant death, mainly because I could no longer send the plot to the appropriate plotter or printer.

I guess I'd mainly like to see how you select and change the settings of the available printers and plotters on a network.

Thanks

#5
I am having a hard time using the PlotManager properties. It get errors when I try to use getpapersize, setpaparsize.

Dim mypltman As IntelliCAD.PlotManager 'Help file says to use ThisDocument, which does not appear to be available

Dim mywidth As Double
Dim mylength As Double

Set mypltman=IntelliCAD.Application.PlotManager

mypltman.GetPaperSize(mylength, mywidth)

This gives error "Expected function or variable" at GetPaperSize. SetPaperSize will give an error also.

What am I doing wrong? Do I have objects pointing incorrectly?

Thank you for your help,

Scott

#6
Scott,

It looks like there is still some work to do on the PlotManager Object.

Your error "Expected function or variable" is caused by enclosing the arguments in quotes.

eg.
mypltman.GetPaperSize(mylength, mywidth)

Should be :
mypltman.GetPaperSize mylength, mywidth

ICAD uses the Windows default printer settings and I think you will need to use API calls to obtain the settings you need.



------------------
Regards
John Finlay

#7
John,

Thank you for the reply.

If this is used mypltman.GetPaperSize mylength, mywidth

An error is generated stating "Object doesn't support this action".

I will try using API calls.

Thank you again

Scott