简体   繁体   中英

Accessing parts with Abaqus ODB C++ API

I am using the Abaqus ODB C++ API. I am writing a wrapper to visualize .odb files.

The following code will load the part named "PART-1" into the object 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?

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

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;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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