How to initialize ODA STEP SDK for using SDAI API ?

  1. FAQ
  2. »
  3. STEP

The main initialization procedure is the same as for STEP SDK C++ API usage:


 
// Common ODA IFC SDK initialization part
OdStaticRxObject<MyServices> svcs;
odrxInitialize(&svcs);
odStepInitialize(false /* No CDA */, false /* No geometry calculation needed */);

 
// SDAI calls can be performed just after common initialization procedure
SdaiSession session = sdaiOpenSession();

 
// Preload schema which is used within c:\\file.step
SdaiString schemaFileName = "c:\\AP214E3_2010.exp";
sdaiGetSchema(schemaFileName);

 
SdaiRep repo = _sdaiCreateRepositoryFromFile(session, "c:\\file.step", "");
SdaiRep repoOpened = sdaiOpenRepositoryBN(session, "c:\\file.step ");
SdaiModel modelRO = sdaiAccessModelBN(repoOpened, "default", sdaiRO);
SdaiSet cartesianPoints = sdaiGetEntityExtentBN(modelRO, "cartesian_point");
SdaiIterator it = sdaiCreateIterator(cartesianPoints);
for (sdaiBeginning(it); sdaiNext(it);)
{
  SdaiAppInstance inst = nullptr;
  sdaiGetAggrByIterator(it, sdaiINSTANCE, &inst);
  ...
}
sdaiDeleteIterator(it);
sdaiCloseSession(session);

 
// Common ODA IFC SDK uninitialization part
odStepUninitialize();
odrxUninitialize();

 

exSDAISAS example which uses SDAI calls may be investigated additionally to get information of how to create modules which use SDAI.