setting layer status for active viewport

Discussion in 'AutoCAD' started by Nate Hunter, Apr 7, 2004.

  1. Nate Hunter

    Nate Hunter Guest

    I am really having problems with this task. I need to:

    1. Check to see if a layer is frozen in the active viewport
    2. Create a new viewport ( I have this step completed)
    3. Set layer status to the stus of step 1

    I thought if I set the ViewportDefault = true in step one. By creating a
    new viewport my layer status would be the same as my original viewport.

    One other note is that I am not creating my viewport in the same tab. The
    Viewport is in the same drawing but not the same tab.

    Any Ideas.
     
    Nate Hunter, Apr 7, 2004
    #1
  2. Nate Hunter

    Nate Hunter Guest

    Dim objPViewport As AcadObject
    Dim XdataType As Variant
    Dim XdataValue As Variant
    Dim I As Integer, PT1 As Variant
    Dim stemp As String

    ' Get the Xdata from the Viewport
    PPort.GetXData "ACAD", XdataType, XdataValue
    For I = LBound(XdataType) To UBound(XdataType)
    ' Look for frozen Layers in this viewport
    If XdataType(I) = 1003 Then
    ' Set the counter AFTER the position of the Layer frozen layer(s)
    Counter = I + 1
    ' If the layer is already in the frozen layers xdata of this viewport then exit this sub program

    stemp = stemp & XdataValue(I) & vbCrLf

    End If
    Next
    MsgBox stemp

    What do you have so far (code)??
     
    Nate Hunter, Apr 13, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.