帮你写好了
先设置好默认的打印页面设置
然后 运行下面的程序
Sub DaYin()
Dim a As AcadLayer
For i = 0 To ThisDrawing.Layers.Count - 1 ThisDrawing.Layers.Item(i).LayerOn = False ThisDrawing.Layers.Item(i).Plottable = False Next i
ThisDrawing.Layers("公共图层1").LayerOn = True '<----------改成具体的公共层名字 ThisDrawing.Layers("公共图层1").Plottable = True '<----------改成具体的公共层名字 ThisDrawing.Layers("公共图层2").LayerOn = True '<----------改成具体的公共层名字 ThisDrawing.Layers("公共图层2").Plottable = True '<----------改成具体的公共层名字 ThisDrawing.Layers("公共图层3").LayerOn = True '<----------改成具体的公共层名字 ThisDrawing.Layers("公共图层3").Plottable = True '<----------改成具体的公共层名字
For Each a In ThisDrawing.Layers If a.LayerOn = False Then a.LayerOn = True a.Plottable = True
ThisDrawing.Plot.PlotToDevice If MsgBox("现在正在打印的图层是" + a.Name _ + ",先不要按确定,等打完了再按." + "如果发现打印格式不对,就按取消", _ vbOKCancel + vbInformation) = vbCancel Then Exit For a.LayerOn = False a.Plottable = False End If
Next a End Sub
|