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


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());


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

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

// Add colors
// 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 ?