我已经知道 将LAYOUT中激活的视口中的图层(在当前视口中冻结)冻结,但是解冻不知道要怎么样才行? 请大虾指点一下,谢谢 下面是冻结的代码: Sub VpLayerOff(strLayer As String)
Dim objEntity As AcadObject Dim ObjPViewport As AcadObject Dim objPViewport2 As AcadObject Dim XdataType As Variant Dim XdataValue As Variant Dim I As Integer Dim Counter As Integer Dim PT1 As Variant
Set ObjPViewport = ThisDrawing.ActivePViewport
ObjPViewport.GetXData "ACAD", XdataType, XdataValue
For I = LBound(XdataType) To UBound(XdataType)
If XdataType(I) = 1003 Then
Counter = I + 1
If XdataValue(I) = strLayer Then Exit Sub End If Next
If Counter = 0 Then For I = LBound(XdataType) To UBound(XdataType) If XdataType(I) = 1002 Then Counter = I - 1 Next End If
XdataType(Counter) = 1003 XdataValue(Counter) = strLayer
ReDim Preserve XdataType(Counter + 1) ReDim Preserve XdataValue(Counter + 1)
XdataType(Counter + 1) = 1002 XdataValue(Counter + 1) = "}"
ReDim Preserve XdataType(Counter + 2) ReDim Preserve XdataValue(Counter + 2)
XdataType(Counter + 2) = 1002 XdataValue(Counter + 2) = "}"
ObjPViewport.SetXData XdataType, XdataValue
End Sub
|