我被迷惑了...有时候这种代码是有效的...有时候不会...任何代码更正,使这一功能的所有时间将不胜感激。TIA:难看:
Private Sub cmdChangeVPortLayer _ Click()
Dim vport As AcadPViewport
Dim ol ayout As acad layout
Dim new layer As acad layer
Set new layer = this drawing。Layers.Add("Viewport")
此绘图。ActiveLayer = newLayer。ActiveLayer.Plottable = False。active layer . color = AC green
me . hide
' On Error Resume Next
用于此绘图中的每个布局。布局
如果oLayout。然后
为oLayout中的每个vport命名“Model”。如果vport,则阻止
'将vport更改为驻留在层“视口”上。图层“视口”,然后
vport。layer = " Viewport "
Else
End If
Next ' choke
End If
Next
End Sub