不同图层的开关对连续打印无效,恳请各位大大帮忙。
<P>我已经将Backgroundplot变量设为0。源程序如下:</P><P>Private Sub CommandButton1_Click()<BR> Err.Clear<BR> On Error Resume Next<BR> Dim objlayer, shutdownobjlayer, layerObj As AcadLayer<BR> Dim layername, shutdownlayername, a As String</P>
<P><BR> For i = 0 To Listlayer2.ListCount - 1 ' 把list2中的层都关掉<BR> <BR> layername = Listlayer2.List(i)<BR> 'Set objlayer = ThisDrawing.Layers.Item(layername)<BR> For j = 0 To Listlayer2.ListCount - 1<BR> shutdownlayername = Listlayer2.List(j)<BR> Set shutdownobjlayer = ThisDrawing.Layers.Item(shutdownlayername)<BR> shutdownobjlayer.LayerOn = False<BR> If shutdownlayername = layername Then<BR> shutdownobjlayer.LayerOn = True '把要打印的层打开<BR> a = layername<BR> End If<BR> Next j<BR> ThisDrawing.Application.Documents.ModelSpace.PlotType = acWindow<BR> <BR> Set layerObj = ThisDrawing.Layers.Item(a)</P>
<P> ThisDrawing.ActiveLayer = layerObj<BR> <BR> ThisDrawing.Plot.PlotToDevice '打印<BR> If MsgBox("现在正在打印的图层是" + a _<BR> + ",先不要按确定,等打完了再按." + "如果发现打印格式不对,就按取消", _<BR> vbOKCancel + vbInformation) = vbCancel Then Exit For</P>
<P> Next i</P>
<P>End Sub</P>
<P>恳请大大蒙帮忙。</P> <P>问题解决了,加一个regen的语句就行了。</P>
页:
[1]