This returns the number of component instances and groups in the Entities collection. So all you get there is the number of instances in the root of the model (not even recursively.)
Btw, Steve is a component - not a group.
In the Ruby API you can query the component definitions for how many instances it has. It appear that the C API doesn’t expose this…
However, I’m trying to understand how to iterate the model when you export. Are you exporting individual components from the model? Instead of the full model hierarchy?
If you traverse the model hierarchy then you can just export everything you traverse.
If you are traversing the list of definitions and trying to export the ones who have at least an instance - then I can see it being a little less trivial when we don’t expose the instance count. I’ll check with my colleagues to make sure. If we don’t have that property exposed yet you’d have to traverse the whole model tree and count each instance for each definition.
Additionally, unlike the Ruby API which let you traverse the definition list and get images and groups as well - the C API return ONLY components.
But I’m still confused, you said:
Meaning you call SUModelGetEntities? In which case that is the same as Sketchup.active_model.entities in the Ruby API. That is the root context of the model. Note that this entities collection is not a list of ALL the entities in the model. You would have to recurse into the entities of groups and components to get that.