简体   繁体   English

使用Abaqus ODB C ++ API访问部件

[英]Accessing parts with Abaqus ODB C++ API

I am using the Abaqus ODB C++ API. 我正在使用Abaqus ODB C ++ API。 I am writing a wrapper to visualize .odb files. 我正在写一个包装程序以可视化.odb文件。

The following code will load the part named "PART-1" into the object part 以下代码将名为“ PART-1”的部分加载到对象part

odb_Odb& odb = openOdb( filename.c_str() );
odb_PartRepository& pr = odb.parts();
odb_Part& part = pr["PART-1"];

This code is great if you know what a part's name is, but how can I access parts when I do not know their name? 如果您知道零件名称是什么,那么这段代码非常有用,但是当我不知道零件名称时如何访问零件? Why would the writers of the API limit us to indexing via string? 为什么API的编写者将我们限制为通过字符串建立索引?

After a lot of searching I found the following solution. 经过大量搜索,我找到了以下解决方案。

See section 10.10.5 Reading results data of this document: http://abaqus.ethz.ch:2080/v6.11/pdf_books/SCRIPT_USER.pdf 请参阅本文档的10.10.5 Reading results data10.10.5 Reading results datahttp : 10.10.5 Reading results data

You must use repository iterators to extract the possible keys. 您必须使用存储库迭代器来提取可能的密钥。

// for example:
odb_StepRepositoryIT stepIter( odb.steps() );
for (stepIter.first(); !stepIter.isDone(); stepIter.next())
{
    cout << stepIter.currentKey().CStr() << endl;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM