我是个新手,所以我希望我没弄错。
我并不是编写DXL的新手,但目前在从布局dxl列调用getProperties时遇到了性能问题,该列应该根据链接模块的枚举类型的模块属性值显示传出链接。代码基本上可以工作,但需要很长时间才能完成。注释掉getProperties调用会让它尽可能快。是的,该调用完全按照DXL Ref手册中所示编写。
使用模块对象和点运算符直接调用属性也不起作用,因为它总是返回枚举默认值,而不是实际值。
欢迎任何想法。
编辑下面添加的示例代码
// couple of declarations snipped
string cond = "Enum selection here" // this is modified from actual code, to show the idea
string linkModName = "*"
ModuleProperties mp
for l in all(o->linkModName) do
{
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
othero = target l
if (null othero)
{
load(otherVersion,false)
}
getProperties(otherVersion, mp)
sTemp = mp.myAttr
if (sTemp == cond) continue
// further code snipped
}发布于 2019-09-25 23:09:07
我不能百分之百确定,但我认为在某些DOORS版本中存在/曾经存在模块属性的性能问题。
您可能希望尝试以下操作,即直接从已加载的模块中获取属性
[...]
othero = target l
Module m
if (null othero)
{
m = load(otherVersion,false)
} else {
m = module othero
}
sTemp = m.myAttr
[...]注意,我没有测试这个代码片段。
https://stackoverflow.com/questions/58094271
复制相似问题