CreateAddonDirectories

Introduced

5.0

Description

Creates a subdirectory for an add-on in the Addons directory.

For example, if the AddonName is Foo and the RootPath is the User path, CreateAddonDirectories creates the directory <userpath>/Addons/Foo as well as nested subdirectories such as <userpath>/Addons/foo/Application/Plugins.

Putting add-on content in the directories created by CreateAddonDirectories allows Softimage to find the add-on files and makes it easy for you to package the files in a .xsiaddon file. For example, you should put any toolbars used by the add-on in the "<userpath>/Addons/foo/Application/toolbars" folder.

Note: This command does nothing if the add-on already exists.

Scripting Syntax

CreateAddonDirectories( RootPath, AddonName )

Parameters

Parameter

Type

Description

RootPath

String

Location to create the add-on directories. This is typically the User path (siUserPath) or a workgroup location (see XSIApplication.Workgroups).

AddonName

String

Name of the add-on

Return Value

An empty String if successful, and an error message otherwise. Common causes of failure are invalid path arguments or insufficient permissions to create folders at the specified location.

Examples

JScript Example

/*
   This example showing a failed attempt to create an addon
   at an invalid path (":" is not a valid character for a directory name)
*/
strErrMsg = CreateAddonDirectories( Application.InstallationPath( siUserPath ), ":foo" ) ;
   
if ( strErrMsg.length > 0 )
   XSIUIToolkit.MsgBox( strErrMsg ) ;

See Also

CreateWorkgroupDirectories



Autodesk Softimage v7.5