SIObject.Name operator

Description

Sets or returns the name of the object as a String. The name accessed through this property is the object's name without context. For example, Name and SIObject.FullName return the same thing for X3DObject objects (for example, "cube"), but on a Primitive object, Name returns the type of geometry ("Polygon Mesh"), whereas FullName returns the object name string expression including the parent object ("cube.polymsh").

For ActionDeltaItems, this property returns the Relative Name because Deltas store the relative name instead of the SIObject.FullName of a parameter so actions can be easily copied from one Model to another.

The difference between the various name properties is especially important to remember when you are working with commands, because the Name of the command is not what you use when writing scripts, or what gets logged to the History pane. That information is contained in the Command.ScriptingName property.

Note: Not all objects can be renamed. If you try to set the name on some objects (such as parameters on built-in Softimage parameter/property sets), it doesn't work, but it doesn't raise an error either.

C# Syntax

// get accessor
String rtn = SIObject.Name;
// set accessor
SIObject.Name = String;

Examples

1. VBScript Example

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This snippet creates a sphere (called 'sphere' by default)
' and then changes its name to "NewName"
set oObj = ActiveProject.ActiveScene.Root.AddGeometry("Sphere", "NurbsSurface")
printName oObj			' default name = "sphere"
oObj.Name = "NewName"
printName oObj			' new name = "NewName"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This snippet tries to change the name of a built-in 
' parameter with no luck
set oParam = oObj.Properties( "Visibility" ).Parameters( "viewvis" )
printName oParam			' name = "View Visibility"
oParam.Name = "ThisWontWork"
printName oParam			' name is still the same
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function printName( in_obj )
	Application.LogMessage in_obj.Name
end function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Output of above script:
'INFO : "sphere"
'INFO : "NewName"
'INFO : "View Visibility"
'INFO : "View Visibility"

2. VBScript Example

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This example demonstrates the differences between the name information you can
' access in Softimage. Specifically, it shows when you can use the Name, FullName, 
' ScriptingName, and ScriptName properties and what information they return.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CreateParticleCloud()
Application.LogMessage "PARTICLE CLOUD INFO.............."
showNames selection(0), "particle cloud"
set oCube = activesceneroot.addgeometry( "cube", "meshsurface" )
Application.LogMessage typename( oCube.parameters(0) )
Application.LogMessage "OBJECT INFO.............."
showNames oCube, "oCube"
Application.LogMessage "PRIMITIVE INFO.............."
showNames oCube.activeprimitive, "oCube.activeprimitive"
Application.LogMessage "GEOMETRY INFO.............."
showNames oCube.activeprimitive.geometry, "oCube.activeprimitive.geometry"
Application.LogMessage "PARAMETER INFO.............."
showNames oCube.activeprimitive.parameters(0), "oCube.activeprimitive.parameters(0)"
Application.LogMessage "PROPERTIES INFO.............."
showNames oCube.properties(0), "oCube.properties(0)"
Application.LogMessage "PARAMETER INFO.............."
showNames oCube.parameters(0), "oCube.parameters(0)"
Application.LogMessage "COMMAND INFO.............."
showNames application.commands(0), "application.commands(0)"
removefromselection oCloud 
addtoselection oCube 
set oOps = applyop( "twist" )
Application.LogMessage "OPERATOR INFO.............."
showNames oOps(0), "oOps(0)"

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function showNames( in_ShowMe, in_ErrWhere )
	Application.LogMessage "-------------------------------------------------------------------"
	if typename( in_ShowMe ) <> "Nothing" then
		Application.LogMessage "Name = " & in_ShowMe.Name
		Application.LogMessage "FullName = " & in_ShowMe.FullName
		if typename( in_ShowMe ) = "Command" then
			Application.LogMessage "ScriptingName = " & in_ShowMe.ScriptingName 
		else
			Application.LogMessage "ScriptingName is not available for the " _
				& in_ShowMe.Name & " (it's only for commands)"
		end if
		if typename( in_ShowMe ) = "Parameter" then
			Application.LogMessage "ScriptName = " & in_ShowMe.ScriptName
		else
			Application.LogMessage "ScriptName is not available for the " _
				& in_ShowMe.Name & " (it's only for parameters)"
		end if
	else
		Application.LogMessage "Object required for " & in_ErrWhere
	end if
	Application.LogMessage "-------------------------------------------------------------------"
end function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' OUTPUT OF THIS SCRIPT IS:
'INFO : "PARTICLE CLOUD INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = cloud"
'INFO : "FullName = cloud"
'INFO : "ScriptingName is not available for the cloud (it's only for commands)"
'INFO : "ScriptName is not available for the cloud (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"
'INFO : "Parameter"
'INFO : "OBJECT INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = cube"
'INFO : "FullName = cube"
'INFO : "ScriptingName is not available for the cube (it's only for commands)"
'INFO : "ScriptName is not available for the cube (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"
'INFO : "PRIMITIVE INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = Polygon Mesh"
'INFO : "FullName = cube.polymsh"
'INFO : "ScriptingName is not available for the Polygon Mesh (it's only for commands)"
'INFO : "ScriptName is not available for the Polygon Mesh (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"
'INFO : "GEOMETRY INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = polymsh"
'INFO : "FullName = polymsh"
'INFO : "ScriptingName is not available for the polymsh (it's only for commands)"
'INFO : "ScriptName is not available for the polymsh (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"
'INFO : "PARAMETER INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Object required for oCube.activeprimitive.parameters(0)"
'INFO : "-------------------------------------------------------------------"
'INFO : "PROPERTIES INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = Kinematics"
'INFO : "FullName = cube.kine"
'INFO : "ScriptingName is not available for the Kinematics (it's only for commands)"
'INFO : "ScriptName is not available for the Kinematics (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"
'INFO : "PARAMETER INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = Name"
'INFO : "FullName = cube.Name"
'INFO : "ScriptingName is not available for the Name (it's only for commands)"
'INFO : "ScriptName = Name"
'INFO : "-------------------------------------------------------------------"
'INFO : "COMMAND INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = Volumic"
'INFO : "FullName = Volumic"
'INFO : "ScriptingName = AddProp"
'INFO : "ScriptName is not available for the Volumic (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"
'INFO : "OPERATOR INFO.............."
'INFO : "-------------------------------------------------------------------"
'INFO : "Name = Twist Op"
'INFO : "FullName = cube.polymsh.twistop"
'INFO : "ScriptingName is not available for the Twist Op (it's only for commands)"
'INFO : "ScriptName is not available for the Twist Op (it's only for parameters)"
'INFO : "-------------------------------------------------------------------"

See Also

SIObject.FullName Command.ScriptingName Parameter.ScriptName