v1.0
オブジェクト リストのバウンディング ボックスを計算します。
注: このコマンドは、出力引数を使用します。C# および一部のスクリプト言語(JScript、PerlScript、Python など)は、リファレンスによって渡される引数をサポートしていません。このため、状況に応じた適切な回避策を実行する必要があります。
スクリプト言語の場合、このコマンドは出力引数を取得するために使用できる ISIVTCollection を戻します。
C# の場合は、XSIApplication.ExecuteCommand メソッドを使用してこのコマンドを呼び出すことができます。ExecuteCommand は、出力引数を C# の System.Object (出力引数の Array を含む)にパック化します(詳細については、「C# からのコマンドの呼び出し」を参照)。
GetBBox( [InputObj], [FineComputation], [LowerBoundX], [LowerBoundY], [LowerBoundZ], [UpperBoundX], [UpperBoundY], [UpperBoundZ] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| InputObj | 文字列 |
オブジェクトのリスト。 デフォルト値: 現在選択されている値 |
| FineComputation | Boolean |
True を設定すると、サーフェイスのバウンディング ボックスを計算します。False を設定すると、コントロール ポイントのバウンディング ボックスを計算します。 デフォルト値: FALSE |
| LowerBoundX | Double | バウンディング ボックスの下限の X 座標を戻します。 |
| LowerBoundY | Double | バウンディング ボックスの下限の Y 座標を戻します。 |
| LowerBoundZ | Double | バウンディング ボックスの下限の Z 座標を戻します。 |
| UpperBoundX | Double | バウンディング ボックスの上限の X 座標を戻します。 |
| UpperBoundY | Double | バウンディング ボックスの上限の Y 座標を戻します。 |
| UpperBoundZ | Double | バウンディング ボックスの上限の 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 |