How to get description and name from STEP file.

Hello there,

I'm processing a STEP file which comes with a name as you can see in the nameDesc image attached.
My idea was to access those properties using the following function:

TDocStd_Document::GetName

In that case seems that myMetaData is null (see errorImg image attached).
Am I supposed to fill metadata with?

CDM_Document::SetMetaData(const Handle(CDM_MetaData)& aMetaData)

I thought that using

 
Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc, const Message_ProgressRange& theProgress = Message_ProgressRange());

and

doc->GetName(); 

will be enough...

Kind Regards,

Attachments: 
gkv311 n's picture

Try taking a look onto APIHeaderSection_MakeHeader tool:

STEPCAFControl_Reader aReader;
if (aReader.ReadFile (theFile.ToCString()) != IFSelect_RetDone)
      { Error }
...
Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(aReader.ChangeReader().Model());
        if (!aModel.IsNull())
        {
          APIHeaderSection_MakeHeader aHeader (aModel);
// aHeader.DescriptionValue() and others