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

Good afternoon,

I have a large step file with the following lines:

#549838=PRODUCT('name1','name2','Description',(#549727));
#549421=PRODUCT_DEFINITION('name1','name2',#549559,#549310);
#549697=PRODUCT_RELATED_PRODUCT_CATEGORY('name2','name2',(#549838));
#2343=NEXT_ASSEMBLY_USAGE_OCCURRENCE('name2:1','name2:1','name2:1',#549417,#549421,'name2:1');

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,
Martijn

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.