Viewports

Viewports

Anonymous
Not applicable
169 Views
1 Reply
Message 1 of 2

Viewports

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

Thanks,

Troy
0 Likes
170 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
    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


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
How
can I turn on every viewport on very layout tab, zoom to extents, and then
lock it?

Thanks,

Troy

0 Likes