喜有一个模块在门上的客户要求,但现在我收到了一个新的PDF文件,其中包含更新/新的要求。我能够将PDF文件转换为ReqIf,并使用公司的内部工具创建一个新的模块。
我如何才能与两个模块合并成一个基于一个指定的属性,其中包含两个模块上的唯一I。
单元A:
单元B:
全球ID 2-另一个attribute
中的新信息
模块C (A+B):
中的新信息
发布于 2021-03-15 11:12:44
我假设除了另一个属性中的新信息外,rest在两个模块之间都是相同的。下面的脚本使用新模块更新当前模块
Module m = current
Object ob, ob1
ModName_ mod = module "full path of new module here"
Module m1 = read(fullName(mod), false)
for ob in m do
{
int objID = intOf(ob."Absolute Number""")
ob1 = object(objID, m1)
if(ob."Attribute Name" != ob1."Attribute Name") //If new info in another attribute
{
ob."Attribute Name" = ob1."Attribute Name"
}
}发布于 2021-03-15 14:13:05
我根据你的评论修改了脚本
Module m = current
Object ob, ob1
ModName_ mod = module "full path of new module here"
Module m1 = read(fullName(mod), false)
for ob in m do
{
int objID = intOf(ob."Absolute Number""")
ob1 = object(objID, m1)
if((ob."Object Heading" != ob1."Object Heading") || (ob."Object Text" != ob1."Object Text"))
{
ob."Object Heading" = ob1."Object Heading"
ob."Object Text" = ob1."Object Text"
}
}https://stackoverflow.com/questions/66636568
复制相似问题