TheSwamp

Code Red => VB(A) => Topic started by: Dimas on February 21, 2006, 11:58:15 PM

Title: Cycling through Named Views
Post by: Dimas on February 21, 2006, 11:58:15 PM
Cycling through Named Views.
How can it be done?
Title: Re: Cycling through Named Views
Post by: Kerry on February 22, 2006, 12:21:19 AM
I'm not a VB'er, but ...
Have you tried Iterating the Views Collection

If you want to 'SEE" each view, look at the SetView Method associated with the Active Viewport.

Title: Re: Cycling through Named Views
Post by: Dave R on February 22, 2006, 08:10:23 AM
Just a wild guess... :wink:
Code: [Select]
Sub IterateViews()
  Dim oView As AcadView
  For Each oView In ThisDrawing.Views
    'do something
  Next oView
End Sub

Cycling through Named Views.
How can it be done?
Title: Re: Cycling through Named Views
Post by: Dimas on February 25, 2006, 05:34:52 PM
Just a wild guess... :wink:
...

Thanx. will try. Think should work)))
Title: Re: Cycling through Named Views
Post by: Dimas on February 25, 2006, 06:16:21 PM
Then the other question))
How do I find which view is current?
Title: Re: Cycling through Named Views
Post by: Dnereb on February 27, 2006, 04:38:07 AM
How about Document.Activeviewport.
Title: Re: Cycling through Named Views
Post by: Bob Wahr on March 10, 2006, 06:42:35 PM
Code: [Select]
Sub test()
Dim objView As AcadView
Dim objVP As AcadViewport
Dim objViews As AcadViews
Set objViews = ThisDrawing.Views
Set objVP = ThisDrawing.ActiveViewport
For Each objView In objViews
  If objView.Center(0) = objVP.Center(0) And objView.Center(1) = objVP.Center(1) And objView.Height = objVP.Height And objView.Width = objVP.Width Then
    Debug.Print "yep"
    Exit For
  End If
Next objView
End Sub