首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将xpo拆分成多个xpo文件

将xpo拆分成多个xpo文件
EN

Stack Overflow用户
提问于 2015-02-09 04:51:38
回答 1查看 607关注 0票数 4

有没有工具可以把一个xpo文件分成多个xpo文件?与CombineXPOs的功能完全相反。

我这样问的原因是因为我需要将多个单独的xpo/model版本放到源代码控制中,并且我希望避免每次都必须先导入它们,因为这太耗时了。

EN

回答 1

Stack Overflow用户

发布于 2015-02-09 08:03:54

在理解之后,我会更多地思考你想要的东西。这里有一份工作,它为你提供了大部分如何做你想做的事情的例子。

注意需要完成的TODO's

代码语言:javascript
复制
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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28399217

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档