有没有工具可以把一个xpo文件分成多个xpo文件?与CombineXPOs的功能完全相反。
我这样问的原因是因为我需要将多个单独的xpo/model版本放到源代码控制中,并且我希望避免每次都必须先导入它们,因为这太耗时了。
发布于 2015-02-09 08:03:54
在理解之后,我会更多地思考你想要的东西。这里有一份工作,它为你提供了大部分如何做你想做的事情的例子。
注意需要完成的TODO's。
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");
}https://stackoverflow.com/questions/28399217
复制相似问题