Named face in OCAF

Hello, community!
I need to give names to all the face of the cube and write them into the STEP file (for searching by name face). Below is my code certain functions (c++ with qt), which makes it, but not completely. The name given to the cube of the STEP file is written, but the names for the Face of the cube does not.
Please tell me the correct decision.

bool instep::writeSTEP(QString& r_filePath)
{
//initiation document OCAF
Handle(TDocStd_Application) anApp = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aDoc;
anApp->NewDocument ("StepXCAF", aDoc);
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool ( aDoc->Main() );
TDF_Label aLabel = myAssembly->NewShape();

//creating a cube, for example
Standard_Real x, y, z;
x = y = z = 50;
BRepPrimAPI_MakeBox myBox( x, y, z );
TopoDS_Shape cube = myBox.Shell();
myAssembly->SetShape(aLabel, cube);
TDataStd_Name::Set(aLabel, "TheCube1");

//setting names for every face
TopExp_Explorer Ex1;
int i = 0;
for ( Ex1.Init(cube, TopAbs_FACE); Ex1.More(); Ex1.Next() )
{
QString numName = QString("Face%1").arg(i);
TDF_Label subLabel = myAssembly->AddSubShape (aLabel, Ex1.Current());
TDataStd_Name::Set(subLabel, qPrintable(numName));
i++;
}

//writing STEP
STEPControl_StepModelType mode = STEPControl_AsIs;
STEPCAFControl_Writer writer;
writer.SetNameMode( true );
if ( !writer.Transfer ( aDoc, mode ) )
{
m_Error = "The document cannot be translated or gives no result";
return false;
}
IFSelect_ReturnStatus stat = writer.Write( qPrintable (r_filePath) );
if ( stat != IFSelect_RetDone)
{
m_Error = "The document was not recorded";
return false;
}

return true;
}

chen's picture

Hi,Dmitry:
I meet the same problems.
I want to load a step file, which contains a lot of sub-shapes,but these sub-shapes don't contain the attribute of Name. So I want to attach the name attribute to the sub-shapes.
Do you solve this problem,Now?
Thanks a lot.
Chen