Unable to read STEP file with stepocafcontrol

Hi All,

I am able to read and display a complete assembly (STEP) using stepcontrol.

but when I try to read same assembly (STEP) with names of components, colors etc. using stepcafcontrol, I am unable to do so.

Any Clues ?

Thanks in Advance

Shamher

Shamsher's picture

Here is my code

 reader.ReadFile ("afile.step");*/
    STEPCAFControl_Reader reader;
    reader.ReadFile("filename.STEP");
   // reader.TransferRoots();
    //Standard_Integer STEPCAFControl_Reader::NbRootsForTransfer     ();
    // Loads file MyFile.stp
    //Standard_Integer NbRoots = reader.NbRootsForTransfer();
    // gets the number of transferable roots
    //cout;Number of roots in STEP file: ; NbRootsendl;
    //Standard_Integer NbTrans = reader.TransferRoots();
    // translates all transferable roots, and returns the number of    //successful translations
    //cout;STEP roots transferred: ; NbTransendl;
    //cout;Number of resulting shapes is: ;reader.NbShapes()endl;
   // STEPCAFControl_Reader::STEPCAFControl_Reader     ( reader        ) ;
    TopoDS_Compound result = reader.GetNameMode();
    // obtain the results of translation in one OCCT shape
      Handle_AIS_Shape anAisBox = new AIS_Shape(result);
    anAisBox->SetColor(Quantity_NOC_BLUE1);
    mContext->Display(anAisBox);