IGES export

Hi,

how can I keep the color of an AIS_InteractiveObject during IGES export.

My code :
Handle(TopTools_HSequenceOfShape) seqShape;
.
.
Handle(AIS_InteractiveObject) obj = ....
if( obj->IsKind(STANDARD_TYPE(AIS_Shape)) ) {
TopoDS_Shape shape = Handle(AIS_Shape)::DownCast(obj)->Shape();
if( seqShape.IsNull() )
seqShape = new TopTools_HSequenceOfShape();
seqShape->Append(shape);
}

IGESControl_Controller::Init();
IGESControl_Writer writer("MM", 0);

for( k = 1; k Length(); k++ )
writer.AddShape(seqShape->Value(k));
writer.ComputeModel();

writer.Write("test.igs");

When I read the iges file whith a CAD system, all entities are white.

Thank everyone who can help me.

Mathias Neyer's picture

I need that too...

further thanks

Mathias

Marco Matt's picture

Hi,
you need to create an OCAF document.
To read an iges file you use IGESCAFControl_Reader.
To write an iges file use IGESCAFControl_Writer.
Woth OCAF you can manage shapes (XCAFDoc_ShapeTool), colors (XCAFDoc_ColorTool), layers (XCAFDoc_LayerTool), etc.