ActionDelta.RemoveItem

ActionDelta.RemoveItem

説明

ActionDeltaからActionDeltaItemを削除します。

注:削除後、ActionDeltaItem オブジェクトは同じ項目をターゲットにしないことがあります(例を参照)。

C#構文

ActionDelta.RemoveItem( Object in_vTarget );

スクリプト構文

ActionDelta.RemoveItem( Target );

パラメータ

パラメータ タイプ 説明
Target String ソース項目のターゲットパス

JScript の例

/*

	This example demonstrates how to remove an ActionDeltaItem 

*/

NewScene (null, false);

// Create a reference model from a cube

var oRoot = Application.ActiveProject.ActiveScene.Root;

var oCube = oRoot.AddGeometry("Cube","MeshSurface");

var emdlFileRefModel = XSIUtils.BuildPath(Application.InstallationPath(siProjectPath), "Models", "MyModel.emdl"); 

CreateModelAndConvertToRef(oCube , emdlFileRefModel);

// Translate the 3D Objects

Translate(oCube, 3.0, 3.0, 0.0, siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);

// Get the Delta object

var oDelta = Dictionary.GetObject("Model.Delta");

// Add an action of type siModificationDeltaConstraint

var oActionDelta = oDelta.ActionDeltas(0);

// Get the the two firsts ActionDeltaItem

var oActionDelta = oDelta.ActionDeltas(0)

var oActionDeltaItem1 = oActionDelta.Items(0);

var oActionDeltaItem2 = oActionDelta.Items(1);

// Print the name of oActionDeltaItem2

Application.LogMessage("Second item name before removing oActionDeltaItem1: " + oActionDeltaItem2.Name);

// Remove oActionDeltaItem1

oActionDelta.RemoveItem(oActionDeltaItem1.Name);

// Print the name of oActionDeltaItem2

Application.LogMessage("Second item name after removing oActionDeltaItem1: " + oActionDeltaItem2.Name);

// Remove all others ActionDeltaItems

for (var i=0; i<oActionDelta.Items.Count; i++) {

	oActionDelta.RemoveItem(oActionDelta.Items(0).Name);

	// Decrease 'i' because there one item removed

	i--;	

}

// Output of above script:

//INFO : Second item name before removing oActionDeltaItem1: cube.kine.local.posy

//INFO : Second item name after removing oActionDeltaItem1: cube.kine.local.posz

関連項目

ActionDelta.RemoveAllItems Delta.RemoveAction