Parameter.ScriptName operator

説明

パラメータのスクリプトをStringとして戻します。パラメータのスクリプト名は、スクリプティング(SetValueコマンドなど)で使用し、スクリプト名を使ってParameterCollectionからどのパラメータにアクセスするかを指定します。

実際のパラメータの名前(SIObject.Name)は、シーンエクスプローラに表示されます(スクリプト名の使用が有効になっている場合を除く)。スクリプト名は Script Editor のヒストリペインに記録されます。

注:カスタムプロパティにおいて、CustomProperty.AddParameterメソッドを使用して新しいカスタムパラメータを作成するときには、ScriptName パラメータでスクリプト名を定義し、Name パラメータで実際の名前を定義します。

1. VBScript の例

'
'       This example shows how the Name, ScriptName, and Description can be different 
'       for a custom parameter
'
NewScene , false
dim oRoot, oPropSet, oProp
set oRoot = Application.ActiveProject.ActiveScene.Root
set oPropSet = oRoot.AddProperty( "Custom_parameter_list", , "DemoPropertyNaming" )
set oProp = oPropSet.AddParameter( "MyScriptName", siString , , , _
"ParameterShortName", "Longer Parameter Description" )
' Will print "ParameterShortName"
Application.LogMessage oProp.Name
' Will print "MyScriptName"
Application.LogMessage oProp.ScriptName
' Will print "Longer Parameter Description"
Application.LogMessage oProp.Description

2. VBScript の例

'
' This example demonstrates the relationship between the 
' actual name and the script name of a built-in parameter 
'
NewScene , false
set oDisc = Application.ActiveSceneRoot.AddGeometry( "Disc", "MeshSurface" )
getInfo oDisc
' Get the Render Visibility parameter (using the Name property) 
' and print its name info
set oParam = oDisc.Properties( "Visibility" ).Parameters( "rendvis" )
getInfo oParam
' Convenience function
function getInfo( in_object )
        Application.LogMessage in_object.Name
        Application.LogMessage in_object.FullName
        ' This ensures that you only try to use the ScriptName
        ' property on a Parameter object
        if Application.ClassName( in_object ) = "Parameter" then
                Application.LogMessage in_object.ScriptName
        end if
end function
' Expected results:
'INFO : "disc"
'INFO : "disc"
'INFO : "Render Visibility"
'INFO : "disc.visibility.rendvis"
'INFO : "rendvis"

関連項目

CustomProperty.AddParameter SIObject.Name