Embed a node form with default values in drupal 7 How do I embed a node form and set some default values in that form in Drupal 7?

I understand that I can use this:

 $form = node_add('product_plan');
 print drupal_render($form);


That prints the form on to the page just fine, but I need help understanding how I can add default values. In Drupal 6, I would normally do this:

 function module_nodetype_form_embed( $property )
 {
     global $user;

    $node = new stdClass();
    $node-&gt;type = 'node_type';
    $node-&gt;uid = $user-&gt;uid;

    // Hidden through form alter
    $node-&gt;field_node_reference[0]['nid'] = $property-&gt;nid; 
    node_object_prepare( $node );

    return drupal_get_form( 'node_type_node_form', $node );

 }


So how can I get the same functionality in Drupal 7
If you are using a 'select list' widget for the node reference you can do this:

$form = node_add('product_plan');
$form['FIELD_NAME'][$form['language']['#value']]['#value'] = 'NID';
return drupal_render($form);


'autocomplete' widget would look like:

$form = node_add('product_plan');
$element['#default_value'] = 'NID';
$form['FIELD_NAME'][$form['language']['#value']][0]['nid']['#value'] = node_reference_autocomplete_value($element, FALSE, '');
return drupal_render($form);