コマンドのスクリプト名をStringとして戻したり、設定したりします。
スクリプト名はスクリプトでコマンドを実行するときに使用されます('ApplyOp "Twist"')。Name プロパティを使用してコマンドのコレクションから特定コマンドを識別するという点で、実際のコマンド名とは異なります。詳細については、SIObject.Nameプロパティの説明と例を参照してください。
// get accessor String rtn = Command.ScriptingName; // set accessor Command.ScriptingName = String; |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' This example demonstrates the relationship between the ' Twist command and the operator that results from it, ' particularly concerning the name information. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ set oDisc = Application.ActiveSceneRoot.AddGeometry( "Disc", "MeshSurface" ) Selection.Add oDisc ' Apply the twist operator after printing the name information set oCmd = Application.Commands( "Twist" ) getInfo oCmd ' When Softimage runs this command, the following message is logged ' to the history pane of the Script Editor: ' ApplyOp "Twist", "disc", 3, siPersistentOperation oCmd.Execute ' Get the operator that was just created from the operator ' stack (the ConstructionHistory object) and print the name ' information for the operator set oStack = oDisc.ActivePrimitive.ConstructionHistory for each oOp in oStack if oOp.Name = "Twist Op" then set oTwistOp = oOp end if next getInfo oTwistOp '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function getInfo( in_object ) Application.LogMessage in_object.Name Application.LogMessage in_object.FullName ' This ensures that you only try to use the ScriptingName ' property on a Command object if ClassName( in_object ) = "Command" then Application.LogMessage in_object.ScriptingName end if end function '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Output of above script is: 'INFO : "Twist" 'INFO : "Twist" 'INFO : "ApplyOp" 'INFO : "Twist Op" 'INFO : "disc.polymsh.twistop" |