v4.0
A collection of View objects.
' Log all views currently loaded in Softimage set views = Application.Desktop.ActiveLayout.Views for each view in views Application.LogMessage view.Name next |
/* This example demonstrates how to use the ViewCollection to find out information about the current views (both floating and part of the current layout) */ NewScene( null, false ); var oAllViews = Application.Desktop.ActiveLayout.Views LogMessage( "There are " + oAllViews.Count + " view windows" ) ; // ViewCollection.Filter is useful for quickly finding all views // of a particular type var oTextViews = oAllViews.Filter( "Text Editor" ) LogMessage( "There are " + oTextViews.Count + " text editors" ) ; for ( var i=0; i<oTextViews.Count; i++ ) { strFileName = oTextViews(i).GetAttributeValue( "FileName" ) ; if ( strFileName != "" ) { LogMessage( "File being edited: " + strFileName ); } } var oNetviewViews = oAllViews.Filter( "Netview" ) ; LogMessage( "There are " + oNetviewViews.Count + " Netview windows" ) ; for ( var i=0; i<oNetviewViews.Count; i++ ) { strUrl = oNetviewViews(i).GetAttributeValue( "url" ) ; if ( strUrl != "" ) { LogMessage( "Viewed webpages: " + strUrl ); } } // Expected result: //INFO : There are 19 view windows //INFO : There are 0 text editors //INFO : There are 0 Netview windows |