Getting a list of all portals is a bit more complicated than one might think at first as it's not a class. A portal is a 3D Entity with special flags. So here is the Run VSL code. Note that scene is a pIn of type Scene and portals is a pOut of type ObjectArray. I am also using feranti's for-loop style
void main()
{
ObjectArray ents;
bc.FillObjectArrayByType(ents, CKCID_3DENTITY, false, scene);
int count = ents.Size();
Entity3D ent = NULL;
portals.Clear();
for(int i=-1; ++i<count;)
{
ent = Entity3D.Cast(ents[i]);
if( and(ent.GetFlags(), CK_3DENTITY_PORTAL) )
{
portals.PushBack(ents[i]);
}
}
}