For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Write colors in step file

Hilaire's picture
Forums: 

Hello,

I try to save shape's color into a step file without success. Here is my code :

getApp()->NewDocument("XmlOcaf", _ExportedDoc);
_shapeTool = XCAFDoc_DocumentTool::ShapeTool(_ExportedDoc->Main());
_writer.Init(m_writer.Writer().WS(),Standard_False);

_writer.SetNameMode(true);
_writer.SetColorMode(true);
_writer.Writer().Model(Standard_True);

Interface_Static::SetIVal("write.step.assembly",1);
Interface_Static::SetCVal("write.step.schema", "AP214DIS");

_colorsTool = XCAFDoc_DocumentTool::ColorTool(_ExportedDoc->Main());
TDF_LabelList colorList;

// Add colors
// Red
colorList.Append(_colorsTool->AddColor(Quantity_Color(Quantity_NOC_RED)));
// Green
// ...

// Then I give the color to shape label
_colorsTool->SetColor( myShapeLabel ,Quantity_Color( dRed, dGreen, dBlue, Quantity_TOC_RGB ), XCAFDoc_ColorSurf);

// Then I wrote the file
_writer.Transfer(_ExportedDoc, STEPControl_AsIs);
_writer.Write( myFileName );

But it seems there is no color in the resulting file! Can anyone help me please ?

Bruno