I have a simular problem with PlotToDevice - see my post of
14-04-2005.
Stll no solution, so productivity is down with 99% with this.....
wrote in message news:4892277@discussion.autodesk.com...
Hi,
my app permits to the users select multiple DWG files, inserting them
into a MSHFLEXGRID.
After this the user can select a DWT file and store in a matrix (PC)
all its AcadPlotConfigurations.
The user can select distinct Page Layout for each DWG file selected.
Then running the code below, each file is opened in ACAD and then
printed using the specific Page Layout.
This was running very good in ACAD 2002. After migrate to ACAD 2005
only the first file is printed. The others DWG files return FALSE to
the PlotToDevice command.
Is it missing some command ?
Does ACAD 2005 need anything extra to run ?
Obs: the DWT Page Layouts were created for MODELs and the files to be
printed are using only the model space too.
Please, take a look in the code below
TIA,
Tácito Fieker
CADGRAPH
'################################
' PLOT SAMPLE
'################################
Dim PC() As AcadPlotConfiguration
Private Sub Plot_Click()
Dim Layout As AcadLayout
Dim LayoutBase As AcadLayout
Dim indice As Integer
Dim retorno As Boolean
Dim row As Integer
Dim j As Integer
' READ THE DWG FILES IN THE FLEXGRID
For row = 1 To MSHFlexGrid1.Rows - 1
retorno = False
MSHFlexGrid1.col = 0
MSHFlexGrid1.row = row
' OPEN A FILE
MSHFlexGrid1.col = 0
ThisDrawing.Application.Documents.Open (MSHFlexGrid1.Text)
' Get the Plot Configuration selected for this file
MSHFlexGrid1.col = 1
indice = BuscaPos(MSHFlexGrid1.Text)
On Error Resume Next
' Apply for the drawing
ThisDrawing.ActiveLayout.CopyFrom PC(indice)
ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo
ThisDrawing.Plot.NumberOfCopies = 1
ThisDrawing.Plot.QuietErrorMode = False
retorno = ThisDrawing.Plot.PlotToDevice
MSHFlexGrid1.col = 3
If retorno = True Then
MSHFlexGrid1.CellBackColor =
VBA.ColorConstants.vbGreen
Else
MSHFlexGrid1.CellBackColor = VBA.ColorConstants.vbRed
End If
ThisDrawing.Application.ActiveDocument.Close False
Next row
Next j
End Sub