selectLastCreated usage

 From:  dan (DANLANIGAN)
8256.1 
Hi all,

I'm writing a script that, as part of its functionality, creates a point and then selects it (for the purpose of naming it). Below is a simplified version of what I'm trying to do:
code:
function SelectLatest()
  {
  var pointfactory = moi.command.createFactory('point');
	pointfactory.setInput(0,moi.vectorMath.createPoint(0,0,0));
	pointfactory.commit();
  moi.geometryDatabase.selectLastCreated(true);
  }      
SelectLatest();

Problem is that this doesn't select the point that was just created, it doesn't select anything. If I assign
code:
script: moi.geometryDatabase.selectLastCreated(true);
to a keyboard shortcut and run it after manually adding a point it works fine. Is there something I am missing? Also is there a way to assign a name to an object, in this case a point, during creation? This would be more streamlined than what I'm currently trying to do.

Thanks.