TheSwamp
Code Red => VB(A) => Topic started by: Dimas on February 21, 2006, 11:58:15 PM
-
Cycling through Named Views.
How can it be done?
-
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.
-
Just a wild guess... :wink:
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?
-
Just a wild guess... :wink:
...
Thanx. will try. Think should work)))
-
Then the other question))
How do I find which view is current?
-
How about Document.Activeviewport.
-
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