Command.4.vbs Example

Applies To

Command object

Description

This VBScript example demonstrates how to find a built-in (or native) Softimage command using its scripting name. Loop through the Softimage command collection looking for a name match

Code

for each c in Application.Commands
	if c.ScriptingName = "FreezeObj" then
		' At this point, you could either... 
		' ...get its name to use elsewhere ...
		sScpName = c.Name
		' ...use it to create a Command object...
		set oCmd = c
		' ...or perform whatever action you want on it, like demonstrating 
		'    the difference between the Name and ScriptingName properties
		Application.LogMessage "FreezeObj info......." & vbLf _
			& vbTab & "Name          = " & c.Name & vbLf _
			& vbTab & "ScriptingName = " & c.ScriptingName
	end if
next
' With the new command pointer, we can access command information
Application.LogMessage oCmd.Name & ": Belongs to the " & oCmd.Category & " category/menu."
' Now that we know the command's full name, we can access the command using 
' the name as the key in the command collection
set oCommand = Application.Commands( sScpName )
Application.LogMessage oCommand.Name & ": " & oCommand.Description

' --------------------------------------------------------------------------
' Output of above script:
'INFO : "FreezeObj info.......
'	Name          = Freeze Operator Stack
'	ScriptingName = FreezeObj"
'INFO : "Freeze Operator Stack: Belongs to the Edit category/menu."
'INFO : "Freeze Operator Stack: Freeze all the operators of the selected object(s)"

Related Examples

Command.1.js

Command.2.js

Command.3.js

Command.5.js

Keywords

Command Execute GetFlag SetFlag Update Arguments Builtin CannotBeUsedInBatch Category Code Description Enabled FileName Handler IsNotLogged Language ReturnValue ScriptingName SupportsKeyAssignment Tooltip UID


Autodesk Softimage 2011