(VBA) Current Viewport - Frozen/Thawed

I'm trying to write a module that will retrieve whether a layer is frozen/thawed in each viewport in the active document. In AutoCAD, this is accomplished by referrencing the xdata of each viewport. Below is the function I am trying to use to determine whether a layer is frozen or thawed in a given viewport. This doesn't work however, because XdataType and XdataValue are never populated with info. Is there a way to retrieve this information in IntelliCAD?This is the last bit of code I need to write in order to get a fully function layer status "save and restore" module written, similar to what is available in AutoCAD.Private Function VPFrozen(sLayer As String, cPViewport As IntelliCAD.PViewport) As Boolean ' Get the Xdata from the Viewport Dim XdataType As Variant Dim XdataValue As Variant cPViewport.GetXData "ICAD", XdataType, XdataValue Dim i As Integer For i = LBound(XdataType) To UBound(XdataType) ' Look for frozen Layers in this viewport If XdataType(i) = 1003 Then ' If the layer is already in the frozen layers xdata of this viewport then return true If XdataValue(i) = sLayer Then VPFrozen = True Exit Function End If End If Next VPFrozen = FalseEnd FunctionThanks!

Comments

  • James,viewport layer settings are not fullly accessible yet through the COM API. We recently enabled the possiblility to freeze layers using the user interface and now are extending the COM API. In a few more weeks you will get what you ask for.Hans

This discussion has been closed.