Splitting xpo into multiple xpo files

Is there a tool to split an xpo file into multiple xpo files? The exact opposite of what CombineXPOs does.

The reason I'm asking is because I need to put several single versions of xpo / models in the original control, and I want to avoid having to import them every time it's too long.

+4
source share
1 answer

Understanding, I think, a little more than what you wanted. Here is a job that gives you pretty much most examples of how to do what you want.

Pay attention to TODO'swhich needs to be filled.

static void JobImportXPOs(Args _args)
{
    SysVersionControlSystem vcs = versionControl.parmSysVersionControlSystem();
    SysImportElements       sysImportElements   = new SysImportElements();
    TmpAotImport            tmpAotImport;
    Filename                fileName = @"C:\Temp\testXPO.xpo";
    SysVersionControllable  controllable;
    TreeNode                treeNode;

    sysImportElements.newFile(fileName);
    sysImportElements.parmAddToProject(false);
    sysImportElements.parmImportAot(true);

    tmpAotImport = sysImportElements.getTmpImportAot();

    while select tmpAotImport
    {
        treeNode = TreeNode::findNode(tmpAotImport.TreeNodePath);

        if (!treeNode)
        {
            // New object being added to AX
            // TODO - Remember this object and add this to VCS system at the end for check-in
            continue;
        }

        controllable = SysTreeNode::newTreeNode(treeNode);

        if (!controllable)
        {
            error(strFmt("Error processing %1 (%2) from file %3", tmpAotImport.TreeNodeName, tmpAotImport.TreeNodePath, Filename));
            continue;
        }

        if (vcs.allowCreate(controllable))
        {
            info(strFmt("Planning to add to VCS %1 for import", tmpAotImport.TreeNodePath));
            // TODO - Remember to add this to VCS at the end of the import
        }
        else if (vcs.allowCheckOut(controllable))
        {
            info(strFmt("Checking out %1 for import", tmpAotImport.TreeNodePath));
            // TODO - Remember to check this specific object back in at the end of the import
        }
    }

    // Do the actual import
    sysImportElements.import();

    // TODO - Check in all of the objects we just handled

    info("Done");
}
+3
source

All Articles