zzcctt 发表于 2007-9-28 22:43:00

在VBA中如何将LAYOUT中激活的视口中的图层(在当前视口中冻结)解冻,求大虾99

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

alin 发表于 2007-9-29 20:54:00

<p><a href="http://www.contractcaddgroup.com/articles/pvLayerOn.htm">http://www.contractcaddgroup.com/articles/pvLayerOn.htm</a></p><p><a href="http://www.contractcaddgroup.com/articles/vport.htm">http://www.contractcaddgroup.com/articles/vport.htm</a></p>

zzcctt 发表于 2007-9-29 21:30:00

实在是太感谢上面的大虾了
页: [1]
查看完整版本: 在VBA中如何将LAYOUT中激活的视口中的图层(在当前视口中冻结)解冻,求大虾99