How do I get the default billing/shipping customer profile in code? Is there a way to get the default billing/shipping customer profile from a user?

I'm getting all customer profiles with:

$profiles = commerce_customer_profile_load_multiple(array(), array('uid' =&gt; $user-&gt;uid));


But which customer profile was set as default by the user?
You can get default user profile address with  

commerce_addressbook_get_default_profile_id($uid, $type)


Returns the default profile id for a specific uid and profile type.

@param $uid
    The uid of the user whose default profile id should be returned.    

@param $type
    The type of customer profile to look up.

@return
   The id of the default profile if set, FALSE otherwise.

An example if want get  current user shipping addresss use below code :

global $user;
$default_pid=commerce_addressbook_get_default_profile_id($user-&gt;uid,'shipping');