Obtaining the "other" name entity from PRODUCT in Step file.

Good afternoon,

I have a large step file with the following lines:


Currently I have a recursive method in which i iterate over all subassemblies/parts. In this method I'm using this code to obtain the partname of a refLabel:

std::string shapeName;
Handle(TDataStd_Name) nameAttribute;
if (refLabel.FindAttribute(TDataStd_Name::GetID(), nameAttribute))
TCollection_AsciiString asciiName = nameAttribute->Get();
shapeName = asciiName.ToCString();

This gives me a shapeName value of "name2". I need to obtain the 'name1' parameter. Is there any way to do this?

Thanks in advance,

Dmitrii Pasukhin's picture

Hello, please a look:

part number is missing inside the shape's information - Forum Open Cascade Technology

Currently, we have no API to modify name extracting behavior.

Best regards, Dmitrii.