Author Topic: Display Viewport Objects  (Read 1608 times)

0 Members and 1 Guest are viewing this topic.

Birdy

  • Guest
Display Viewport Objects
« on: June 29, 2006, 09:05:19 AM »
We use multiple layout tabs in drawing files.
I often have to copy/paste a viewport from one layout to another, but when I do, the "display objects in viewport" is always -NO-.

Is there a way, (or system variable) to have those objects displayed when I paste the VP by default?

Not a big problem, but kinda would be nice if I didn't hafta select, rtclk, display viewport objects, YES.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Display Viewport Objects
« Reply #1 on: June 29, 2006, 09:49:56 AM »
not that I have found.  I wrote some vba to turn it on, and zoom extents inside a VP if you want.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Birdy

  • Guest
Re: Display Viewport Objects
« Reply #2 on: June 29, 2006, 10:27:01 AM »
Thanks. I'll try it if you don't mind.

PHX cadie

  • Water Moccasin
  • Posts: 1902
Re: Display Viewport Objects
« Reply #3 on: June 29, 2006, 10:47:05 AM »
Glad you asked that, though sorry I do not have the answer, I've always wondered "Whats the point?"
Acad 2013 and XM
Back when High Tech meant you had an adjustable triangle

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Display Viewport Objects
« Reply #4 on: June 29, 2006, 11:31:07 AM »
you have to pick the vp, but it does work
Code: [Select]
Public Sub VPON()
    On Error GoTo ERR_CONTROL
    Dim vp As AcadPViewport
    Dim OBJSELSET As AcadSelectionSet
    Set OBJSELSET = ThisDrawing.SelectionSets.Add("VPL")
    OBJSELSET.SelectOnScreen
    For Each vp In OBJSELSET
        vp.Display True
        If vp.DisplayLocked = True Then
            vp.DisplayLocked = False
            ThisDrawing.MSpace = True
            ZoomExtents
            ThisDrawing.MSpace = False
            vp.DisplayLocked = True
        Else
            ThisDrawing.MSpace = True
            ZoomExtents
            ThisDrawing.MSpace = False
            vp.DisplayLocked = True
        End If
    Next
Exit_Here:
    ThisDrawing.SelectionSets.Item("VPL").Delete
    Exit Sub
ERR_CONTROL:
    Select Case Err.Number
    Case "-2145320851"
        ThisDrawing.SelectionSets.Item("VPL").Delete
        Err.Clear
        Resume
    Case Else
        MsgBox Err.Number & Err.Description
        Err.Clear
        Resume
    End Select
End Sub
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Birdy

  • Guest
Re: Display Viewport Objects
« Reply #5 on: June 29, 2006, 11:33:27 AM »
I thought I'd check if there was a system variable that I was missing before thinking about a programmatic solution.  Although it's not a big deal... just seems like a minor inconvience.

<edit> Thanks for the programmatic solution.  I'll have to try it later though... <PuttingOnFireStompingBoots>