Viewports

Discussion in 'AutoCAD' started by tsigwing, Jun 26, 2003.

  1. tsigwing

    tsigwing Guest

    How can I turn on every viewport on very layout tab, zoom to extents, and then lock it?

    Thanks,

    Troy
     
    tsigwing, Jun 26, 2003
    #1
  2. tsigwing

    Kevin Terry Guest

        Dim aPView As AcadPViewport
        Dim aLayout As AcadLayout
        Dim i As Long
        



        'too lazy to work out the bugs
        On Error Resume Next




        ThisDrawing.MSpace = False
       
        For Each aLayout In ThisDrawing.Layouts
            ThisDrawing.ActiveLayout = aLayout
            If aLayout.Name <> "Model" Then
                For i = 0 To ThisDrawing.PaperSpace.Count - 1
                    If TypeOf ThisDrawing.PaperSpace.item(i) Is AcadPViewport Then
                        Set aPView = ThisDrawing.PaperSpace.item(i)
                        aPView.Display True
                        ThisDrawing.MSpace = True
                        ZoomExtents
                        ThisDrawing.MSpace = False
                        aPView.DisplayLocked = True
                    End If
                Next
            End If
        Next




    there may be more elegant ways to go about this, time permitting...
    Kevin



    "tsigwing" <> wrote in message news:...

    How can I turn on every viewport on very layout tab, zoom to extents, and then lock it?

    Thanks,

    Troy
     
    Kevin Terry, Jun 27, 2003
    #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.