How to find total number of geometry components present in Rhino model

I am working on Rhino to Parasolid converter, To show the progress status I need to know the total number of geometry component present in a model. Is there any API which can provide me this information ?.
I am using OpenNURBS SDK with C++.

Hi @psomesh94,

Just do something like this:

unsigned int ONX_Model_ModelGeometryCount(const ONX_Model& model)
{
  unsigned int model_geometry_count = 0;

  ONX_ModelComponentIterator it(model, ON_ModelComponent::Type::ModelGeometry);
  const ON_ModelComponent* model_component = nullptr;
  for (model_component = it.FirstComponent(); nullptr != model_component; model_component = it.NextComponent())
    model_geometry_count++;

  return model_geometry_count;
}

– Dale

Thanks for the suggestion @dale.
I understood there is no direct API for this, I need to iterate the components.