ViewCollection

導入

v4.0

詳細

View オブジェクトのコレクションです。

メソッド

Filter Find GetAsText  
       

プロパティ

Countオペレータ Itemオペレータ    
       

1. VBScript の例

' Log all views currently loaded in Softimage

set views = Application.Desktop.ActiveLayout.Views

for each view in views

	Application.LogMessage view.Name 

next

2. JScript の例

/*

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

関連項目

Layout.Views View.Views