how to convert step model to cascade shape?

In my project, i construct the step model step by step use the api, when the construct process is finished, i need to transfer this model to cascade shape, the following is my code which used to transfer,but the result shape is null.

//create the session
Handle(XSControl_WorkSession) xws = new XSControl_WorkSession;

//initialize the model
Handle(StepData_StepModel) newmodel=new StepData_StepModel;

....

Handle(StepGeom_CartesianPoint) n1=new StepGeom_CartesianPoint;
Handle(TColStd_HArray1OfReal) p3=new TColStd_HArray1OfReal(1,3);
p3->SetValue(1,0.0);p3->SetValue(2,0.0);p3->SetValue(3,0.0);
n1->Init(new TCollection_HAsciiString(""),p3);
newmodel->AddEntity(n1);
newmodel->SetIdentLabel(n1, 1);

Handle(StepGeom_Direction) n2=new StepGeom_Direction;
Handle(TColStd_HArray1OfReal) dn2=new TColStd_HArray1OfReal(1,3);
dn2->SetValue(1,0.0);dn2->SetValue(2,1.0);dn2->SetValue(3,0.0);
n2->Init(new TCollection_HAsciiString(""),dn2);
newmodel->AddEntity(n2);
newmodel->SetIdentLabel(n2, 2);

Handle(StepGeom_Direction) n3=new StepGeom_Direction;
Handle(TColStd_HArray1OfReal) dn3=new TColStd_HArray1OfReal(1,3);
dn3->SetValue(1,1.0);dn3->SetValue(2,0.0);dn3->SetValue(3,0.0);
n3->Init(new TCollection_HAsciiString(""),dn3);
newmodel->AddEntity(n3);
newmodel->SetIdentLabel(n3, 3);

....

//set the step model
xws->SetModel(newmodel,Standard_False);
//link the session with reader
STEPControl_Reader reader_new(xws,Standard_False);
reader_new.TransferRoots();

I dont know how to deal with it? who can help me? thanks.

alexwan's picture

The problem has been resolved.thanks.