Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

Import STEP and Mapping TopoDS

Import STEP and Mapping TopoDS
HanJeongho 2012/08/30 21:13

I want to step data import into TopoDS data.

So, i read Data Exchange- STEP user manual, and i find StepToTopoDS_* class

But, i don't know that how can i using this class

In the manual, for using StepToTopoDS Class, i must call the Transfer_TransferProcess, STEPControl_ActorRead, and StepTopoDS_Builder(in the Graph of calls)

so i try like this,

IFSelect_ReturnStatus status = aReader.ReadFile(aFileName);

     if (status != IFSelect_RetDone)
          return status;
//Some code for transfer ex) Standard_Boolean ok = aReader.TransferRoot(i);
Handle(TColStd_HSequenceOfTransient) list = aReader.GiveList();
Handle(STEPControl_ActorRead) actor = new STEPControl_ActorRead();
for (i = 1; i <= nb; i ++) {
Handle(Standard_Transient) start = list->Value(i);
Standard_Boolean OK = actor->Recognize(start);
//Call STEPControl_ActorRead Class
//Call StepToTopoDS_Builder
//Call StepToTopoDS_Translate* Class
I know, this is not good code...
So, how can using the StepToTopoDS_* Class?
Please, show me some example code or process for call this classes.

Thank you, Have a nice day!
PG 2012/08/31 06:29

Have a look at this sketchy code:
STEPControl_Reader aReader;
IFSelect_ReturnStatus status = aReader.ReadFile(aFileName);
if (status != IFSelect_RetDone)
return status;

aReader.WS()->MapReader()->SetTraceLevel(2); // increase default trace level

Standard_Boolean failsonly = Standard_False;
aReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity);

// Root transfers
Standard_Integer nbr = aReader.NbRootsForTransfer();
aReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity);
for ( Standard_Integer n = 1; n<=nbr; n++) {
Standard_Boolean ok = aReader.TransferRoot(n);

// Collecting resulting entities
Standard_Integer nbs = aReader.NbShapes();
if (nbs == 0) {
return IFSelect_RetVoid;
for (Standard_Integer i=1; i<=nbs; i++) {

HanJeongho 2012/08/31 07:08
Thank you for your answer.

I'm already complete of import STEP, just into TopoDS_Shape


So, i want the method for Translating into Topology(package StepToTopoDS)

Thank you!
Latest news
  • Open CASCADE CAD Assistant for iOS platform is available!
  • Open CASCADE Technology 6.9.0 is available for download!
  • JT Assistant for Android

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map