The PrimElementIterator in the API Output Framework is a heavyweight IAPIPseudoIterator. It contains not only the API_Element from the container, but it also contains a list of it’s primitive elements. This way it works with the same containers as the ElementIterator but references the primitives instead. (If the containers would contain the primitive list, then we’d need to double the amount of containers – one for elements an one for primitives, and all the containers would share the same algorithm.)
The reason why the iterator contains the primitives is that the API doesn’t provide a way to get the next primitive; instead there’s only a callback to decompose an API_Element into API_PrimElements. As a callback doesn’t work together with an iterator, it was necessary to create a list of the primitives first, and then iterate through this list with the iterator’s operator++ () methods.
Version: API 10.21 or later