## ExportICECompoundNode

### Introduced

v7.0

### Description

Exports the specified ICECompoundNode to a file.

### Scripting Syntax

    oString = ExportICECompoundNode( [Compound], FullPath, Directory, Name, Version, [Private], [ForceEmbedded] );

### Return Value

String

### Parameters

Parameter | Type | Description
--- | --- | ---
Compound | SelectionList or Selection | The compound you want to export Default Value: If no argument is specified, the current selection is used.
FullPath | String | If this parameter is used, the compound will be exported to that particular path and filename
Directory | String | If FullPath is not defined, the path is built using Directory, Name and Version. The extension is provided automatically based on the Private flag.
Name | String | Name of the compound. If not defined, it uses the current class name of the compound. If this value is different from the compound classname, it uses this value as the new compound classname.
Version | String | Version of the compound. If undefined, it uses the current version of the compound.
Private | Boolean | Export the compound in the XML format or as an encoded binary version. Private compounds cannot be edited in the IceTree view and all internal compounds are saved as ForceEmbedded. Default Value: false
ForceEmbedded | Boolean | If true, all internal compounds are saved inside the file. If false, exported compounds are saved as if they were factory nodes. Default Value: false

### Examples

#### JScript Example

    /*
            This example demonstrates how to use the ExportICECompoundNode command to
            create both an XML and private (binary) version of a compound.
    */
    NewScene(null , false);
    CreatePrim("Cone", "MeshSurface");
    ApplyOp("ICETree", "cone", siNode, siPersistentOperation, null, siConstructionModeModeling);
    // Create a new ICE Compound
    AddICECompoundNode("Set Data", "cone.polymsh.ICETree");
    SetValue("cone.polymsh.ICETree.Set_Data.Reference", "Self.PointPosition");
    AddPortToICENode("cone.polymsh.ICETree.Set_Data.Value", siNodePortDataInsertionLocationAfter);
    SetValue("cone.polymsh.ICETree.Set_Data.Reference1", "Self.PointVelocity");
    AddPortToICENode("cone.polymsh.ICETree.Set_Data.Value1", siNodePortDataInsertionLocationAfter);
    SetValue("cone.polymsh.ICETree.Set_Data.Reference2", "Self.Color");
    CreateICECompoundNode("cone.polymsh.ICETree.Set_Data", "PointValues");
    // Export a public version of the compound (using XML format)
    var userCompounds = XSIUtils.BuildPath( Application.InstallationPath(siUserPath), "Data", "Compounds" );
    var exportPath = XSIUtils.BuildPath(userCompounds, "PointValues.xsicompound");
    XSIUtils.EnsureFolderExists(exportPath, true);
    var pubCmpd = ExportICECompoundNode("cone.polymsh.ICETree.PointValues", exportPath);
    Application.LogMessage(pubCmpd);
    SetValue("cone.polymsh.ICETree.PointValues.Set_Data.Value_x", 5);
    SetValue("cone.polymsh.ICETree.PointValues.Set_Data.Value_y", 5);
    SetValue("cone.polymsh.ICETree.PointValues.Set_Data.Value_z", 5);
    // Export a private version
    Application.LogMessage( ExportICECompoundNode("cone.polymsh.ICETree.PointValues", "",
            userCompounds, "MyPrivatePointValue", "1.1", true) );
    // INFO : <user_path>\Data\Compounds\PointValues.xsicompound
    // INFO : <user_path>\Data\Compounds\MyPrivatePointValue.1.1.xsicompoundp

### See Also

CreateICECompoundNode EditExposedParamInICECompoundNode EditICECompoundPPGLogic EditICECompoundProperties GetICECompoundPortProperties GetICECompoundProperties ICECompoundNode