Enabling and disabling an Independent Project File

The Independent Project File option saves a configuration element in its own .xti file instead of in the central .tsproj file. This simplifies version management because changes to individual elements can be tracked in separate files.

This property is controlled via ITcSmTreeItem6.SaveInOwnFile. The interface must be obtained from the Tree Item using a cast. After setting the property, you must save the project so that the .xti file is created.

Requirements

C# sample

// SaveInOwnFile corresponds to the "Independent Project File" option in XAE
ITcSmTreeItem6 item = (ITcSmTreeItem6)sysManager.LookupTreeItem("TIID^Device 1 (EtherCAT)");

if (!item.SaveInOwnFile)
    item.SaveInOwnFile = true;

// To deactivate:
// item.SaveInOwnFile = false;

sysManager.SaveProject();

PowerShell sample

$etherCatMaster = $systemManager.LookupTreeItem("TIID^Device 1 (EtherCAT)")
if ($etherCatMaster.SaveInOwnFile -eq $false)
{
    $etherCatMaster.SaveInOwnFile = $true
}
Enabling and disabling an Independent Project File 1:

SaveInOwnFile corresponds to the “Independent Project File” checkbox in TwinCAT XAE. The property is available via ITcSmTreeItem6 and requires an explicit cast.