
Mon, 10/20/2003 - 16:21
Forums:
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.
Wed, 04/16/2008 - 17:17
I need that too...
further thanks
Mathias
Thu, 04/17/2008 - 13:02
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.