SavePreset

Introduced

v1.0

Description

Saves a preset of the specified objects.

This command is available from every property page, by clicking the "Load" button in the top right-hand corner.

Scripting Syntax

oReturn = SavePreset( InputObj, PresetName, [PresetPath], [PresetLocation], [Overwrite], [CreateThumbnail], [Description] );

Return Value

Returns the preset object. This is an internal object not exposed to the SDK, but you can pass the object to the Application.LogMessage method to get its full path and filename.

Parameters

Parameter Type Description
InputObj String The object to be saved.
PresetName String Name of the preset.
PresetPath String Specify a full or a partial path.
PresetLocation siPresetLocation The preset location where to save the preset.

Default Value: siDefaultLocation

Overwrite Boolean If the file exist do you want to overwrite it?

Default Value: True

CreateThumbnail Boolean If true, the render region will be used to create a thumbnail for the preset

Default Value: False

Description String Preset Description

Examples

VBScript Example

dim obj, pst

set obj = CreatePrim( "Cone", "MeshSurface" )

' SavePreset gives an error if the preset already exists

'On Error Resume Next

'set pst = SavePreset( obj, "myPreset", , siUser )

'msgbox "Preset already exists"

' You can force an overwrite like this:

set pst = SavePreset( obj, "myPreset", , siUser, True )

Application.LogMessage pst 

' Expected results:

'INFO : <XSI_HOME>\Data\DSPresets\3DObjects\myPreset.Preset

See Also

LoadPreset