我正在使用Abaqus ODB C++ API。我正在编写一个包装器来可视化.odb文件。
下面的代码将把名为" part -1“的部件加载到对象part中
odb_Odb& odb = openOdb( filename.c_str() );
odb_PartRepository& pr = odb.parts();
odb_Part& part = pr["PART-1"];如果你知道部件的名称,这段代码很棒,但是当我不知道部件的名称时,我如何访问它们呢?为什么API的编写者会限制我们通过字符串进行索引?
发布于 2012-08-10 04:25:59
经过大量的搜索,我找到了以下解决方案。
请参阅本文档的10.10.5 Reading results data部分:http://abaqus.ethz.ch:2080/v6.11/pdf_books/SCRIPT_USER.pdf
您必须使用存储库迭代器来提取可能的密钥。
// for example:
odb_StepRepositoryIT stepIter( odb.steps() );
for (stepIter.first(); !stepIter.isDone(); stepIter.next())
{
cout << stepIter.currentKey().CStr() << endl;
}https://stackoverflow.com/questions/11782417
复制相似问题