Render an item trough displaysuite? Admitted, I don't truly understand Displaysuite.

What I need, is, something of the following: 

foreach (get_certain_nodes(), $nid) {
  $node = node_load($nid);
  $rendered_node = call_displaysuite_to_render_the_node($node, 'build_mode_foo');
  $output .= $rendered_node;
}


The missing link is how to render the node, using a predefined build mode. Or am I doing it wrong?
This is not a complete answer, but maybe it helps to have a look at the nd_views_node_helper function. If I understand correctly, it's the helper function that allows Views rows to be rendered through Display Suite.

You can also make your custom code dependent on views: create a view which takes node IDs as argument and renders the nodes through Display Suite.

Hope that helps!