How to initialize ODA IFC SDK for using SDAI API

  1. FAQ
  2. »
  3. IFC

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


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

// SDAI calls can be performed just after common initialization procedure
SdaiSession session = sdaiOpenSession();
SdaiRep repo = _sdaiCreateRepositoryFromFile(session, "c:\\file.ifcXML", "");
SdaiRep repoOpened = sdaiOpenRepositoryBN(session, "c:\\file.ifcXML");
SdaiModel modelRO = sdaiAccessModelBN(repoOpened, "default", sdaiRO);
SdaiSet cartesianPoints = sdaiGetEntityExtentBN(modelRO, "IfcCartesianPoint");
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
odIfcUninitialize();
odrxUninitialize();

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