v1.0
property
オブジェクト リストのバウンディング ボックスを計算します。
注: このコマンドは、出力引数を使用します。 C#
および一部のスクリプト言語(JScript、PerlScript、Python
など)は、リファレンスによって渡される引数をサポートしていません。このため、状況に応じた適切な回避策を実行する必要があります。
スクリプト言語の場合、このコマンドは出力引数を取得するために使用できる ISIVTCollection を戻します。
C# の場合は、XSIApplication.ExecuteCommand
メソッドを使用してこのコマンドを呼び出すことができます。 ExecuteCommand は、出力引数を C# の
System.Object (出力引数の配列を含む)にパック化します(詳細については、「C#
からのコマンドの呼び出し」を参照)。
GetBBox( [InputObj], [FineComputation], [LowerBoundX], [LowerBoundY], [LowerBoundZ], [UpperBoundX], [UpperBoundY], [UpperBoundZ] ); |
| パラメータ | タイプ | 詳細 |
|---|---|---|
| InputObj | 文字列 | オブジェクトのリスト。
デフォルト値: 現在選択されている値 |
| FineComputation | ブール | True を設定すると、サーフェイスのバウンディング ボックスを計算します。False を設定すると、コントロール
ポイントのバウンディング ボックスを計算します。
デフォルト値: FALSE |
| LowerBoundX | ダブル | バウンディング ボックスの下限の X 座標を戻します。 |
| LowerBoundY | ダブル | バウンディング ボックスの下限の Y 座標を戻します。 |
| LowerBoundZ | ダブル | バウンディング ボックスの下限の Z 座標を戻します。 |
| UpperBoundX | ダブル | バウンディング ボックスの上限の X 座標を戻します。 |
| UpperBoundY | ダブル | バウンディング ボックスの上限の Y 座標を戻します。 |
| UpperBoundZ | ダブル | バウンディング ボックスの上限の Z 座標を戻します。 |
NewScene( null, false ) ;
var oSphere = ActiveSceneRoot.AddGeometry( "Sphere", "MeshSurface", "MySphere" ) ;
oSphere.PosX = 2 ;
oSphere.PosY = -1 ;
var oTorus = ActiveSceneRoot.AddGeometry( "Torus", "NurbsSurface", "MyTorus" ) ;
oTorus.PosX = 2 ;
oTorus.PosY = 5 ;
var oObjs = new ActiveXObject("XSI.Collection") ;
oObjs.Add( oSphere ) ;
oObjs.Add( oTorus ) ;
var aRtn = GetBBox( oObjs ) ;
xmin = aRtn.value( "LowerBoundX" );
ymin = aRtn.value( "LowerBoundY" );
zmin = aRtn.value( "LowerBoundZ" );
xmax = aRtn.value( "UpperBoundX" );
ymax = aRtn.value( "UpperBoundY" );
zmax = aRtn.value( "UpperBoundZ" );
LogMessage( "Lower Bound: " + xmin + " / " + ymin + " / " + zmin ) ;
LogMessage( "Upper Bound: " + xmax + " / " + ymax + " / " + zmax ) ;
// Build a Cube that shows the bounding box
var oCube = ActiveSceneRoot.AddPrimitive("Cube") ;
oCube.length = 1 ;
oCube.PosX = ( xmax + xmin ) / 2 ;
oCube.PosY = ( ymax + ymin ) / 2 ;
oCube.PosZ = ( zmax + zmin ) / 2 ;
oCube.sclx = xmax - xmin ;
oCube.scly = ymax - ymin ;
oCube.sclz = zmax - zmin ;
|
dim xmin, ymin, zmin, xmax, ymax, zmax dim list set list = GetValue( "SelectionList" ) GetBBox list, FALSE, xmin, ymin, zmin, xmax, ymax, zmax LogMessage "Lower Bound: " & xmin & " / " & ymin & " / " & zmin LogMessage "Upper Bound: " & xmax & " / " & ymax & " / " & zmax |