Plotting setup problem

Plotting setup problem

Anonymous
Not applicable
261 Views
1 Reply
Message 1 of 2

Plotting setup problem

Anonymous
Not applicable


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a problem
getting current device media names when I'm changing a
<DefaultOutputDevice> property value. After use of
<RefreshPlotDeviceInfo> method the <GetCanonicalMediaNames>
method did not get refreshed values from the current device object. Is
there anything else (object :)) needs to be refreshed, or the method
I'm using is wrong?. Here is a simple code for:



face="Times New Roman"> 



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Dim acLayout As
AcadLayout
    Dim acPlotDevices



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">

   
...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    acPlotDevices =
acLayout.GetPlotDeviceNames()



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    {Returns current
device media names}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Note that
I'm running the program first time in AutoCAD
session.



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



face="Times New Roman"> 



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Dim
acPreferencesOutput As AcadPreferencesOutput
    Dim
acLayout As AcadLayout
    Dim
acPlotDevices



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    ...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    acPlotDevices =
Layout.GetPlotDeviceNames()
    acPreferencesOutput =
ArrPlotDevices(3) ' Originally the number 3 is an external
argument.
   
acLayout.RefreshPlotDeviceInfo
...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Dim acLayout As
AcadLayout
    ...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    ArrPlotDevices =
acLayout.GetPlotDeviceNames()



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    {Returns
previous <current>
device media names}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Note that
I'm still in the same AutoCAD session.



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...


 
0 Likes
262 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
 Samuel
try this way

 

 

Get the layout object
Set ACADLayout =
ThisDrawing.ActiveLayout

 

Set Layout = ThisDrawing.ModelSpace.Layout
'
List all the valid device names for the system
plotDevices =
Layout.GetPlotDeviceNames()

 

Set Layouts =
ThisDrawing.Layouts
Layouts("Layout1").ConfigName = "name.pc3"
' List all
the entries in the plot style table
styleNames =
Layout.GetPlotStyleTableNames()
'Set Plot style table to
namectb
Layouts("layout1").StyleSheet = "name.ctb"
strLayout(0) =
"Layout1"
ThisDrawing.Plot.SetLayoutsToPlot (strLayout)
' Read and display
the original value
originalValue =
ACADLayout.PlotRotation
ACADLayout.PlotRotation = ac0degrees
'set layout
to Extents
ThisDrawing.ActiveLayout.PlotType =
acExtents
ThisDrawing.ActiveLayout.StandardScale =
acScaleToFit
ThisDrawing.ActiveLayout.CenterPlot = True
'Set number of
copies to one
 ThisDrawing.Plot.NumberOfCopies = 1
 'set to
PlotDevice = "name.pc3"
 ThisDrawing.Plot.PlotToDevice
 'Set
Plot style table to none
 ThisDrawing.ActiveLayout.StyleSheet =
("")
' Change plotter configuration file for
"Layout1"
Layouts("Layout1").ConfigName = ("none")
' Reset the preference
back to it's original value
ACADLayout.PlotRotation =
originalValue


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



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a problem
getting current device media names when I'm changing a
<DefaultOutputDevice> property value. After use of
<RefreshPlotDeviceInfo> method the <GetCanonicalMediaNames>
method did not get refreshed values from the current device object.
Is there anything else (object :)) needs to be refreshed, or the
method I'm using is wrong?. Here is a simple code for:



face="Times New Roman"> 



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Dim acLayout As
AcadLayout
    Dim acPlotDevices



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">

   
...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    acPlotDevices =
acLayout.GetPlotDeviceNames()



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    {Returns
current device media names}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Note that
I'm running the program first time in AutoCAD
session.



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



face="Times New Roman"> 



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Dim
acPreferencesOutput As AcadPreferencesOutput
    Dim
acLayout As AcadLayout
    Dim
acPlotDevices



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    ...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    acPlotDevices =
Layout.GetPlotDeviceNames()
    acPreferencesOutput =
ArrPlotDevices(3) ' Originally the number 3 is an external
argument.
   
acLayout.RefreshPlotDeviceInfo
...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Dim acLayout As
AcadLayout
    ...



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    ArrPlotDevices
= acLayout.GetPlotDeviceNames()



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    {Returns
previous
<current> device media names}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">    Note that
I'm still in the same AutoCAD session.



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">...


 
0 Likes