PDA

View Full Version : How to get different printouts for different layers?


cheater
01-12-2004, 11:54 AM
I have a dwg filw which has 270 layers.I must have printouts for each layer.How can i do that?

Eddie
01-12-2004, 12:01 PM
When you say print out what do you mean exactly ?
Is you need a list of all layers including linetype,color ect.

hendie
01-12-2004, 02:58 PM
or a plot of the contents of each layer ?

hendie
01-12-2004, 04:23 PM
in pseudo code

get the layers collection
set the current layer to the 1st one
freeze all other layers
plot
thaw all layers
loop to the next layer and repeat

cheater
01-12-2004, 09:19 PM
This code didnt worked.Can you help?

Private Sub CommandButton3_Click()
Dim LayerCount As Integer
Dim IsPlot As Boolean
LayerCount = ThisDrawing.Layers.Count - 1
MsgBox "Layer Count:" + CStr(LayerCount + 1)
For j = 0 To LayerCount
ThisDrawing.Layers(j).LayerOn = False
Next j
For j = 0 To LayerCount
ThisDrawing.Layers(j).LayerOn = True
IsPlot = PlotModelSpace()
'ThisDrawing.Layers(j).LayerOn = False
Next j

End Sub
Function PlotModelSpace() As Boolean
'Verify that the active space is model space
If ThisDrawing.ActiveSpace = acPaperSpace Then
ThisDrawing.MSpace = True
ThisDrawing.ActiveSpace = acModelSpace
End If
'Set the extents and scale of the plot area
ThisDrawing.ModelSpace.Layout.PlotType = acExtents
ThisDrawing.ModelSpace.Layout. _
StandardScale = acScaleToFit
'Set the number of copies to one
ThisDrawing.Plot.NumberOfCopies = 1
'Initiate the plot
'ThisDrawing.Plot.DisplayPlotPreview acFullPreview
ThisDrawing.Plot.PlotToDevice "Xerox2131.pc3"
PlotModelSpace = True
End Function

cheater
01-12-2004, 09:22 PM
Function PlotLayouts() As Boolean
' Establish the paper space layouts to be plotted
Dim strLayouts(0 To 1) As String
Dim varLayouts As Variant
strLayouts(0) = "Layout1"
'strLayouts(1) = "Layout2"
varLayouts = strLayouts
ThisDrawing.Plot.SetLayoutsToPlot varLayouts
' Set the number of copies to one
ThisDrawing.Plot.NumberOfCopies = 1
' Initiate the plot
ThisDrawing.Plot.PlotToDevice "Xerox2131.pc3"

TCARPENTER
02-12-2004, 11:23 AM
cheater,

Try this...

Dim LayerCount As Integer
Dim IsPlot As Boolean

LayerCount = ThisDrawing.Layers.Count - 1
MsgBox "Layer Count:" + CStr(LayerCount + 1)
For j = 0 To LayerCount
ThisDrawing.Layers(j).LayerOn = False
ThisDrawing.Regen acActiveViewport
Next j
For j = 0 To 3
ThisDrawing.Layers(j).LayerOn = True
ThisDrawing.Regen acActiveViewport
IsPlot = PlotModelSpace()
'ThisDrawing.Layers(j).LayerOn = False
Next j[/code]

cheater
02-12-2004, 03:51 PM
LayerCount = ThisDrawing.Layers.Count - 1
MsgBox "Layer Count:" + CStr(LayerCount + 1)
For j = 1 To LayerCount
ThisDrawing.Layers(j).Freeze = False
ThisDrawing.Layers(j).LayerOn = True
ThisDrawing.Layers(j).Plottable = False
Next j
Dim ilk, son As Integer
ilk = Int(TextBox3.Text)
son = Int(TextBox2.Text)
For j = ilk To son 'LayerCount-1
ThisDrawing.Layers(j).Plottable = True
'ThisDrawing.Plot.DisplayPlotPreview acFullPreview
IsPlot = PlotLayouts()
ThisDrawing.Layers(j).Plottable = False
Next j