not the right result

not the right result

Anonymous
Not applicable
321 Views
4 Replies
Message 1 of 5

not the right result

Anonymous
Not applicable
to all,

I am trying to plot drawings that are sent to me from Thailand. For that I
am using the next routine.

Public Sub dsmplot()
Dim AcadPref As AcadPreferencesOutput
Set AcadPref = ThisDrawing.Application.Preferences.Output

If ThisDrawing.ActiveSpace = acPaperSpace Then
ThisDrawing.MSpace = True
ThisDrawing.ActiveSpace = acModelSpace
End If

AcadPref.DefaultOutputDevice = "HP LaserJet 1100"
AcadPref.DefaultPlotStyleTable = "D:\ACAD2000\Plot Styles\WML_pids_015.ctb"

ThisDrawing.ModelSpace.Layout.PlotType = acExtents
ThisDrawing.ModelSpace.Layout.StandardScale = acScaleToFit

ThisDrawing.Plot.NumberOfCopies = 1
ThisDrawing.Plot.PlotToDevice

End Sub

the only problem is; " it doesn't work" . Is there somebody that can shine
his/her light?

Regards,

René
0 Likes
322 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Rene,
At a quick glance, I'd say try changing your last line of code form:

ThisDrawing.Plot.PlotToDevice

to:

ThisDrawing.Plot.PlotToDevice ThisDrawing.ActiveLayout.ConfigName

Hopefully, this will do the trick, otherwise let me know the error message and
where it's stalling out in the program.
-Josh

Rene van Kwawegen wrote:

> to all,
>
> I am trying to plot drawings that are sent to me from Thailand. For that I
> am using the next routine.
>
> Public Sub dsmplot()
> Dim AcadPref As AcadPreferencesOutput
> Set AcadPref = ThisDrawing.Application.Preferences.Output
>
> If ThisDrawing.ActiveSpace = acPaperSpace Then
> ThisDrawing.MSpace = True
> ThisDrawing.ActiveSpace = acModelSpace
> End If
>
> AcadPref.DefaultOutputDevice = "HP LaserJet 1100"
> AcadPref.DefaultPlotStyleTable = "D:\ACAD2000\Plot Styles\WML_pids_015.ctb"
>
> ThisDrawing.ModelSpace.Layout.PlotType = acExtents
> ThisDrawing.ModelSpace.Layout.StandardScale = acScaleToFit
>
> ThisDrawing.Plot.NumberOfCopies = 1
> ThisDrawing.Plot.PlotToDevice
>
> End Sub
>
> the only problem is; " it doesn't work" . Is there somebody that can shine
> his/her light?
>
> Regards,
>
> René
0 Likes
Message 3 of 5

Anonymous
Not applicable
Oops, almost forgot,
thisdrawing.activelayout.configname = "HP LaserJet 1100.pc3"
-Josh

Minkwitz Design wrote:

> Rene,
> At a quick glance, I'd say try changing your last line of code form:
>
> ThisDrawing.Plot.PlotToDevice
>
> to:
>
> ThisDrawing.Plot.PlotToDevice ThisDrawing.ActiveLayout.ConfigName
>
> Hopefully, this will do the trick, otherwise let me know the error message and
> where it's stalling out in the program.
> -Josh
>
> Rene van Kwawegen wrote:
>
> > to all,
> >
> > I am trying to plot drawings that are sent to me from Thailand. For that I
> > am using the next routine.
> >
> > Public Sub dsmplot()
> > Dim AcadPref As AcadPreferencesOutput
> > Set AcadPref = ThisDrawing.Application.Preferences.Output
> >
> > If ThisDrawing.ActiveSpace = acPaperSpace Then
> > ThisDrawing.MSpace = True
> > ThisDrawing.ActiveSpace = acModelSpace
> > End If
> >
> > AcadPref.DefaultOutputDevice = "HP LaserJet 1100"
> > AcadPref.DefaultPlotStyleTable = "D:\ACAD2000\Plot Styles\WML_pids_015.ctb"
> >
> > ThisDrawing.ModelSpace.Layout.PlotType = acExtents
> > ThisDrawing.ModelSpace.Layout.StandardScale = acScaleToFit
> >
> > ThisDrawing.Plot.NumberOfCopies = 1
> > ThisDrawing.Plot.PlotToDevice
> >
> > End Sub
> >
> > the only problem is; " it doesn't work" . Is there somebody that can shine
> > his/her light?
> >
> > Regards,
> >
> > René
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi all again,

I did not change much in my routine. I only placed the device name behind
the PlotToDevice.
I recieve a plot from the right printer so that is ok.

What does not work is the codeline with the plotstyle call.

Dim AcadPref As AcadPreferencesOutput
Set AcadPref = ThisDrawing.Application.Preferences.Output
AcadPref.DefaultPlotStyleTable = "D:\ACAD2000\Plot Styles\DSM-iso.ctb"

I made a small routine to find the Plotstyle in use, that works fine, but
then I cannot use the
result to call the right "ctb". The code I found all over is only to change
the plotstyle in the A2K
options. That only works for new made drawings.

Public Sub FindStyle()

Dim StTable As Variant
Dim StNr As Integer
Dim StName As String

ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo
StTable = ThisDrawing.ActiveLayout.GetPlotStyleTableNames

For StNr = LBound(StTable) To UBound(StTable)
StName = StTable(StNr)
Next StNr

End Sub

TIA,

René
0 Likes
Message 5 of 5

Anonymous
Not applicable
Try using:

const MyStyle = "D:\ACAD2000\Plot Styles\DSM-iso.ctb"
AcadPref.DefaultPlotStyleTable = MyStyle

I know it's supposed to a read/write string value, but the help example shows
it as a constant. Please post and let me know if it works.
-Josh

Rene van Kwawegen wrote:

> Hi all again,
>
> I did not change much in my routine. I only placed the device name behind
> the PlotToDevice.
> I recieve a plot from the right printer so that is ok.
>
> What does not work is the codeline with the plotstyle call.
>
> Dim AcadPref As AcadPreferencesOutput
> Set AcadPref = ThisDrawing.Application.Preferences.Output
> AcadPref.DefaultPlotStyleTable = "D:\ACAD2000\Plot Styles\DSM-iso.ctb"
>
> I made a small routine to find the Plotstyle in use, that works fine, but
> then I cannot use the
> result to call the right "ctb". The code I found all over is only to change
> the plotstyle in the A2K
> options. That only works for new made drawings.
>
> Public Sub FindStyle()
>
> Dim StTable As Variant
> Dim StNr As Integer
> Dim StName As String
>
> ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo
> StTable = ThisDrawing.ActiveLayout.GetPlotStyleTableNames
>
> For StNr = LBound(StTable) To UBound(StTable)
> StName = StTable(StNr)
> Next StNr
>
> End Sub
>
> TIA,
>
> René
0 Likes