Author Topic: viewport locking question  (Read 1537 times)

0 Members and 1 Guest are viewing this topic.

AVCAD

  • Guest
viewport locking question
« on: August 14, 2007, 12:44:15 PM »
is there a function (lisp, button code, vlisp anything) that anyone knows of that in Autocad 2004 will allow you to easily unlock and lock all viewports in a drawing??

thanks

deegeecees

  • Guest
Re: viewport locking question
« Reply #1 on: August 14, 2007, 12:50:42 PM »
Not sure how your VBA is, but here is an exerpt from the 2004 AutoCads' Developer Help. Some fanagling (sp) will get it to work the way you want it to.

Code: [Select]
Sub Example_DisplayLocked()
    ' This example scans the current drawing paper space Viewports
    ' and displays whether or not any of them are locked.
   
    Dim pviewportObj As Object
    Dim msg As String, ClippedState As String
   
    ' Make sure this drawing contains paper space viewports before continuing
    If ThisDrawing.PaperSpace.count = 0 Then
        MsgBox "There are no paper space viewports in the current drawing."
        Exit Sub
    End If
   
    ' Go through each paper space viewport object in the drawing paper space
    ' and determine whether or not it is locked
   
    For Each pviewportObj In ThisDrawing.PaperSpace
       
        ' Determine whether this is a paper space viewport
        If TypeName(pviewportObj) = "IAcadPViewport" Then
           
            ' Determine whether this paper space viewport is locked
            ClippedState = IIf(pviewportObj.Clipped, " is locked", " is not locked")
            msg = msg & "PViewport ID " & pviewportObj.objectID & ClippedState & vbCrLf
       
        End If
   
    Next

    ' Display locked state of paper space Viewports
    MsgBox msg
End Sub

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: viewport locking question
« Reply #2 on: August 14, 2007, 01:02:30 PM »
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans