Unable to Set the Product Header item in IGES file

I'm trying to set the author, company, and product parameters using the following code:

IGESControl_Writer writer;
Interface_Static::SetCVal("write.iges.header.company", "MyCompany");
Interface_Static::SetCVal("write.iges.header.product", "MyProduct");
Interface_Static::SetCVal("write.iges.header.author", "ThisIsMe");
Interface_Static::SetCVal ("write.iges.header.receiver","ReceiverName");

However, I always get the default values in the output IGES file,If I use the above code snippet:

S0000001
,,31HOpen CASCADE IGES processor 6.3,13HFilename.iges, G0000001
16HOpen CASCADE 6.3,31HOpen CASCADE IGES processor 6.3,32,308,15,308,15,G0000002
4HReceiverName,1.,2,2HMM,1,0.01,15H20090317.174302,1E-007,210.,5HThisIsMe,6HMyCompany,G0000003
11,0,15H20090317.174302,; G0000004

I've found that if I call writer.Model()->ApplyStatic() that the "author" , "company" and "Receiver" values get set, but I cannot change the "product" header item.

Any guidance on how to modify this value of Product header item in IGES File is welcome....

Thanks in Advance
--suman

PG's picture

Hello,
I am uanble to set the 'mode' too to change to 'BREP' mode.

Interface_Static::SetIVal("write.iges.writebrep.mode",1);

Is something more to be coded after this to actually change
the translation mode ?
- PG

PS: Also I am not able to use the call [writer.Model()->ApplyStatic()] as described above.

Alexander Alexanov's picture

Spend almost half day with the same problem. Nothing helps. We need a Guru.

Forum supervisor's picture

Dear Alexander,
You can try to call IGESControl_Controller::Init() before creating IGESControl_Writer (see the issue #23679).

Best regards
FSR

Alexander Alexanov's picture

Dear Supervisor,

IGESControl_Controller::Init() before creating IGESControl_Writer not help.
I can't change even file name.
S0000001
,,31HOpen CASCADE IGES processor 6.7,13HFilename.iges, G0000001
16HOpen CASCADE 6.7,31HOpen CASCADE IGES processor 6.7,32,308,15,308,15,G0000002

It seems to me I can changes only following items:

receiver
author
company

and only when I call IGESData_IGESModel::ApplyStatic(). I need change at least file name. Shell I modify source code for that?

See ApplyStatic code:

//=======================================================================
//function : ApplyStatic
//purpose :
//=======================================================================

Standard_Boolean IGESData_IGESModel::ApplyStatic
(const Standard_CString param)
{
if (param[0] == '\0') {
//Standard_Boolean ret = Standard_True; //szv#4:S4163:12Mar99 not needed
ApplyStatic("receiver"); //szv#4:S4163:12Mar99 'ret =' not needed
ApplyStatic("author"); //szv#4:S4163:12Mar99 'ret =' not needed
ApplyStatic("company"); //szv#4:S4163:12Mar99 'ret =' not needed
return Standard_True;
}

Standard_CString val;
if (param[0] == 'r') {
val = Interface_Static::CVal("write.iges.header.receiver");
if (!val || val[0] == '\0') return Standard_False;
theheader.SetReceiveName (new TCollection_HAsciiString(val));
}
if (param[0] == 'a') {
val = Interface_Static::CVal("write.iges.header.author");
if (!val || val[0] == '\0') return Standard_False;
theheader.SetAuthorName (new TCollection_HAsciiString(val));
}
if (param[0] == 'c') {
val = Interface_Static::CVal("write.iges.header.company");
if (!val || val[0] == '\0') return Standard_False;
theheader.SetCompanyName (new TCollection_HAsciiString(val));
}
return Standard_True;
}