lock all viewports

lock all viewports

Anonymous
Not applicable
318 Views
2 Replies
Message 1 of 3

lock all viewports

Anonymous
Not applicable
Is it possible to write a vba app. that looks if there are viewports in the
drawing and locks them all?
0 Likes
319 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Try this:

Sub LockAllPsVports()
Dim Ent As AcadEntity, pVP As AcadPViewport
For Each Ent In ThisDrawing.PaperSpace
Debug.Print Ent.ObjectName
If Ent.ObjectName = "AcDbViewport" Then
Set pVP = Ent
Debug.Print pVP.DisplayLocked
If Not pVP.DisplayLocked Then pVP.DisplayLocked = True
End If
Next Ent

End Sub


"Lambertus Oosterveen" wrote in message
news:3A1B13EE7708FD61703C356B90FB883C@in.WebX.maYIadrTaRb...
> Is it possible to write a vba app. that looks if there are viewports in
the
> drawing and locks them all?
>
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Public Sub lockAllVPorts()
Dim oLayout As AcadLayout
Dim oEnt As AcadEntity

With ThisDrawing
For Each oLayout In .Layouts
If Not oLayout Is .ModelSpace Then
For Each oEnt In oLayout.Block
If TypeOf oEnt Is AcadPViewport Then
oEnt.DisplayLocked = True
End If
Next oEnt
End If
Next oLayout
End With

End Sub

--
Bobby C. Jones
http://www.acadx.com
0 Likes