ValueMap.Set operator

Introduced

v9.0 (2011)

Description

Sets the value that matches the specified name. If no entry exists matching this name, it automatically adds the name-value pair. If an entry matching that name already exists, the value is updated.

C# Syntax

ValueMap.Set( String in_name, Object in_Value );

Scripting Syntax

ValueMap.Set( in_name, in_value );

Parameters

Parameter Type Description
in_name String The name of the value to set.
in_value Variant The value to set.

Examples

1. Python Example

# See the example under the ValueMap.Remove method

2. VBScript Example

'
'	This example demonstrates how to add a new name-value pair
'	to the ValueMap by calling the Set method using a name
'	that is not already defined in the ValueMap.
'
for each oShaderDef in Application.ShaderDefinitions
	if (UBound(oShaderDef.Attributes.Names) > -1) then
		oShaderDef.Attributes.Set "Dirty", True
		aNames = oShaderDef.Attributes.Names
		aValues = oShaderDef.Attributes.Values
		Application.LogMessage oShaderDef.Name & " has " & UBound(aNames)+1 & " attribute(s):"
		for i=0 to UBound(aNames)
			Application.LogMessage vbTab & "- " & aNames(i) & " == '" & _
				oShaderDef.Attributes.Get(aValues(i)) & "'"
		next
		exit for
	end if
next
' INFO : Softimage.soft_light.1.0 has 2 attribute(s):
' INFO : 	- {C535FA4D-E44A-45EB-AEE0-9F9AAEA91745} == ''
' INFO : 	- Dirty == 'True'

See Also

ValueMap.Get ValueMap.Names ValueMap.Values