Problem with PlotToDevice

Problem with PlotToDevice

Anonymous
Not applicable
481 Views
6 Replies
Message 1 of 7

Problem with PlotToDevice

Anonymous
Not applicable
Hello all...

 

I am having problems with the .PlotToDevice
method.  I can't seem to change the CanonicalMediaName with any
results.

 

I am writing my own Batch Plot program in VB6 for
ACAD 2000.  The program lets you choose which files to plot and select the
size and printer.  We have used it successfully for years with R14 and I am
converting to 2000 now.  We don't use Paper Space and we are plotting with
.ctb files.  I am only trying to plot the model space.  We don't use
layouts either.  I am opening each drawing up in a read only
mode.

 

In the program I am really not sure if I am going
about it the right way.  I am using the ActiveLayout object.  I then
set some properties like ConfigName, CanonicalMediaName, StyleSheet, and so
on.

 

In my .pc3 file, I specify the plotter (say, an HP
Laserjet 4V) and there are many different available plot sizes to choose
from.  However when I specify the CanonicalMediaName in code it does not
use it, it only uses the default from the .pc3 file the last time it was
saved.

 

I tried doing a Regen to no avail.

 

I am pasting in the code below
(partial)...

 


size=2>        Case "C"   
    'for a C
size drawing
           
With
myAcadDoc.ActiveLayout
               
.RefreshPlotDeviceInfo
               
.ConfigName =
strPC3File
               
.CanonicalMediaName =
strMediaName
               
.PaperUnits =
acInches
               
.PlotRotation =
ac90degrees
               
.PlotType =
acExtents
               
.StandardScale =
acScaleToFit
               
.PlotOrigin =
dblPlotOrigin
               
.PlotWithPlotStyles =
True
               
.StyleSheet = strPlotStyleDirectory &
strCTBFile
               
.PlotWithLineweights =
True
               
.PlotHidden =
False
               
.RefreshPlotDeviceInfo
           
End With
            f
= myAcadDoc.Plot.PlotToFile(PlotFileName, strPC3File)



  • color=#000000> Am i correct in using the ActiveLayout object or should I
    create a PlotConfiguration?

When
I don't specify the ConfigFileName in the PlotToFile method, there is no plot
created at all.


color=#000000>
 

I
know there is a lot of information here.  I appreciate any help.  I am
under the gun to get this working!!!


color=#000000>
 

Let me know if you need any more
info...


color=#000000>
 

 


color=#000000>Thanks

Jim
Shipley
0 Likes
482 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
I am not sure this is the only way but I set up a
different pc3 file for each paper size.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hello all...

 

I am having problems with the .PlotToDevice
method.  I can't seem to change the CanonicalMediaName with any
results.

 

I am writing my own Batch Plot program in VB6 for
ACAD 2000.  The program lets you choose which files to plot and select
the size and printer.  We have used it successfully for years with R14
and I am converting to 2000 now.  We don't use Paper Space and we are
plotting with .ctb files.  I am only trying to plot the model
space.  We don't use layouts either.  I am opening each drawing up
in a read only mode.

 

In the program I am really not sure if I am going
about it the right way.  I am using the ActiveLayout object.  I then
set some properties like ConfigName, CanonicalMediaName, StyleSheet, and so
on.

 

In my .pc3 file, I specify the plotter (say, an
HP Laserjet 4V) and there are many different available plot sizes to choose
from.  However when I specify the CanonicalMediaName in code it does not
use it, it only uses the default from the .pc3 file the last time it was
saved.

 

I tried doing a Regen to no avail.

 

I am pasting in the code below
(partial)...

 


size=2>        Case "C"   
    'for a C
size drawing
           
With
myAcadDoc.ActiveLayout
               
.RefreshPlotDeviceInfo
               
.ConfigName =
strPC3File
               
.CanonicalMediaName =
strMediaName
               
.PaperUnits =
acInches
               
.PlotRotation =
ac90degrees
               
.PlotType =
acExtents
               
.StandardScale =
acScaleToFit
               
.PlotOrigin =
dblPlotOrigin
               
.PlotWithPlotStyles =
True
               
.StyleSheet = strPlotStyleDirectory &
strCTBFile
               
.PlotWithLineweights =
True
               
.PlotHidden =
False
               
.RefreshPlotDeviceInfo
           
End With
           
f = myAcadDoc.Plot.PlotToFile(PlotFileName, strPC3File)



  • color=#000000> Am i correct in using the ActiveLayout object or should
    I create a PlotConfiguration?


color=#000000>When I don't specify the ConfigFileName in the PlotToFile
method, there is no plot created at all.


color=#000000>
 

I
know there is a lot of information here.  I appreciate any help.  I
am under the gun to get this working!!!


color=#000000>
 

Let me know if you need any more
info...


color=#000000>
 

 


color=#000000>Thanks


color=#000000>Jim Shipley
0 Likes
Message 3 of 7

Anonymous
Not applicable
Try removing the RefreshPlotDeviceInfo from the
end.  If it's a windows printer you may want to skip the pc3 file and plot
it by simply passing the windows printer name to it.

--

Rodney
McManamy - President
CADzation (formerly MACSolids)
Innovative CAD
Customization
AcroPlot(TM) - Plot multiple AutoCAD drawings to a
single
                      
PDF document without using Adobe Acrobat.
website:
href="http://www.cadzation.com">www.cadzation.com

 

**************************************************************************
AcroPlot,
CADz3Dto2D, CADzation, CADzDesign, and CADzRelease are trademarks of
CADzation
**************************************************************************


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hello all...

 

I am having problems with the .PlotToDevice
method.  I can't seem to change the CanonicalMediaName with any
results.

 

I am writing my own Batch Plot program in VB6 for
ACAD 2000.  The program lets you choose which files to plot and select
the size and printer.  We have used it successfully for years with R14
and I am converting to 2000 now.  We don't use Paper Space and we are
plotting with .ctb files.  I am only trying to plot the model
space.  We don't use layouts either.  I am opening each drawing up
in a read only mode.

 

In the program I am really not sure if I am going
about it the right way.  I am using the ActiveLayout object.  I then
set some properties like ConfigName, CanonicalMediaName, StyleSheet, and so
on.

 

In my .pc3 file, I specify the plotter (say, an
HP Laserjet 4V) and there are many different available plot sizes to choose
from.  However when I specify the CanonicalMediaName in code it does not
use it, it only uses the default from the .pc3 file the last time it was
saved.

 

I tried doing a Regen to no avail.

 

I am pasting in the code below
(partial)...

 


size=2>        Case "C"   
    'for a C
size drawing
           
With
myAcadDoc.ActiveLayout
               
.RefreshPlotDeviceInfo
               
.ConfigName =
strPC3File
               
.CanonicalMediaName =
strMediaName
               
.PaperUnits =
acInches
               
.PlotRotation =
ac90degrees
               
.PlotType =
acExtents
               
.StandardScale =
acScaleToFit
               
.PlotOrigin =
dblPlotOrigin
               
.PlotWithPlotStyles =
True
               
.StyleSheet = strPlotStyleDirectory &
strCTBFile
               
.PlotWithLineweights =
True
               
.PlotHidden =
False
               
.RefreshPlotDeviceInfo
           
End With
           
f = myAcadDoc.Plot.PlotToFile(PlotFileName, strPC3File)



  • color=#000000> Am i correct in using the ActiveLayout object or should
    I create a PlotConfiguration?


color=#000000>When I don't specify the ConfigFileName in the PlotToFile
method, there is no plot created at all.


color=#000000>
 

I
know there is a lot of information here.  I appreciate any help.  I
am under the gun to get this working!!!


color=#000000>
 

Let me know if you need any more
info...


color=#000000>
 

 


color=#000000>Thanks


color=#000000>Jim Shipley
0 Likes
Message 4 of 7

serge
Advocate
Advocate
Hi Jim ... If you get a error on the media names, be sure to use the CORRECT media-names ... Did have the same problem ... use the following code to check out the names ...
Sub LIST_ALL_MEDIA_NAMES()
'List all the media names, and their localized version

Dim m_Teller As Integer
Dim m_MediaNames As Variant

ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo
m_MediaNames = ThisDrawing.ModelSpace.Layout.GetCanonicalMediaNames()
For m_Teller = LBound(m_MediaNames) To UBound(m_MediaNames)
frmListAllMediaNames.lst1.AddItem "_______________________________________"
frmListAllMediaNames.lst1.AddItem m_MediaNames(m_Teller)
frmListAllMediaNames.lst1.AddItem ThisDrawing.ModelSpace.Layout.GetLocaleMediaName(m_MediaNames(m_Teller))

'MsgBox m_MediaNames(m_Teller)
'MsgBox ThisDrawing.ModelSpace.Layout.GetLocaleMediaName(m_MediaNames(m_Teller))
Next

frmListAllMediaNames.Show
End Sub
... Hopes this helps, if not let me know ... Regards ... SMD
DEVIDTS Serge, CAD Consultant
http://www.CADdICT.be
0 Likes
Message 5 of 7

Anonymous
Not applicable
Thanks!!

 

I also discovered this on my own.  After
checking the results of GetCanonicalMediaNames at various stages during the
program in break mode, I found that the RefreshPlotDeviceInfo was resetting
them.  I also used different .pc3 files for each size plot (even for the
same printer).  This seems to work so I will leave it.

 

Thanks again...

Jim Shipley

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Try removing the RefreshPlotDeviceInfo from the
end.  If it's a windows printer you may want to skip the pc3 file and
plot it by simply passing the windows printer name to it.

--


Rodney McManamy - President
CADzation (formerly
MACSolids)
Innovative CAD Customization
AcroPlot(TM) - Plot multiple
AutoCAD drawings to a
single
                      
PDF document without using Adobe Acrobat.
website:
href="http://www.cadzation.com">www.cadzation.com

 

**************************************************************************
AcroPlot,
CADz3Dto2D, CADzation, CADzDesign, and CADzRelease are trademarks of
CADzation
**************************************************************************


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hello all...

 

I am having problems with the .PlotToDevice
method.  I can't seem to change the CanonicalMediaName with any
results.

 

I am writing my own Batch Plot program in VB6
for ACAD 2000.  The program lets you choose which files to plot and
select the size and printer.  We have used it successfully for years
with R14 and I am converting to 2000 now.  We don't use Paper Space and
we are plotting with .ctb files.  I am only trying to plot the model
space.  We don't use layouts either.  I am opening each drawing up
in a read only mode.

 

In the program I am really not sure if I am
going about it the right way.  I am using the ActiveLayout
object.  I then set some properties like ConfigName,
CanonicalMediaName, StyleSheet, and so on.

 

In my .pc3 file, I specify the plotter (say, an
HP Laserjet 4V) and there are many different available plot sizes to choose
from.  However when I specify the CanonicalMediaName in code it does
not use it, it only uses the default from the .pc3 file the last time it was
saved.

 

I tried doing a Regen to no avail.

 

I am pasting in the code below
(partial)...

 


size=2>        Case "C"   
    'for a C
size drawing
           
With
myAcadDoc.ActiveLayout
               
.RefreshPlotDeviceInfo
               
.ConfigName =
strPC3File
               
.CanonicalMediaName =
strMediaName
               
.PaperUnits =
acInches
               
.PlotRotation =
ac90degrees
               
.PlotType =
acExtents
               
.StandardScale =
acScaleToFit
               
.PlotOrigin =
dblPlotOrigin
               
.PlotWithPlotStyles =
True
               
.StyleSheet = strPlotStyleDirectory &
strCTBFile
               
.PlotWithLineweights =
True
               
.PlotHidden =
False
               
.RefreshPlotDeviceInfo
           
End
With
            f
= myAcadDoc.Plot.PlotToFile(PlotFileName, strPC3File)



  • color=#000000> Am i correct in using the ActiveLayout object or
    should I create a PlotConfiguration?


color=#000000>When I don't specify the ConfigFileName in the PlotToFile
method, there is no plot created at all.


color=#000000>
 


color=#000000>I know there is a lot of information here.  I appreciate
any help.  I am under the gun to get this
working!!!


color=#000000>
 

Let me know if you need any more
info...


color=#000000>
 

 


color=#000000>Thanks


color=#000000>Jim
Shipley
0 Likes
Message 6 of 7

Anonymous
Not applicable
I ended up doing this too...

 

Thanks,

Jim

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I am not sure this is the only way but I set up a
different pc3 file for each paper size.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hello all...

 

I am having problems with the .PlotToDevice
method.  I can't seem to change the CanonicalMediaName with any
results.

 

I am writing my own Batch Plot program in VB6
for ACAD 2000.  The program lets you choose which files to plot and
select the size and printer.  We have used it successfully for years
with R14 and I am converting to 2000 now.  We don't use Paper Space and
we are plotting with .ctb files.  I am only trying to plot the model
space.  We don't use layouts either.  I am opening each drawing up
in a read only mode.

 

In the program I am really not sure if I am
going about it the right way.  I am using the ActiveLayout
object.  I then set some properties like ConfigName,
CanonicalMediaName, StyleSheet, and so on.

 

In my .pc3 file, I specify the plotter (say, an
HP Laserjet 4V) and there are many different available plot sizes to choose
from.  However when I specify the CanonicalMediaName in code it does
not use it, it only uses the default from the .pc3 file the last time it was
saved.

 

I tried doing a Regen to no avail.

 

I am pasting in the code below
(partial)...

 


size=2>        Case "C"   
    'for a C
size drawing
           
With
myAcadDoc.ActiveLayout
               
.RefreshPlotDeviceInfo
               
.ConfigName =
strPC3File
               
.CanonicalMediaName =
strMediaName
               
.PaperUnits =
acInches
               
.PlotRotation =
ac90degrees
               
.PlotType =
acExtents
               
.StandardScale =
acScaleToFit
               
.PlotOrigin =
dblPlotOrigin
               
.PlotWithPlotStyles =
True
               
.StyleSheet = strPlotStyleDirectory &
strCTBFile
               
.PlotWithLineweights =
True
               
.PlotHidden =
False
               
.RefreshPlotDeviceInfo
           
End
With
            f
= myAcadDoc.Plot.PlotToFile(PlotFileName, strPC3File)



  • color=#000000> Am i correct in using the ActiveLayout object or
    should I create a PlotConfiguration?


color=#000000>When I don't specify the ConfigFileName in the PlotToFile
method, there is no plot created at all.


color=#000000>
 


color=#000000>I know there is a lot of information here.  I appreciate
any help.  I am under the gun to get this
working!!!


color=#000000>
 

Let me know if you need any more
info...


color=#000000>
 

 


color=#000000>Thanks


color=#000000>Jim
Shipley
0 Likes
Message 7 of 7

Anonymous
Not applicable
This I had correct, it was the
RefreshPlotDeviceInfo at the end that was screwing things up!

 

Thanks

Jim Shipley


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
Jim ... If you get a error on the media names, be sure to use the CORRECT
media-names ... Did have the same problem ... use the following code to check
out the names ...
Sub LIST_ALL_MEDIA_NAMES()
 'List all the media
names, and their localized version

Dim m_Teller As Integer
 Dim m_MediaNames As Variant

ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo
 m_MediaNames
= ThisDrawing.ModelSpace.Layout.GetCanonicalMediaNames()
 For
m_Teller = LBound(m_MediaNames) To UBound(m_MediaNames)

  frmListAllMediaNames.lst1.AddItem
"_______________________________________"

  frmListAllMediaNames.lst1.AddItem m_MediaNames(m_Teller)

  frmListAllMediaNames.lst1.AddItem
ThisDrawing.ModelSpace.Layout.GetLocaleMediaName(m_MediaNames(m_Teller))

'MsgBox m_MediaNames(m_Teller)
  'MsgBox
ThisDrawing.ModelSpace.Layout.GetLocaleMediaName(m_MediaNames(m_Teller))

 Next

frmListAllMediaNames.Show
End Sub
... Hopes this helps, if not let
me know ... Regards ... SMD

0 Likes